{"id":208934,"date":"2014-01-13T17:34:03","date_gmt":"2014-01-13T13:34:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=208934"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=208934","title":{"rendered":"<span class=\"post_title\">\u041b\u0438\u0441\u043f \u0438\u0437 \u041f\u0438\u0442\u043e\u043d\u0430<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u0421\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u041f\u0438\u0442\u043e\u043d \u2014 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043b\u0430\u0441\u0442\u0438\u0447\u043d\u044b\u0439 \u044f\u0437\u044b\u043a. \u0412 \u043d\u0435\u043c \u043d\u0435\u0442 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432 \u043d\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0441\u043b\u043e\u0432\u0430 \u00ab\u043c\u0430\u043a\u0440\u043e\u0441\u00bb, \u043d\u0435\u0442 \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0445 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0445 \u043c\u0438\u043a\u0441\u0438\u043d\u043e\u0432, \u043a\u0430\u043a \u0432 D, \u043d\u0435\u043b\u044c\u0437\u044f \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b. \u0420\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c \u044f\u0437\u044b\u043a \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u043e\u0432\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432. \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043d\u0430 \u041f\u0438\u0442\u043e\u043d\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d \u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0443 \u0438, \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u0441\u0442\u0438\u043b\u044e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c. \u00abOne way to do it\u00bb. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u041f\u0438\u0442\u043e\u043d \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u0447\u0442\u043e, \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043e\u0447\u0435\u043d\u044c \u0434\u0430\u0436\u0435 \u0445\u043e\u0440\u043e\u0448\u043e. \u041d\u043e \u0441\u043a\u0443\u0447\u043d\u043e.<\/p>\n<p>  \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u043f\u0440\u043e\u044f\u0432\u0438\u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u044e, \u043f\u0438\u0442\u043e\u043d\u043e\u0432\u0441\u043a\u0438\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u043e\u043c\u0430\u0442\u044c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0437 \u041f\u0438\u0442\u043e\u043d\u0430 \u041b\u0438\u0441\u043f. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u2014 \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0439 \u043f\u0438\u0442\u043e\u043d\u043e\u0432\u0441\u043a\u0438\u0439 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u043e\u043c \u0431\u0435\u0437 \u0432\u0441\u044f\u043a\u043e\u0439 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c &quot;[24, 42]&quot;.<\/p>\n<pre><code class=\"python\">from fakelisp import *  # And now you can write Lisp (BEGIN \t(SET (F) (LAMBDA (X) \t\t(IF (EQ (X) (1)) \t\t\t(1) \t\t\t(MUL (X) (F (SUB (X) (1)))))))  \t(SET (X) (QUOTE (F (4)) (42))))  # Back to Python any time print &quot;x: &quot;, X <\/code><\/pre>\n<p>  <a name=\"habracut\"><\/a><br \/>  \u0413\u0440\u0430\u043c\u043e\u0442\u043d\u044b\u0439 \u0433\u043b\u0430\u0437 \u0437\u0430\u043c\u0435\u0442\u0438\u0442, \u0432\u043f\u0440\u043e\u0447\u0435\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u041b\u0438\u0441\u043f. \u0410\u0442\u043e\u043c\u044b \u0432 \u041b\u0438\u0441\u043f\u0435 \u043d\u0435 \u043d\u0430\u0434\u043e \u043e\u043a\u0440\u0443\u0436\u0430\u0442\u044c \u0441\u043a\u043e\u0431\u043a\u0430\u043c\u0438. \u0413\u043b\u0430\u0437 \u043f\u0443\u0441\u0442\u044c \u043c\u0435\u043d\u0435\u0435 \u0433\u0440\u0430\u043c\u043e\u0442\u043d\u044b\u0439, \u043d\u043e \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439, \u0437\u0430\u043c\u0435\u0442\u0438\u0442 \u0441\u043b\u043e\u0432\u043e \u00abfake\u00bb \u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044f. \u0418 \u0434\u0430, \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u041b\u0438\u0441\u043f \u044d\u0442\u043e \u043f\u043e\u0434\u0434\u0435\u043b\u044c\u043d\u044b\u0439. \u041d\u043e \u043e\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u0430\u043a \u041b\u0438\u0441\u043f \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a \u041b\u0438\u0441\u043f, \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 \u0443\u0442\u0438\u043d\u043e\u0439 \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u043e \u041b\u0438\u0441\u043f.<\/p>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0436\u0435, \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. <\/p>\n<p>  \u041e\u0441\u043d\u043e\u0432\u043e\u0439 \u044f\u0437\u044b\u043a\u0430 \u041b\u0438\u0441\u043f \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f s-\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f: \u0441\u043f\u0438\u0441\u043a\u0438 \u0438\u0437 \u0430\u0442\u043e\u043c\u043e\u0432 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 s-\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>(+ 2 2)<\/code> \u2014 \u044d\u0442\u043e \u0441\u043f\u0438\u0441\u043e\u043a, \u0433\u0434\u0435 \u043f\u0435\u0440\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0430\u0442\u043e\u043c (\u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f), \u0432\u0442\u043e\u0440\u043e\u0439 \u2014 \u0430\u0442\u043e\u043c (\u0447\u0438\u0441\u043b\u043e) \u0438 \u0442\u0440\u0435\u0442\u0438\u0439 \u2014 \u0442\u043e\u0436\u0435 \u0430\u0442\u043e\u043c (\u0447\u0438\u0441\u043b\u043e). \u042d\u0442\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043a \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u0430\u0442\u043e\u043c\u0430\u043c \u043f\u043e\u0434\u043e\u0431\u0430\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u0410 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u043e\u0436\u043d\u0435\u0435:<code> (+ 2 (- 6 4))<\/code>. \u0412 \u043d\u0435\u043c \u0432\u0441\u0435 \u043f\u043e-\u0441\u0442\u0430\u0440\u043e\u043c\u0443, \u043d\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u2014 \u043d\u0435 \u0430\u0442\u043e\u043c, \u0430 \u0442\u043e\u0436\u0435 s-\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435. \u0422\u0435\u043f\u0435\u0440\u044c, \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u043d\u0430\u0434\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c <code>(- 6 4)<\/code>, \u0430 \u043f\u043e\u0442\u043e\u043c \u0432\u0437\u044f\u0442\u044c\u0441\u044f \u0437\u0430 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435. \u041c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u0435 s-\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0446\u0435\u043b\u044b\u0435 \u0434\u0435\u0440\u0435\u0432\u044c\u044f \u0438\u0437 \u043d\u0438\u0445, \u043d\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0432\u0441\u0435 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0432 \u0430\u0442\u043e\u043c. \u0418\u043b\u0438 \u0432 \u0434\u0440\u0443\u0433\u043e\u0435 s-\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435. \u042d\u043b\u0435\u0433\u0430\u043d\u0442\u043d\u043e!<\/p>\n<p>  \u041e\u0431\u044b\u0447\u043d\u043e, \u0432 \u041b\u0438\u0441\u043f\u0435 \u043f\u0435\u0440\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 s-\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0430 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u2014 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u042d\u0442\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043d\u0435\u043f\u0440\u0438\u0432\u044b\u0447\u043d\u043e \u043f\u0440\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u0438, \u043d\u043e \u043d\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043a\u0430\u043a\u043e\u0433\u043e-\u043b\u0438\u0431\u043e API \u0438 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e \u0432 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u0445, \u0433\u0434\u0435 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u043d\u0435\u043e\u0447\u0435\u0432\u0438\u0434\u0435\u043d. <\/p>\n<p>  \u0410 \u0432 \u041f\u0438\u0442\u043e\u043d\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <code>(+ 2 2)<\/code>, \u0438 \u0434\u0430\u0436\u0435 <code>(ADD 2 2)<\/code> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u043e\u0439, \u0447\u0442\u043e \u0441\u043f\u0440\u0430\u0432\u0435\u0434\u043b\u0438\u0432\u043e. \u0412 \u044f\u0437\u044b\u043a\u0435 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0434\u043b\u044f \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u0438 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0435\u043c\u0443 \u043d\u0438 \u043a \u0447\u0435\u043c\u0443. \u041d\u043e \u0432\u043e\u0442 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435<code> (ADD (2) (2))<\/code>, \u0438\u043b\u0438 \u0447\u0442\u043e \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 <code>ADD(2)(2)<\/code> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u043c. \u041f\u0438\u0442\u043e\u043d \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441\u043b\u0435\u0432\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u043e, \u0442\u0430\u043a \u0447\u0442\u043e \u0435\u0441\u043b\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, ADD \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0442\u043e \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043f\u0440\u0435\u0442\u0435\u043d\u0437\u0438\u0439 \u043a \u0442\u0430\u043a\u043e\u043c\u0443 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044e \u0431\u044b\u0442\u044c \u043d\u0435 \u043c\u043e\u0436\u0435\u0442. \u0412\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 \u0441\u0432\u043e\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0430\u043c\u043e\u043f\u043e\u0434\u043e\u0431\u043d\u0443\u044e \u0436\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e\u0431\u044b \u0432\u043c\u0435\u0441\u0442\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0435.<\/p>\n<p>  \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u0435\u0435 \u043a\u043b\u0430\u0441\u0441:  <\/p>\n<pre><code class=\"python\">class Fun:     def __init__(self, fun = None, chain = []):         sefl.fun = fun         self.chain = chain     def __call__(self, next_arg):         return Fun(self.fun, self.chain + [next_arg]) <\/code><\/pre>\n<p>  \u0418 \u043f\u0430\u0440\u0443 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432:  <\/p>\n<pre><code class=\"python\">ADD = Fun(lambda *x: sum(s(x))) SUB = Fun(lambda *x: (s(x[0]) - s(x[1]))) <\/code><\/pre>\n<p>  \u0410 \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u0432\u0441\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e, \u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u043e\u043f\u0438\u043b\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u0435\u0449\u0435 \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f s-\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f:  <\/p>\n<pre><code class=\"python\">def s(x):     if isinstance(x, Fun):         return fun_map[x.uid]( *s(x.chain) )     else:         return x <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0438\u0441\u0430\u0442\u044c <code>(ADD (2) (SUB (6) (4)))<\/code> \u0438 \u043e\u0436\u0438\u0434\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u0430 4. \u041d\u043e \u043c\u044b \u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0441\u043a\u043e\u0431\u043a\u0438 \u044d\u0442\u0438 \u0441\u0432\u0435\u0440\u043d\u0443\u0442\u0441\u044f \u0432 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 Fun, \u0430 \u043d\u0435 \u0447\u0438\u0441\u043b\u043e. \u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0447\u0438\u0441\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u043b\u0438\u0431\u043e \u0440\u0443\u043a\u0430\u043c\u0438 \u0434\u0435\u0440\u043d\u0443\u0442\u044c s, \u043b\u0438\u0431\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c __repr__:  <\/p>\n<pre><code class=\"python\">class Fun:     def __init__(self, fun = None, chain = []):         sefl.fun = fun         self.chain = chain     def __call__(self, next_arg):         return Fun(self.fun, self.chain + [next_arg])     def __repr__(self):         return str(s(self)) <\/code><\/pre>\n<p>  \u0418\u0442\u0430\u043a, \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432\u0440\u043e\u0434\u0435 \u043a\u0430\u043a \u0435\u0441\u0442\u044c, \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, SET.<\/p>\n<p>  \u0412 \u041f\u0438\u0442\u043e\u043d\u0435 \u043d\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442. \u0412 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438 <code>(SET (X) (2))<\/code> X \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \u0437\u0430\u0440\u0430\u043d\u0435\u0435. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0441 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0447\u043b\u0435\u043d\u043e\u043c val, \u043d\u0430\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u043b\u0438 \u043c\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043d\u0430 \u0432\u0441\u0435 \u0441\u043b\u0443\u0447\u0430\u0438 \u0436\u0438\u0437\u043d\u0438 \u0438 \u043f\u043e\u043a\u0430 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438\u0441\u044c \u043d\u0430 \u044d\u0442\u043e\u043c. <\/p>\n<p>  \u0412\u043e\u043e\u0431\u0449\u0435-\u0442\u043e, SET \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0440\u0430\u0441\u0438\u0432\u043e\u0439 \u043b\u044f\u043c\u0431\u0434\u043e\u0439 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 \u043b\u044f\u043c\u0431\u0434\u0435 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u0438\u0439; \u043d\u043e \u044d\u0442\u043e \u043e\u0431\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432, \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043d\u0435 \u044d\u0442\u043e. \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0434\u0440\u0443\u0433\u043e\u0435. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043b\u044f\u043c\u0431\u0434\u043e\u0439 BEGIN.  <\/p>\n<pre><code class=\"python\">BEGIN = Fun(lambda *x: (x[-1])) <\/code><\/pre>\n<p>  BEGIN \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0432\u0441\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0438 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e. \u042d\u0442\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043a\u0440\u043e\u043c\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0443\u0442 SET, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u043d\u0430\u0440\u0443\u0448\u0430\u044e\u0449\u0438\u0445 \u0447\u0438\u0441\u0442\u043e\u0442\u0443 \u0441\u043b\u043e\u0432 \u0432 \u0424\u0435\u0439\u043a\u043b\u0438\u0441\u043f\u0435 \u0435\u0449\u0435 \u043d\u0435\u0442. \u041d\u043e \u0432\u043e\u0442 \u0435\u0441\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c SET \u0442\u0430\u043a\u0438\u043c \u0436\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c, \u0442\u043e \u043e\u043d \u043f\u0440\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0438 BEGIN \u0441\u0432\u0435\u0440\u043d\u0435\u0442\u0441\u044f \u0432 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 Fun \u0438 \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u0438\u044f \u043d\u0435 \u0441\u043e\u0441\u0442\u043e\u0438\u0442\u0441\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u0435\u0433\u043e \u0444\u0443\u043d\u043a\u0442\u043e\u0440\u043e\u043c.  <\/p>\n<pre><code class=\"python\">class SET:     def __init__(self, var):         self.var = var     def __call__(self, value):         self.var.val = value         return None <\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 SET, \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u043a\u043e\u0431\u043a\u0435 \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u0441\u044f; \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u044d\u0442\u043e\u0433\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430, \u0430 \u0444\u0443\u043d\u043a\u0442\u043e\u0440\u044b \u043f\u043e\u0442\u043e\u043c\u0443 \u0438 \u0444\u0443\u043d\u043a\u0442\u043e\u0440\u044b, \u0447\u0442\u043e \u0443 \u043d\u0438\u0445 \u0435\u0441\u0442\u044c \u044d\u0442\u043e\u0442 \u0432\u044b\u0437\u043e\u0432, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0441\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u0432 \u0437\u0430\u043f\u043e\u043c\u043d\u0435\u043d\u043d\u043e\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0435. \u0412\u043d\u0435\u0448\u043d\u0435 \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u0430\u043a <code>(SET (X) (123))<\/code>, \u043d\u043e \u0432\u0435\u0434\u0435\u0442 \u0441\u0435\u0431\u044f, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a<code> (ADD (X) (123))<\/code>.<\/p>\n<p>  \u0412\u043e\u0442 \u0432 \u0447\u0435\u043c \u043f\u043e\u0434\u0432\u043e\u0445. \u0415\u0441\u043b\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u0438\u0435 \u0432 \u0432\u0435\u0442\u043a\u0435 \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430, \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u0438\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0441\u0442\u044c \u0438\u043b\u0438 \u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u0438\u044f. \u041f\u0438\u0442\u043e\u043d \u0441\u0430\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442 \u0435\u0433\u043e \u043d\u0435 \u043e\u0442\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044f, \u043d\u0438\u0447\u0435\u0433\u043e \u0441 \u044d\u0442\u0438\u043c \u043f\u043e\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f. <\/p>\n<p>  \u041a \u0432\u043e\u043f\u0440\u043e\u0441\u0443 \u043e\u0431 \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0435. \u0423 \u043d\u0430\u0441 \u043d\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u041f\u0438\u0442\u043e\u043d\u0443, \u043a\u0430\u043a\u0438\u0435 \u0441\u043a\u043e\u0431\u043a\u0438 \u0441\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c, \u0430 \u043a\u0430\u043a\u0438\u0435 \u043d\u0435 \u0442\u0440\u043e\u0433\u0430\u0442\u044c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u043e\u0434\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u2014 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u0434\u0432\u0435 \u0432\u0435\u0442\u043a\u0438 \u0441\u0440\u0430\u0437\u0443, \u043d\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a \u043f\u043b\u043e\u0445\u043e, \u043a\u0430\u043a \u043a\u0430\u0436\u0435\u0442\u0441\u044f. \u0412 \u041b\u0438\u0441\u043f\u0435, \u043a\u0430\u043a \u0438 \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u0430\u0445, if \u2014 \u044d\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0438 \u043e\u043d\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0430\u043c\u0430, \u0442\u043e \u0435\u0441\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u0438\u0435 \u0432 \u0441\u0430\u043c\u043e\u0439 \u0432\u0435\u0442\u043a\u0435 \u043d\u0435\u0442. \u0412 \u041f\u0438\u0442\u043e\u043d\u0435, \u043a\u0441\u0442\u0430\u0442\u0438, \u0442\u043e\u0436\u0435 \u0435\u0441\u0442\u044c \u043f\u043e\u0445\u043e\u0436\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f.  <\/p>\n<pre><code class=\"python\">IF = Fun(lambda c, r1, r2: r1 if c else r2) <\/code><\/pre>\n<p>  \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u0433\u043b\u0430\u0432\u043d\u043e\u043c\u0443. \u041a \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0438. \u0415\u0441\u043b\u0438 \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u043d\u0430\u043c \u0443\u0434\u0430\u0432\u0430\u043b\u043e\u0441\u044c \u043e\u0431\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0442\u043e\u0447\u0435\u0447\u043d\u044b\u043c\u0438 \u0445\u0430\u043a\u0430\u043c\u0438 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u043e\u0441\u0442\u0438, \u0442\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0440\u0430\u0441\u0445\u043b\u0435\u0431\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430: \u043d\u0435\u0447\u0435\u0441\u0442\u043d\u044b\u0439 IF, \u043d\u0435\u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0435 \u0441\u043f\u0438\u0441\u043a\u0438 \u0438 \u043f\u043e\u0434\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0443 \u043a \u0438\u043c\u0435\u043d\u0430\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445. \u041f\u043e \u0434\u043e\u0431\u0440\u043e\u0439 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u0438 \u0440\u0435\u0448\u0430\u0442\u044c \u043d\u0430\u043a\u043e\u043f\u0438\u0432\u0448\u0438\u0435\u0441\u044f \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438 \u0431\u0443\u0434\u0435\u043c \u043d\u043e\u0432\u044b\u043c\u0438 \u0445\u0430\u043a\u0430\u043c\u0438.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435. \u041e\u0431\u044b\u0447\u043d\u043e \u0432 \u043b\u0438\u0441\u043f\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 lambda \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u043c\u0435\u043d \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0442\u0435\u043b\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041d\u043e \u0432 \u0441\u043f\u0438\u0441\u043a\u0438 \u0443 \u043d\u0430\u0441 \u0443\u043c\u0435\u044e\u0442 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0418 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043e\u0431\u0443\u0447\u0438\u0442\u044c \u0442\u043e\u043c\u0443 \u0436\u0435:  <\/p>\n<pre><code class=\"python\">class Var:     def __init__(self, val = None):         self.chain = [self]         self.val = val     def __call__(self, next_var):         self.chain += [next_var]         return self     def __repr__(self):         return str(self.val) <\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0441\u0435\u0431\u044f, \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0432\u044b\u0437\u043e\u0432\u0435 \u043d\u043e\u0432\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0437\u0430\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0443. \u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0438\u0434\u0435\u0442 \u0441\u043b\u0435\u0432\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u043e, \u0442\u0430\u043a \u0447\u0442\u043e <code>(X) (Y) (Z)<\/code> \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u0432 X \u0441 \u0446\u0435\u043f\u043e\u0447\u043a\u043e\u0439<code> [X, Y, Z]<\/code>.<\/p>\n<p>  \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043b\u044f\u043c\u0431\u0434\u0443.  <\/p>\n<pre><code class=\"python\">class LAMBDA:     def __init__(self, args):         self.args = [a for a in args.chain]     def __call__(self, body):         def l(args, body, x):             def assign_val((a, x)):                 a.val = x              old_x = [arg.val for arg in args]             map(assign_val, zip(args, x))              r = s(body)              map(assign_val, zip(args, old_x))             return r         return Fun(lambda *x: l(self.args, body, x)) <\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0437 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u0446\u0435\u043f\u043e\u0447\u043a\u0438 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u043e\u043c\u043d\u0435\u043d\u044b. \u041f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435, \u0430 \u044d\u0442\u043e \u043d\u0435 \u0432\u044b\u0437\u043e\u0432 \u0441\u0430\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0442\u043e\u0440\u0430\u044f \u0441\u043a\u043e\u0431\u043a\u0430 \u043b\u044f\u043c\u0431\u0434\u044b, \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u043c\u044b\u043a\u0430\u0435\u0442 \u0432 \u0441\u0432\u043e\u0438\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u0445 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b (<code>[X, Y, Z]<\/code>, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440) \u0438 \u0442\u0435\u043b\u043e. \u0410 \u0432\u043e\u0442 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u0441\u0430\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043c\u0430\u0433\u0438\u0438. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u0435\u0441\u044f \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u2014 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430\u0445 Var \u2014 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0434\u043c\u0435\u043d\u0435\u043d\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438, \u043f\u0440\u0438\u043d\u044f\u0442\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u043f\u0440\u0438 \u0435\u0435 \u0432\u044b\u0437\u043e\u0432\u0435, \u0430 \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 \u2014 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u044b \u043d\u0430 \u043c\u0435\u0441\u0442\u043e. \u0422\u043e \u0435\u0441\u0442\u044c \u043c\u044b \u0431\u044b\u0441\u0442\u0440\u0435\u043d\u044c\u043a\u043e \u0434\u0435\u043b\u0430\u0435\u043c \u0438\u0437 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u2014 \u0438, \u043f\u043e\u043a\u0430 \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0441\u0445\u0432\u0430\u0442\u0438\u043b \u0437\u0430 \u0440\u0443\u043a\u0443, \u043d\u0430\u0437\u0430\u0434.<\/p>\n<p>  \u0412\u0441\u0435 \u0445\u043e\u0440\u043e\u0448\u043e, \u043d\u043e \u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0430\u043b\u043e\u043c \u0438\u0437 \u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0442\u0430\u0442\u044c\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u0442. \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e IF \u0443 \u043d\u0430\u0441 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0438 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043e\u0431\u0435 \u0432\u0435\u0442\u043a\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0437\u0430\u0432\u0435\u0434\u043e\u043c\u043e \u043d\u0430\u0441 \u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442. \u0422\u043e \u0435\u0441\u0442\u044c \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u043e \u0434\u0432\u0443\u043c \u0432\u0435\u0442\u043a\u0430\u043c \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0441\u043b\u043e\u043c\u0430\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440. \u041f\u043e\u0431\u0435\u0434\u0438\u0442\u044c \u044d\u0442\u043e \u043f\u043e \u0447\u0435\u0441\u0442\u043d\u043e\u043c\u0443 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u043c \u0433\u043b\u0443\u0431\u0438\u043d\u0443 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0438 \u0440\u0430\u043d\u044c\u0448\u0435, \u0447\u0435\u043c \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u041f\u0438\u0442\u043e\u043d.  <\/p>\n<pre><code class=\"python\">MAX_RECURSION_DEPTH = 42  rc = 0 class LAMBDA:     def __init__(self, args):         self.args = [a for a in args.chain]     def __call__(self, body):         def l(args, body, x):             def assign_val((a, x)):                 a.val = x              old_x = [arg.val for arg in args]             map(assign_val, zip(args, x))                          global rc             rc += 1             if rc &lt; MAX_RECURSION_DEPTH:                 r = s(body)             else:                 r = 0             rc -= 1              map(assign_val, zip(args, old_x))             return r         return Fun(lambda *x: l(self.args, body, x)) <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0447\u0438\u0442\u0430\u0442\u044c\u0441\u044f-\u0442\u043e \u0432\u0441\u0435 \u0435\u0449\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u0441\u0435 \u0432\u0435\u0442\u043a\u0438, \u043d\u043e \u0432\u0435\u0440\u043d\u0435\u043c \u043c\u044b \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0443\u044e.<\/p>\n<p>  \u041d\u043e \u044d\u0442\u043e \u0442\u043e\u0436\u0435 \u0435\u0449\u0435 \u043d\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0443 \u043d\u0430\u0441 \u0442\u043e\u0436\u0435 \u043d\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0430 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0435 \u0446\u0435\u043f\u043e\u0447\u043a\u0438. \u0422\u043e \u0435\u0441\u0442\u044c<code> ADD (X) (Y)<\/code> \u2014 \u044d\u0442\u043e \u043d\u0435 \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u0447\u0442\u043e <code>ADD (X)<\/code> \u0438 \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435 <code>ADD<\/code>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e F \u0447\u0435\u0440\u0435\u0437 F \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f. \u0412 \u0442\u0435\u043b\u0435 \u043b\u044f\u043c\u0431\u0434\u044b \u0437\u0430\u043c\u043a\u043d\u0435\u0442\u0441\u044f \u00ab\u0441\u0442\u0430\u0440\u044b\u0439\u00bb F, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 F \u00ab\u043d\u043e\u0432\u043e\u0433\u043e\u00bb.<\/p>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 Fun. \u0415\u0441\u043b\u0438 \u043f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 Fun \u0434\u0430\u0432\u0430\u0442\u044c \u0435\u043c\u0443 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u043e \u0446\u0435\u043f\u043e\u0447\u043a\u0435 \u0432\u0441\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u043c, \u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0432 \u0430\u0441\u0441\u043e\u0446\u0438\u0430\u0442\u0438\u0432\u043d\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0435, <code>ADD (X)<\/code> \u043d\u0435 \u0431\u0443\u0434\u0435\u0442, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043e\u0441\u0442\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u0435\u043c \u0436\u0435, \u0447\u0442\u043e <code>ADD<\/code>, \u043d\u043e \u043d\u0430\u0441 \u044d\u0442\u043e \u0443\u0436\u0435 \u0432\u043e\u043b\u043d\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u0442. \u041c\u044b \u0431\u0443\u0434\u0435\u0442 \u0431\u0440\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u043e \u0438\u0445 \u043e\u0431\u0449\u0435\u043c\u0443 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0443 \u0438 \u043f\u043e\u0434\u043c\u0435\u043d\u044f\u0442\u044c \u043f\u0440\u0438 \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u0438\u0438 \u0431\u0443\u0434\u0435\u043c, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0435\u0435 \u0436\u0435.  <\/p>\n<pre><code class=\"python\">common_id = 0  fun_map = {}  class Fun:     def __init__(self, fun = None, chain = [], uid = None):         if uid != None:             self.uid = uid         else:             global common_id             common_id += 1             self.uid = common_id             fun_map[self.uid] = fun                 self.chain = chain     def __call__(self, next_arg):         return Fun(None, self.chain + [next_arg], self.uid)     def __repr__(self):         return str(s(self)) <\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u044d\u0442\u043e \u0443\u0436\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a \u043d\u0430\u0434\u043e. \u041d\u0443 \u0438\u043b\u0438 \u043f\u043e\u0447\u0442\u0438 \u043a\u0430\u043a \u043d\u0430\u0434\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0433\u043b\u0443\u0431\u0438\u043d\u0430 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0438 \u0443 \u043d\u0430\u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0430, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0442\u043e\u0436\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e, \u0430 IF \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e. \u041d\u043e \u0432\u0441\u0435-\u0442\u0430\u043a\u0438.<\/p>\n<p>  \u041f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438 \u043f\u043e\u0442\u0440\u043e\u0433\u0430\u0442\u044c \u043d\u0430 <a href=\"https:\/\/github.com\/akalenuk\/fakelisp\">\u0433\u0438\u0442\u0445\u0430\u0431\u0435<\/a>.<\/p>\n<p>  \u0417\u0430\u0440\u0430\u043d\u0435\u0435 \u0432\u044b\u043d\u0443\u0436\u0434\u0435\u043d \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0434\u0438\u0442\u044c, \u0446\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0430\u043d\u0435\u043a\u0434\u043e\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e. \u041b\u0438\u0446\u0435\u043d\u0437\u0438\u044f, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u0442 \u0435\u0433\u043e \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435, \u043d\u043e \u044f, \u043a\u0430\u043a \u0430\u0432\u0442\u043e\u0440, \u043d\u0430\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u0430\u043a\u043e\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043d\u0435 \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e. \u041d\u0430 \u0444\u0435\u0439\u043a\u043b\u0438\u0441\u043f\u0435 \u043c\u043e\u0436\u043d\u043e, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0435, \u043d\u043e \u043b\u0443\u0447\u0448\u0435 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c. \u042d\u0442\u043e \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043b\u0438\u0441\u043f, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u043b\u0438\u0441\u043f \u043d\u0430 \u041f\u0438\u0442\u043e\u043d\u0435, \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430<a href=\"http:\/\/norvig.com\/lispy.html\"> lis.py <\/a> \u0438 <a href=\"http:\/\/norvig.com\/lispy2.html\">lispy.py<\/a> \u041f\u0438\u0442\u0435\u0440\u0430 \u041d\u043e\u0440\u0432\u0438\u0433\u0430, \u0430 \u0435\u0441\u043b\u0438 \u041f\u0438\u0442\u043e\u043d \u0441 \u043b\u0438\u0441\u043f\u043e\u0432\u044b\u043c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u043e\u043c, \u0442\u043e \u043d\u0430 <a href=\"http:\/\/julien.danjou.info\/blog\/2013\/lisp-python-hy\">Hy<\/a>.    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/208934\/\"> http:\/\/habrahabr.ru\/post\/208934\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u0421\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u041f\u0438\u0442\u043e\u043d \u2014 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043b\u0430\u0441\u0442\u0438\u0447\u043d\u044b\u0439 \u044f\u0437\u044b\u043a. \u0412 \u043d\u0435\u043c \u043d\u0435\u0442 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432 \u043d\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0441\u043b\u043e\u0432\u0430 \u00ab\u043c\u0430\u043a\u0440\u043e\u0441\u00bb, \u043d\u0435\u0442 \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0445 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0445 \u043c\u0438\u043a\u0441\u0438\u043d\u043e\u0432, \u043a\u0430\u043a \u0432 D, \u043d\u0435\u043b\u044c\u0437\u044f \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b. \u0420\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c \u044f\u0437\u044b\u043a \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u043e\u0432\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432. \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043d\u0430 \u041f\u0438\u0442\u043e\u043d\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d \u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0443 \u0438, \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u0441\u0442\u0438\u043b\u044e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c. \u00abOne way to do it\u00bb. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u041f\u0438\u0442\u043e\u043d \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u0447\u0442\u043e, \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043e\u0447\u0435\u043d\u044c \u0434\u0430\u0436\u0435 \u0445\u043e\u0440\u043e\u0448\u043e. \u041d\u043e \u0441\u043a\u0443\u0447\u043d\u043e.<\/p>\n<p>  \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u043f\u0440\u043e\u044f\u0432\u0438\u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u044e, \u043f\u0438\u0442\u043e\u043d\u043e\u0432\u0441\u043a\u0438\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u043e\u043c\u0430\u0442\u044c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0437 \u041f\u0438\u0442\u043e\u043d\u0430 \u041b\u0438\u0441\u043f. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u2014 \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0439 \u043f\u0438\u0442\u043e\u043d\u043e\u0432\u0441\u043a\u0438\u0439 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u043e\u043c \u0431\u0435\u0437 \u0432\u0441\u044f\u043a\u043e\u0439 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c &quot;[24, 42]&quot;.<\/p>\n<pre><code class=\"python\">from fakelisp import *  # And now you can write Lisp (BEGIN \t(SET (F) (LAMBDA (X) \t\t(IF (EQ (X) (1)) \t\t\t(1) \t\t\t(MUL (X) (F (SUB (X) (1)))))))  \t(SET (X) (QUOTE (F (4)) (42))))  # Back to Python any time print &quot;x: &quot;, X <\/code><\/pre>\n<p>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-208934","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/208934","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=208934"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/208934\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=208934"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=208934"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=208934"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}