{"id":446613,"date":"2025-01-31T15:01:09","date_gmt":"2025-01-31T15:01:09","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=446613"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2025-01-31T15:01:09","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=446613","title":{"rendered":"<span>GIMP Script-Fu \u041f\u0435\u0440\u0432\u044b\u0439 \u0414\u0430\u043d. \u041e\u0431\u044a\u0435\u043a\u0442\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 Scheme. \u041f\u0440\u043e\u0441\u0442\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041d\u0430 \u043f\u0440\u043e\u0442\u044f\u0436\u0435\u043d\u0438\u0438 \u0432\u0441\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044f\u0437\u044b\u043a\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0438 \u042d\u0448\u0435\u0440\u0430 \u0425\u0435\u043d\u0434\u0435\u0440\u0441\u043e\u043d\u0430 \u043c\u044b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u043b\u0438 <strong>tinyscheme<\/strong>, \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u043c\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u043c\u0438 \u0438 \u043d\u0438 \u0440\u0430\u0437\u0443 \u0443 \u043c\u0435\u043d\u044f \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u043b\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u041e\u0431\u044a\u0435\u043a\u0442\u043d\u043e-\u041e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434, \u043d\u043e \u0432\u043e\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0432 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044e \u0424\u0438\u0433\u0443\u0440\u044b,<\/p>\n<details class=\"spoiler\">\n<summary>\u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u043a\u043e\u0434:<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"lisp\">(define (draw-fig img fig tr)    (let* ((contour    (if tr                           (translate-contour (fig-contour fig) tr)                           (fig-contour fig)))           (num-points (length contour))           (points     (make-contour-vector contour  num-points))           (dw         (car (gimp-image-get-active-drawable img))))       ;;(gimp-context-push)       (gimp-context-set-foreground (fig-color fig))       (cond        ((eq? (fig-type fig) 'pencil)         ((fig-brush fig))         (gimp-pencil  dw (* 2  num-points) points)        ((eq? (fig-type fig) 'brush)         ((fig-brush fig))         (gimp-paintbrush-default  dw (* 2  num-points) points))        ((eq? (fig-type fig) 'shape)         ;;(gimp-image-select-polygon  img CHANNEL-OP-REPLACE num-points points)         (gimp-free-select  img (- (* 2  num-points) 1) points  CHANNEL-OP-REPLACE 0 0 0)         (gimp-edit-fill dw  FOREGROUND-FILL)         (gimp-selection-none img))        )       ;;(gimp-context-pop)   ))<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u044f \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u044f\u0437\u044b\u043a\u0443 <strong>tinyscheme<\/strong> \u043e\u0447\u0435\u043d\u044c \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438 \u043f\u043e\u043b\u0438\u043c\u043e\u0440\u0444\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044e \u0444\u0438\u0433\u0443\u0440\u044b, \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0438\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b. \u041d\u0435\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c \u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u043c\u043e\u0436\u043d\u043e, \u043d\u043e \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0435\u0451 \u0434\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c.<\/p>\n<h2>\u0427\u0442\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c<\/h2>\n<p>TinySchema \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0434\u043b\u044f \u041e\u041e\u041f. \u041a\u0442\u043e \u0442\u043e \u0434\u0430\u0436\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u0447\u0442\u043e \u041b\u0438\u0441\u043f \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u044f\u0437\u044b\u043a\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u043c\u0438, \u0442.\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u043c\u0438 \u0447\u0438\u0441\u0442\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043d\u0435 \u0438\u043c\u0435\u044e\u0449\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439. \u042d\u0422\u041e \u041d\u0415 \u0422\u0410\u041a! \u0418\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440 \u044f\u0437\u044b\u043a\u0430 Scheme \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043c\u043e\u0434\u0435\u043b\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u044e\u0449\u0443\u044e\u0441\u044f \u043d\u0430 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f\u0445, \u044d\u0442\u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c, \u0442.\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435. \u0418 \u043a\u0430\u0436\u0434\u0430\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043a\u043e\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u043e \u0438 \u043d\u0430 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u044b\u043b\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430 \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f.  \u0438 \u044d\u0442\u0438\u043c \u0444\u0430\u043a\u0442\u043e\u043c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432 \u0441\u0445\u0435\u043c\u0435.<\/p>\n<p>\u041d\u043e, \u0447\u0442\u043e \u0436\u0435 \u0442\u0430\u043a\u043e\u0435 \u041e\u041e\u041f \u0438 \u043a\u0430\u043a\u0438\u043c \u043e\u043d\u043e \u0431\u044b\u0432\u0430\u0435\u0442? \u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u041e\u041e\u041f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0438\u0437 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439-\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u0432 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043a\u043b\u0430\u0441\u0441\u0430. \u041a\u043b\u0430\u0441\u0441\u044b \u043c\u043e\u0433\u0443\u0442 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044e \u043a\u043b\u0430\u0441\u0441\u043e\u0432. \u0412 \u044d\u0442\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u043a\u043b\u0430\u0441\u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438 \u043c\u0435\u0442\u043e\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0442 \u043a\u043b\u0430\u0441\u0441\u0443. \u042d\u0442\u043e \u0448\u0438\u0440\u043e\u043a\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u041e\u041e\u041f, \u043d\u043e \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0440\u0430\u043d\u044c\u0448\u0435 \u0431\u044b\u043b\u0430 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0435 \u0431\u044b\u043b\u043e \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u043a\u043b\u0430\u0441\u0441\u044b \u044d\u0442\u043e \u043b\u0438\u0448\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0443\u043f\u0440\u043e\u0449\u0430\u044e\u0449\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441\u043e \u0441\u0445\u0435\u043c\u0430\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u0411\u0435\u0437\u043a\u043b\u0430\u0441\u0441\u043e\u0432\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u044d\u0442\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0449\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c, \u0432 \u043b\u0438\u0441\u043f\u0435 \u0442\u0430\u043a\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u0435\u043c(\u041a\u0430\u043a \u044f \u0443\u0436\u0435 \u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u043b, \u0447\u0442\u043e \u0432\u0441\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u041b\u0438\u0441\u043f\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u044f\u043c\u0438, \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0435 \u043f\u0440\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0430\u043a \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u044f\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 <code>\u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435<\/code>, \u0442.\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0435, \u0433\u0434\u0435 \u0442\u043e \u0432 <code>\u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438<\/code> \u0444\u0443\u043d\u043a\u0446\u0438\u0438). \u041f\u043e\u0437\u0436\u0435 (\u0432 \u041b\u0438\u0441\u043f\u0435) \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u043a\u043b\u0430\u0441\u0441\u044b \u0438 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435. \u041d\u043e \u044d\u0442\u0438 \u043a\u043b\u0430\u0441\u0441\u044b(\u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0438 \u043e\u0442 \u0421\u0438++ \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439) \u0432\u043a\u043b\u044e\u0447\u0430\u043b\u0438 \u0432 \u0441\u0435\u0431\u044f \u043b\u0438\u0448\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u0432\u0441\u0451 \u0441\u043b\u043e\u0436\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u043b\u043e\u0441\u044c \u0447\u0435\u0440\u0435\u0437 <code>\u043e\u0431\u043e\u0431\u0449\u0451\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/code>, \u0438\u0437\u043c\u0435\u043d\u044f\u044e\u0449\u0438\u0435 \u0441\u0432\u043e\u0451 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0438\u043f\u043e\u0432 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0445 \u0432 \u043d\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. <code>\u041e\u0431\u043e\u0431\u0449\u0451\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/code> \u043d\u0435 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0442 \u043a\u0430\u043a\u043e\u043c\u0443 \u043b\u0438\u0431\u043e \u043a\u043b\u0430\u0441\u0441\u0443. \u042d\u0442\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u041e\u041e\u041f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0432 \u041b\u0438\u0441\u043f\u0435(CLOS) \u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u0445  Scheme(\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432 guile &#8212; GOOPS). \u042d\u0442\u0430 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f \u043c\u0430\u043b\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432, (\u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043d\u0430 \u0435\u0451 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0438 \u0442\u0430\u043a \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f) \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442, \u0447\u0442\u043e \u043c\u0435\u0442\u043e\u0434\u044b \u043c\u043e\u0433\u0443\u0442 \u043d\u0435 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u0430\u043c, \u0430 \u044f\u0432\u043b\u044f\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u043d\u044b\u043c\u0438 \u0441\u043b\u0443\u0447\u0430\u043c\u0438 \u043e\u0431\u043e\u0431\u0449\u0451\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439.<\/p>\n<p>\u041d\u043e \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u044e \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435  Scheme. \u041a\u043b\u0430\u0441\u0441\u044b \u044d\u0442\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u044b. \u041e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0439 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043f\u0443\u0442\u0451\u043c \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f. \u041f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0435 \u043d\u0438\u0436\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043d\u0435\u0442!! \u041e\u043d\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 <strong>\u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u044f<\/strong>, \u0442.\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u0443\u044e \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0431\u043b\u043e\u043a\u043e\u043c <strong>\u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f<\/strong>, \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435 &#8212; \u0447\u0430\u0441\u0442\u044c \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u043f\u043e\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0430 \u0447\u0430\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0438\u0435 \u0437\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442. \u042d\u0442\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435. \u0442.\u0435. \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0432 \u043d\u0451\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u044b, \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u044b, \u0438 \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u044f\u0441\u044c \u043d\u0430 \u043d\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445 \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 &#8212; \u043c\u0435\u0442\u043e\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0432 \u044d\u0442\u043e\u043c \u0436\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438.<\/p>\n<h2>\u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0431\u044a\u0435\u043a\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u0447\u0451\u0442\u0447\u0438\u043a, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u043f\u043e\u043b\u044f \u0438\u043c\u044f \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043c\u0430\u043a\u0440\u043e\u0441, \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0449\u0438\u0439 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438, \u043d\u0443 \u0438\u043b\u0438 \u0435\u0441\u043b\u0438 \u0443\u0433\u043e\u0434\u043d\u043e &#8212; \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430\u043c\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u0438\u043b\u0438 \u0435\u0441\u043b\u0438 \u0434\u0443\u043c\u0430\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e, \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b.<\/p>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442-\u0444\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043d\u0430\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043c\u0430\u043a\u0440\u043e\u0441.<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u043a \u0440\u0430\u0431\u043e\u0442\u0435<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"lisp\">;;(define path-home \"D:\") ;;\u0434\u043b\u044f \u0432\u0438\u043d\u0434\u043e\u0432\u0441 (define path-home (getenv \"HOME\")) (define path-lib (string-append path-home \"\/work\/gimp\/lib\/\")) (define path-work (string-append path-home \"\/work\/gimp\/\")) (load (string-append path-lib \"util.scm\")) (load (string-append path-lib \"defun.scm\")) (load (string-append path-lib \"struct.scm\"))<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041c\u0430\u043a\u0440\u043e\u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0439 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0441\u043b\u043e\u0432\u0430, \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0441 \u0434\u0432\u043e\u0435\u0442\u043e\u0447\u0438\u044f(tinyscheme \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0438\u0445 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435).<\/p>\n<pre><code class=\"lisp\">(define-macro (def-keys . param-list)    `(begin  ,@(make-def-keys param-list))) <\/code><\/pre>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043a\u043e\u0434, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u0438 \u0432 \u043d\u0430\u0448\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435:<\/p>\n<pre><code class=\"lisp\">(def-keys :set-name :get-name :get :inc :dec)  (defun (make-named-counter &amp;key (name \"\") (count 0))    ;;object method    (define (set-name nm)       (set! name nm))    (define (get-name)       name)    (defun (inc &amp;opt (val 1))       (set! count (+ count val)))    (defun (dec &amp;opt (val 1))       (set! count (- count val)))    (define (get)       count)    ;;dispatcher message    (define (dispath message . param-list)       (case message          ((:get)           (get))          ((:inc) (if (pair? param-list)                      (inc (car param-list))                      (inc)))          ((:dec) (if (pair? param-list)                      (dec (car param-list))                      (dec)))          ((:get-name)           (get-name))          ((:set-name) (if (pair? param-list)                           (set-name (car param-list))))          ))     dispath) <\/code><\/pre>\n<p>\u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u041e\u041e\u041f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>make-named-counter<\/code> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440, \u0441\u043e\u0437\u0434\u0430\u044e\u0449\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u0442.\u0435 \u043d\u0435\u043a\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0432 \u0441\u0440\u0435\u0434\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0449\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c, \u043a\u0430\u043a \u0433\u043e\u0432\u043e\u0440\u044f\u0442 &#8212; \u0430\u043a\u0442\u043e\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0436\u0435 \u0434\u0435\u043b\u0435 \u044d\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0430\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u0435 <strong>\u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u044f<\/strong>. \u0414\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043c\u043e\u0436\u0435\u0442 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0432\u0430 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u043f\u043e\u043b\u044f: <code>name<\/code> \u0438 <code>count<\/code>. \u041f\u043e\u043c\u0438\u043c\u043e \u044d\u0442\u043e\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0430\u043a\u0440\u043e\u0441\u0430 <code>def-keys<\/code> \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u044f\u0432\u043b\u044f\u044e\u0449\u0438\u0445\u0441\u044f \u0438\u043c\u0435\u043d\u0430\u043c\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043d\u0430\u0448\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440. \u0418 \u0435\u0449\u0451 \u0440\u0430\u0437: \u041d\u0430\u0448 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>dispath<\/code> &#8212; \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440, \u043d\u0435\u0442, \u043e\u043d \u0432\u043e\u0437\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u0435 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u043f\u043e\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0438\u043c\u044f \u0438 \u0441\u0447\u0451\u0442\u0447\u0438\u043a, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u043b\u043e\u0432\u043d\u043e \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0430\u043a\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0432 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440\u0430 \u0438 \u0438\u043c\u0435\u044e\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c \u043f\u043e\u043b\u044f\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0430.<\/p>\n<p>\u041f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0435\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u0435.<\/p>\n<pre><code class=\"lisp\">(define c1 (make-named-counter :name \"c1 counter\")) ;;\u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u043e\u043b\u0435\u043c name (c1 :get-name) ;;\"c1 counter\" (c1 :set-name \"test c1\") ;;\"test c1\" (c1 :get-name)           ;;\"test c1\" ;;\u0440\u0430\u0431\u043e\u0442\u0430 \u0441\u043e \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u043e\u043c. (c1 :get) ;;0 (c1 :inc) ;;1 (c1 :inc) ;;2 (c1 :inc 8) ;;10 (c1 :dec 2) ;;8 (c1 :get) ;;8  (define c2 (make-named-counter :name \"c2 counter\" :count 13)) (c2 :get)     ;13 (c2 :inc 10)  ;23 (c2 :get 10)  ;23 , 10 \u0432 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u0445 \u043d\u0438\u0433\u0434\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f. (c1 :get)     ;8 , \u0441\u0447\u0451\u0442\u0447\u0438\u043a c1 \u043f\u043e \u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 8. <\/code><\/pre>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c \u0438\u0434\u0435\u044f \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043d\u044f\u0442\u043d\u0430, \u0437\u0434\u0435\u0441\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u044d\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u043c\u0438, \u0432\u0435\u0440\u043d\u0435\u0435 \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u043c\u0438\u0441\u044f \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0435\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0438\u0445 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0444\u0443\u043d\u043a\u0446\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438. \u0410 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u044d\u0442\u043e \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0441\u043b\u043e\u0432\u0430, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044f-\u043e\u0431\u044a\u0435\u043a\u0442 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442 \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0443\u0436\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434, \u0442\u0430\u043a \u0436\u0435 \u043e\u043f\u0440\u0435\u0434\u0451\u043b\u0451\u043d\u043d\u044b\u0439 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435.<\/p>\n<h2>\u041e\u041e\u041f \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441<\/h2>\n<p>\u0418 \u0435\u0441\u043b\u0438 \u0431\u044b \u044d\u0442\u043e \u0431\u044b\u043b \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043d\u0430 \u044d\u0442\u043e\u043c \u043d\u0430\u0448\u0435 \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0435 \u043e \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432 \u044f\u0437\u044b\u043a \u0438 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u043e\u0441\u044c \u0431\u044b. \u041d\u041e, \u044d\u0442\u043e \u043b\u0438\u0441\u043f! \u0417\u0434\u0435\u0441\u044c \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043c\u0430\u043a\u0440\u043e\u0441\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u044f\u0437\u044b\u043a\u0430. <\/p>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043a\u043b\u0430\u0441\u0441 (\u0430 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 &#8212; \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e-\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 make-name-counter) \u043f\u043e \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0448\u0430\u0431\u043b\u043e\u043d\u0443<\/p>\n<pre><code class=\"lisp\">(defclass named-counter  ;; \u0438\u043c\u044f \u043a\u043b\u0430\u0441\u0441\u0430    ((name \"\") (count 0)) ;;list fields - \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u043b\u0435\u0439 \u043e\u0431\u044a\u0435\u043a\u0442\u0430.    (((inc &amp;opt (val 1))  ;;list methods -\u0441\u043f\u0438\u0441\u043e\u043a \u043c\u0435\u0442\u043e\u0434\u043e\u0432 ((\u0438\u043c\u044f-\u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435) \u0442\u0435\u043b\u043e-\u043c\u0435\u0442\u043e\u0434\u0430) ...      (set! count (+ count val)))     ((dec &amp;opt (val 1))      (set! count (- count val)))     ((get)      count)     ((set-name nm)      (set! name nm))     ((get-name)      name))    () ;;\u043a\u043e\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0435\u0441\u043b\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043d\u0435\u043e\u043f\u043e\u0437\u043d\u0430\u043d\u043d\u043e, \u043c\u0435\u0442\u043e\u0434 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e    ) <\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0430\u043a\u0440\u043e\u0441 \u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0443\u0442\/\u043f\u0440\u0435\u0432\u0440\u0430\u0442\u044f\u0442 \u044d\u0442\u0443 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u0432\u044b\u0448\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044e.<\/p>\n<details class=\"spoiler\">\n<summary>\u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u043c\u0430\u043a\u0440\u043e\u0441\u044b.<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"lisp\">;;\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u0441\u043b\u043e\u0432 (define-macro (def-keys . param-list)    `(begin  ,@(make-def-keys param-list)))  ;;\u0441\u043e\u0437\u0430\u0435\u0442 \u043f\u043e \u0438\u043c\u0435\u043d\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u0430, \u0441\u0438\u043c\u0432\u043e\u043b \u043a\u043b\u044e\u0447(\u0441\u0438\u043c\u0432\u043e\u043b \u0441 \u0434\u0432\u043e\u0435\u0442\u043e\u0447\u0438\u0435\u043c) (define (sym2key s)    (string-&gt;symbol (string-append \":\"                                   (symbol-&gt;string s)))) ;;(sym2key 't1) ; :t1  ;;\u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043b\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0443\u0441\u043b\u043e\u0432\u0438\u0435 condition (define (condition-met-for-list condition lst)    (cond     ((null? lst) #f)     ((condition (car lst)) (car lst))     (else (condition-met-for-list condition (cdr lst)))))  ;;\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043f\u043e \u0441\u043f\u0438\u0441\u043a\u0443 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u0435\u0441\u0442\u044c \u043b\u0438 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0441\u043b\u043e\u0432\u0430, \u0447\u0442\u043e \u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f ;;\u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 defun (define (has-key-for-defun param-list)    (let ((lst-defun-keys '(&amp;key &amp;opt &amp;rest)))       (condition-met-for-list (lambda (x) (memq x lst-defun-keys))                               param-list)))  ;;\u043f\u043e \u0441\u043f\u0438\u0441\u043a\u0443 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443, \u0432\u044b\u0434\u0435\u043b\u044f\u044f \u0438\u043c\u044f \u043c\u0435\u0442\u043e\u0434\u0430, \u0438\u043c\u044f \u043a\u043b\u0447\u0430, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, ;;\u0438 \u043a\u043e\u0434 \u043c\u0435\u0442\u043e\u0434\u0430 (define-m (get-property-methods methods)    (let ((rez1 nil))       (do ((cur methods (cdr cur)))             ((null? cur) (reverse rez1))          (let* ((el            (car cur))                 (name-method   (caar el))                 (params-method (cdar el))                 (body-methods  (cdr  el))                 (key-method    (sym2key name-method)))             (set! rez1 (cons (list name-method key-method params-method body-methods)                              rez1))             ))))  ;;\u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0445\u0430\u043a, \u0447\u0442\u043e \u0431\u044b \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u043e\u0434\u0435 \u0441\u0438\u043c\u0432\u043e\u043b defun. \u041f\u0440\u044f\u043c\u043e\u0435 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u043a\u043e\u0434\u0435 ;;\u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043b\u043e \u043a \u043e\u0448\u0438\u0431\u043a\u0435 \u0432 define-m, \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u044b\u0442\u0430\u044e\u0449\u0435\u0433\u043e\u0441\u044f \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u044c \u043c\u0430\u043a\u0440\u043e\u0441 defun, \u043a\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u0435\u0449\u0451 \u043d\u0435 ;;\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f (define *symbol-defun* 'defun)  ;;\u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043a\u043e\u0434 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0439 \u043c\u0435\u0442\u043e\u0434\u044b \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0434\u0430\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 get-property-methods (define-m (make-list-methods property-metods)    (let ((rez1 nil))       (do ((cur property-metods (cdr cur)))             ((null? cur) (reverse rez1))          (let* ((el            (car cur))                 (name-method   (car el))                 (params-method (caddr el))                 (body-methods  (cadddr  el))                 (define-style  (if (has-key-for-defun params-method)                                    *symbol-defun*                                    'define)))             (set! rez1 (cons                         `(,define-style (,name-method ,@params-method)                             ,@body-methods)                         rez1))          ))))  ;;\u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043a\u043e\u0434 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u0434 \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440\u0430 (define-m (make-list-case-call-methods    property-metods param-list)    (let ((rez1 nil))       (do ((cur property-metods (cdr cur)))             ((null? cur) (reverse rez1))          (let* ((el            (car cur))                 (name-method   (car  el))                 (key-method    (cadr el))                 (params-method (caddr el)))             (set! rez1 (cons                         `((,key-method)                           ,(cond                             ((null? params-method) `(,name-method))                             ((has-key-for-defun params-method)                              `(if (pair? ,param-list)                                   (apply ,name-method ,param-list)                                   (,name-method)))                             (#t                              `(apply ,name-method ,param-list))))                         rez1))          )))) <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043c\u0430\u043a\u0440\u043e\u0441 \u0441\u043e\u0437\u0434\u0430\u044e\u0449\u0438\u0439 \u041e\u041e\u041f \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441.<\/p>\n<pre><code class=\"lisp\">;;\u043c\u0430\u043a\u0440\u043e\u0441 \u0441\u043e\u0437\u0434\u0430\u044e\u0449\u0438\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432\u044b\u0448\u0435 \u0444\u0443\u043d\u0446\u0438\u0438 (define-macro (defclass class-name fields methods default-body)    (let* ((dispath   (gensym)) (message (gensym)) (param-list (gensym))           (name-maker (string-&gt;symbol (string-append \"make-\"                                                      (symbol-&gt;string class-name))))           (property-metods      (get-property-methods methods))           (external-keys        (map cadr property-metods))           (list-defined-methods (make-list-methods    property-metods))           (list-case-call-methods (make-list-case-call-methods    property-metods param-list)))       ;;(prn \"Defined methods: \" list-defined-methods \"\\n\")       `(begin           (def-keys ,@external-keys)           (defun (,name-maker &amp;key ,@fields)              ,@list-defined-methods              (define (,dispath ,message . ,param-list)                 (case ,message                    ,@list-case-call-methods                    ,(if (pair? default-body)                         `(else ,@default-body) )                    ))              ,dispath))))<\/code><\/pre>\n<h3>\u041f\u0440\u043e\u0432\u0435\u0434\u0451\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/h3>\n<p>\u042f \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u043b \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0432 \u0444\u0430\u0439\u043b obj2.scm, \u0442\u0435\u043f\u0435\u0440\u044c \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0432 \u0441\u043a\u0440\u0438\u043f\u0442-\u0444\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e<\/p>\n<details class=\"spoiler\">\n<summary>\u043a\u043e\u043c\u0430\u043d\u0434<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"lisp\">(define path-home (getenv \"HOME\")) (define path-lib (string-append path-home \"\/work\/gimp\/lib\/\")) (define path-work (string-append path-home \"\/work\/gimp\/\")) (load (string-append path-lib \"util.scm\")) (load (string-append path-lib \"defun.scm\")) (load (string-append path-lib \"struct2.scm\")) (load (string-append path-lib \"obj2.scm\"))<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043a\u043b\u0430\u0441\u0441, \u0438 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0430\u0440\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u0430\u0440\u043e\u0439 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439.<\/p>\n<pre><code class=\"lisp\">;;\u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 (defclass named-counter    ((name \"\") (count 0)) ;;list fields    (((inc &amp;opt (val 1))  ;;list methods \u0438\u043c\u044f \u043c\u0435\u0442\u043e\u0434\u0430 \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439      (set! count (+ count val)))     ((dec &amp;opt (val 1))      (set! count (- count val)))     ((get)      count)     ((set-name nm)      (set! name nm))     ((get-name)      name))    ( ;;\u043a\u043e\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0435\u0441\u043b\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043d\u0435\u043e\u043f\u043e\u0437\u043d\u0430\u043d\u043d\u043e, \u043c\u0435\u0442\u043e\u0434 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e     (prn \"\u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u0441\u0438\u0433\u043d\u0430\u043b!\\n\") count)    )  (define nc1 (make-named-counter :name \"test 1\" :count 2)) ;nc1 (nc1 :inc 12) ;;14 (define nc2 (make-named-counter :name \"test 2\" :count 20)) ;nc2 (nc2 :inc 12) ;;32 (nc2 12) ;;\u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u0441\u0438\u0433\u043d\u0430\u043b!<\/code><\/pre>\n<p>\u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u0432\u0441\u0451 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u043c \u043c\u0435\u0440\u0435, \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0441\u043d\u043e\u0432\u044b \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432 \u0441\u0445\u0435\u043c\u0435.<\/p>\n<h2>\u0414\u043e\u0441\u0442\u043e\u0438\u043d\u0441\u0442\u0432\u0430 \u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430<\/h2>\n<p>\u041d\u0443 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e\u0435 \u0434\u043e\u0441\u0442\u043e\u0438\u043d\u0441\u0442\u0432\u043e, \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u043d\u0430 \u0435\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435\u043c. \u042d\u0442\u0430 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f \u043e\u0447\u0435\u043d\u044c \u0431\u043b\u0438\u0437\u043a\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432, \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0445 \u0441 \u0421\u0438++ \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438, \u043a\u043e\u0433\u0434\u0430 \u043a\u043b\u0430\u0441\u0441\u044b \u0432\u043b\u0430\u0434\u0435\u044e\u0442 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438. \u0418\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u044f\u0446\u0438\u044f \u0432 \u043f\u0440\u0438 \u0442\u0430\u043a\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 &#8212; \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u0430\u044f.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0430\u0445 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430. \u041d\u0443 \u0432\u043e \u043f\u0435\u0440\u0432\u044b\u0445, \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0435\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f, \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0438\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u043c\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0443. \u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u044d\u0442\u0438 \u0436\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0435\u0449\u0451 \u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442 \u043f\u0430\u043c\u044f\u0442\u044c, \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043e\u0431\u044a\u0451\u043c\u0430 \u0438 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435. \u0415\u0449\u0451 \u043f\u0440\u0438 \u0442\u0430\u043a\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0434\u043b\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b (\u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d\u0438 \u0433\u043b\u0443\u0431\u043e\u043a\u043e \u0441\u043f\u0440\u044f\u0442\u0430\u043d\u044b \u0432 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0435 \u0441 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c-\u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439), \u0447\u0442\u043e \u0440\u0435\u0437\u043a\u043e \u0443\u0445\u0443\u0434\u0448\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438 \u043b\u0430\u0439\u0444-\u043a\u043e\u0434\u0438\u043d\u0433\u0435, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u043d\u0430\u0434\u043e \u0432\u043d\u0435\u0441\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u043c\u0435\u0442\u043e\u0434\u044b \u043a\u0430\u043a\u043e\u0433\u043e \u0442\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u043d\u0435 \u0440\u0430\u0437\u0440\u0443\u0448\u0430\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u0422\u0430\u043a \u0447\u0442\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0432 \u0441\u0445\u0435\u043c\u0435 \u0441\u043c\u044b\u0441\u043b\u0430 \u043d\u0435\u0442. \u041d\u043e \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043e\u043d \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u0433\u043e\u0434\u0438\u0442\u044c\u0441\u044f.<\/p>\n<p>\u0414\u043b\u044f \u0441\u0432\u043e\u0438\u0445 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u043d\u0443\u0436\u0434 \u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u0443\u044e \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 (\u0444\u0430\u0439\u043b obj4.scm), \u043f\u043e\u0445\u043e\u0436\u0443\u044e \u043d\u0430 CLOS, \u043d\u043e \u0431\u0435\u0437 \u043c\u0435\u0442\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 (MOP), \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u044f \u043f\u043e\u0432\u0435\u0434\u0430\u044e \u043a\u0430\u043a-\u043d\u0438\u0431\u0443\u0434\u044c \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u0440\u0430\u0437.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/878018\/\"> https:\/\/habr.com\/ru\/articles\/878018\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041d\u0430 \u043f\u0440\u043e\u0442\u044f\u0436\u0435\u043d\u0438\u0438 \u0432\u0441\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044f\u0437\u044b\u043a\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0438 \u042d\u0448\u0435\u0440\u0430 \u0425\u0435\u043d\u0434\u0435\u0440\u0441\u043e\u043d\u0430 \u043c\u044b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u043b\u0438 <strong>tinyscheme<\/strong>, \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u043c\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u043c\u0438 \u0438 \u043d\u0438 \u0440\u0430\u0437\u0443 \u0443 \u043c\u0435\u043d\u044f \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u043b\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u041e\u0431\u044a\u0435\u043a\u0442\u043d\u043e-\u041e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434, \u043d\u043e \u0432\u043e\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0432 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044e \u0424\u0438\u0433\u0443\u0440\u044b,<\/p>\n<details class=\"spoiler\">\n<summary>\u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u043a\u043e\u0434:<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"lisp\">(define (draw-fig img fig tr)    (let* ((contour    (if tr                           (translate-contour (fig-contour fig) tr)                           (fig-contour fig)))           (num-points (length contour))           (points     (make-contour-vector contour  num-points))           (dw         (car (gimp-image-get-active-drawable img))))       ;;(gimp-context-push)       (gimp-context-set-foreground (fig-color fig))       (cond        ((eq? (fig-type fig) 'pencil)         ((fig-brush fig))         (gimp-pencil  dw (* 2  num-points) points)        ((eq? (fig-type fig) 'brush)         ((fig-brush fig))         (gimp-paintbrush-default  dw (* 2  num-points) points))        ((eq? (fig-type fig) 'shape)         ;;(gimp-image-select-polygon  img CHANNEL-OP-REPLACE num-points points)         (gimp-free-select  img (- (* 2  num-points) 1) points  CHANNEL-OP-REPLACE 0 0 0)         (gimp-edit-fill dw  FOREGROUND-FILL)         (gimp-selection-none img))        )       ;;(gimp-context-pop)   ))<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u044f \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u044f\u0437\u044b\u043a\u0443 <strong>tinyscheme<\/strong> \u043e\u0447\u0435\u043d\u044c \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438 \u043f\u043e\u043b\u0438\u043c\u043e\u0440\u0444\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044e \u0444\u0438\u0433\u0443\u0440\u044b, \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0438\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b. \u041d\u0435\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c \u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u043c\u043e\u0436\u043d\u043e, \u043d\u043e \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0435\u0451 \u0434\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c.<\/p>\n<h2>\u0427\u0442\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c<\/h2>\n<p>TinySchema \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0434\u043b\u044f \u041e\u041e\u041f. \u041a\u0442\u043e \u0442\u043e \u0434\u0430\u0436\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u0447\u0442\u043e \u041b\u0438\u0441\u043f \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u044f\u0437\u044b\u043a\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u043c\u0438, \u0442.\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u043c\u0438 \u0447\u0438\u0441\u0442\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043d\u0435 \u0438\u043c\u0435\u044e\u0449\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439. \u042d\u0422\u041e \u041d\u0415 \u0422\u0410\u041a! \u0418\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440 \u044f\u0437\u044b\u043a\u0430 Scheme \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043c\u043e\u0434\u0435\u043b\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u044e\u0449\u0443\u044e\u0441\u044f \u043d\u0430 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f\u0445, \u044d\u0442\u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c, \u0442.\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435. \u0418 \u043a\u0430\u0436\u0434\u0430\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043a\u043e\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u043e \u0438 \u043d\u0430 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u044b\u043b\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430 \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f.  \u0438 \u044d\u0442\u0438\u043c \u0444\u0430\u043a\u0442\u043e\u043c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432 \u0441\u0445\u0435\u043c\u0435.<\/p>\n<p>\u041d\u043e, \u0447\u0442\u043e \u0436\u0435 \u0442\u0430\u043a\u043e\u0435 \u041e\u041e\u041f \u0438 \u043a\u0430\u043a\u0438\u043c \u043e\u043d\u043e \u0431\u044b\u0432\u0430\u0435\u0442? \u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u041e\u041e\u041f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0438\u0437 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439-\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u0432 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043a\u043b\u0430\u0441\u0441\u0430. \u041a\u043b\u0430\u0441\u0441\u044b \u043c\u043e\u0433\u0443\u0442 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044e \u043a\u043b\u0430\u0441\u0441\u043e\u0432. \u0412 \u044d\u0442\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u043a\u043b\u0430\u0441\u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438 \u043c\u0435\u0442\u043e\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0442 \u043a\u043b\u0430\u0441\u0441\u0443. \u042d\u0442\u043e \u0448\u0438\u0440\u043e\u043a\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u041e\u041e\u041f, \u043d\u043e \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0440\u0430\u043d\u044c\u0448\u0435 \u0431\u044b\u043b\u0430 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0435 \u0431\u044b\u043b\u043e \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u043a\u043b\u0430\u0441\u0441\u044b \u044d\u0442\u043e \u043b\u0438\u0448\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0443\u043f\u0440\u043e\u0449\u0430\u044e\u0449\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441\u043e \u0441\u0445\u0435\u043c\u0430\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u0411\u0435\u0437\u043a\u043b\u0430\u0441\u0441\u043e\u0432\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u044d\u0442\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0449\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c, \u0432 \u043b\u0438\u0441\u043f\u0435 \u0442\u0430\u043a\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u0435\u043c(\u041a\u0430\u043a \u044f \u0443\u0436\u0435 \u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u043b, \u0447\u0442\u043e \u0432\u0441\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u041b\u0438\u0441\u043f\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u044f\u043c\u0438, \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0435 \u043f\u0440\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0430\u043a \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u044f\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 <code>\u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435<\/code>, \u0442.\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0435, \u0433\u0434\u0435 \u0442\u043e \u0432 <code>\u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438<\/code> \u0444\u0443\u043d\u043a\u0446\u0438\u0438). \u041f\u043e\u0437\u0436\u0435 (\u0432 \u041b\u0438\u0441\u043f\u0435) \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u043a\u043b\u0430\u0441\u0441\u044b \u0438 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435. \u041d\u043e \u044d\u0442\u0438 \u043a\u043b\u0430\u0441\u0441\u044b(\u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0438 \u043e\u0442 \u0421\u0438++ \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439) \u0432\u043a\u043b\u044e\u0447\u0430\u043b\u0438 \u0432 \u0441\u0435\u0431\u044f \u043b\u0438\u0448\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u0432\u0441\u0451 \u0441\u043b\u043e\u0436\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u043b\u043e\u0441\u044c \u0447\u0435\u0440\u0435\u0437 <code>\u043e\u0431\u043e\u0431\u0449\u0451\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/code>, \u0438\u0437\u043c\u0435\u043d\u044f\u044e\u0449\u0438\u0435 \u0441\u0432\u043e\u0451 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0438\u043f\u043e\u0432 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0445 \u0432 \u043d\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. <code>\u041e\u0431\u043e\u0431\u0449\u0451\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/code> \u043d\u0435 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0442 \u043a\u0430\u043a\u043e\u043c\u0443 \u043b\u0438\u0431\u043e \u043a\u043b\u0430\u0441\u0441\u0443. \u042d\u0442\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u041e\u041e\u041f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0432 \u041b\u0438\u0441\u043f\u0435(CLOS) \u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u0445  Scheme(\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432 guile &#8212; GOOPS). \u042d\u0442\u0430 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f \u043c\u0430\u043b\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432, (\u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043d\u0430 \u0435\u0451 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0438 \u0442\u0430\u043a \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f) \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442, \u0447\u0442\u043e \u043c\u0435\u0442\u043e\u0434\u044b \u043c\u043e\u0433\u0443\u0442 \u043d\u0435 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u0430\u043c, \u0430 \u044f\u0432\u043b\u044f\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u043d\u044b\u043c\u0438 \u0441\u043b\u0443\u0447\u0430\u043c\u0438 \u043e\u0431\u043e\u0431\u0449\u0451\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439.<\/p>\n<p>\u041d\u043e \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u044e \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435  Scheme. \u041a\u043b\u0430\u0441\u0441\u044b \u044d\u0442\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u044b. \u041e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0439 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043f\u0443\u0442\u0451\u043c \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f. \u041f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0435 \u043d\u0438\u0436\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043b\u044f\u043c\u0431\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043d\u0435\u0442!! \u041e\u043d\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 <strong>\u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u044f<\/strong>, \u0442.\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u0443\u044e \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0431\u043b\u043e\u043a\u043e\u043c <strong>\u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f<\/strong>, \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435 &#8212; \u0447\u0430\u0441\u0442\u044c \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u043f\u043e\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0430 \u0447\u0430\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0438\u0435 \u0437\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442. \u042d\u0442\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435. \u0442.\u0435. \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0432 \u043d\u0451\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u044b, \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u044b, \u0438 \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u044f\u0441\u044c \u043d\u0430 \u043d\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445 \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 &#8212; \u043c\u0435\u0442\u043e\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0432 \u044d\u0442\u043e\u043c \u0436\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438.<\/p>\n<h2>\u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0431\u044a\u0435\u043a\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u0447\u0451\u0442\u0447\u0438\u043a, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u043f\u043e\u043b\u044f \u0438\u043c\u044f \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043c\u0430\u043a\u0440\u043e\u0441, \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0449\u0438\u0439 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438, \u043d\u0443 \u0438\u043b\u0438 \u0435\u0441\u043b\u0438 \u0443\u0433\u043e\u0434\u043d\u043e &#8212; \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430\u043c\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u0438\u043b\u0438 \u0435\u0441\u043b\u0438 \u0434\u0443\u043c\u0430\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e, \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b.<\/p>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442-\u0444\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043d\u0430\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043c\u0430\u043a\u0440\u043e\u0441.<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u043a \u0440\u0430\u0431\u043e\u0442\u0435<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"lisp\">;;(define path-home \"D:\") ;;\u0434\u043b\u044f \u0432\u0438\u043d\u0434\u043e\u0432\u0441 (define path-home (getenv \"HOME\")) (define path-lib (string-append path-home \"\/work\/gimp\/lib\/\")) (define path-work (string-append path-home \"\/work\/gimp\/\")) (load (string-append path-lib \"util.scm\")) (load (string-append path-lib \"defun.scm\")) (load (string-append path-lib \"struct.scm\"))<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041c\u0430\u043a\u0440\u043e\u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0439 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0441\u043b\u043e\u0432\u0430, \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0441 \u0434\u0432\u043e\u0435\u0442\u043e\u0447\u0438\u044f(tinyscheme \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0438\u0445 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435).<\/p>\n<pre><code class=\"lisp\">(define-macro (def-keys . param-list)    `(begin  ,@(make-def-keys param-list))) <\/code><\/pre>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043a\u043e\u0434, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u0438 \u0432 \u043d\u0430\u0448\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435:<\/p>\n<pre><code class=\"lisp\">(def-keys :set-name :get-name :get :inc :dec)  (defun (make-named-counter &amp;key (name \"\") (count 0))    ;;object method    (define (set-name nm)       (set! name nm))    (define (get-name)       name)    (defun (inc &amp;opt (val 1))       (set! count (+ count val)))    (defun (dec &amp;opt (val 1))       (set! count (- count val)))    (define (get)       count)    ;;dispatcher message    (define (dispath message . param-list)       (case message          ((:get)           (get))          ((:inc) (if (pair? param-list)                      (inc (car param-list))                      (inc)))          ((:dec) (if (pair? param-list)                      (dec (car param-list))                      (dec)))          ((:get-name)           (get-name))          ((:set-name) (if (pair? param-list)                           (set-name (car param-list))))          ))     dispath) <\/code><\/pre>\n<p>\u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u041e\u041e\u041f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>make-named-counter<\/code> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440, \u0441\u043e\u0437\u0434\u0430\u044e\u0449\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u0442.\u0435 \u043d\u0435\u043a\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0432 \u0441\u0440\u0435\u0434\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0449\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c, \u043a\u0430\u043a \u0433\u043e\u0432\u043e\u0440\u044f\u0442 &#8212; \u0430\u043a\u0442\u043e\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0436\u0435 \u0434\u0435\u043b\u0435 \u044d\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0430\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u0435 <strong>\u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u044f<\/strong>. \u0414\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043c\u043e\u0436\u0435\u0442 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0432\u0430 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u043f\u043e\u043b\u044f: <code>name<\/code> \u0438 <code>count<\/code>. \u041f\u043e\u043c\u0438\u043c\u043e \u044d\u0442\u043e\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0430\u043a\u0440\u043e\u0441\u0430 <code>def-keys<\/code> \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u044f\u0432\u043b\u044f\u044e\u0449\u0438\u0445\u0441\u044f \u0438\u043c\u0435\u043d\u0430\u043c\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043d\u0430\u0448\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440. \u0418 \u0435\u0449\u0451 \u0440\u0430\u0437: \u041d\u0430\u0448 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>dispath<\/code> &#8212; \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440, \u043d\u0435\u0442, \u043e\u043d \u0432\u043e\u0437\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u0435 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u043f\u043e\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0438\u043c\u044f \u0438 \u0441\u0447\u0451\u0442\u0447\u0438\u043a, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u043b\u043e\u0432\u043d\u043e \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0430\u043a\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0432 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440\u0430 \u0438 \u0438\u043c\u0435\u044e\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c \u043f\u043e\u043b\u044f\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0430.<\/p>\n<p>\u041f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0435\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u0435.<\/p>\n<pre><code class=\"lisp\">(define c1 (make-named-counter :name \"c1 counter\")) ;;\u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u043e\u043b\u0435\u043c name (c1 :get-name) ;;\"c1 counter\" (c1 :set-name \"test c1\") ;;\"test c1\" (c1 :get-name)           ;;\"test c1\" ;;\u0440\u0430\u0431\u043e\u0442\u0430 \u0441\u043e \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u043e\u043c. (c1 :get) ;;0 (c1 :inc) ;;1 (c1 :inc) ;;2 (c1 :inc 8) ;;10 (c1 :dec 2) ;;8 (c1 :get) ;;8  (define c2 (make-named-counter :name \"c2 counter\" :count 13)) (c2 :get)     ;13 (c2 :inc 10)  ;23 (c2 :get 10)  ;23 , 10 \u0432 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u0445 \u043d\u0438\u0433\u0434\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f. (c1 :get)     ;8 , \u0441\u0447\u0451\u0442\u0447\u0438\u043a c1 \u043f\u043e \u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 8. <\/code><\/pre>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c \u0438\u0434\u0435\u044f \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043d\u044f\u0442\u043d\u0430, \u0437\u0434\u0435\u0441\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u044d\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u043c\u0438, \u0432\u0435\u0440\u043d\u0435\u0435 \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u043c\u0438\u0441\u044f \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0435\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0438\u0445 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0444\u0443\u043d\u043a\u0446\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438. \u0410 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u044d\u0442\u043e \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0441\u043b\u043e\u0432\u0430, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044f-\u043e\u0431\u044a\u0435\u043a\u0442 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442 \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0443\u0436\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434, \u0442\u0430\u043a \u0436\u0435 \u043e\u043f\u0440\u0435\u0434\u0451\u043b\u0451\u043d\u043d\u044b\u0439 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435.<\/p>\n<h2>\u041e\u041e\u041f \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441<\/h2>\n<p>\u0418 \u0435\u0441\u043b\u0438 \u0431\u044b \u044d\u0442\u043e \u0431\u044b\u043b \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043d\u0430 \u044d\u0442\u043e\u043c \u043d\u0430\u0448\u0435 \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0435 \u043e \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432 \u044f\u0437\u044b\u043a \u0438 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u043e\u0441\u044c \u0431\u044b. \u041d\u041e, \u044d\u0442\u043e \u043b\u0438\u0441\u043f! \u0417\u0434\u0435\u0441\u044c \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043c\u0430\u043a\u0440\u043e\u0441\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u044f\u0437\u044b\u043a\u0430. <\/p>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043a\u043b\u0430\u0441\u0441 (\u0430 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 &#8212; \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e-\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 make-name-counter) \u043f\u043e \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0448\u0430\u0431\u043b\u043e\u043d\u0443<\/p>\n<pre><code class=\"lisp\">(defclass named-counter  ;; \u0438\u043c\u044f \u043a\u043b\u0430\u0441\u0441\u0430    ((name \"\") (count 0)) ;;list fields - \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u043b\u0435\u0439 \u043e\u0431\u044a\u0435\u043a\u0442\u0430.    (((inc &amp;opt (val 1))  ;;list methods -\u0441\u043f\u0438\u0441\u043e\u043a \u043c\u0435\u0442\u043e\u0434\u043e\u0432 ((\u0438\u043c\u044f-\u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435) \u0442\u0435\u043b\u043e-\u043c\u0435\u0442\u043e\u0434\u0430) ...      (set! count (+ count val)))     ((dec &amp;opt (val 1))      (set! count (- count val)))     ((get)      count)     ((set-name nm)      (set! name nm))     ((get-name)      name))    () ;;\u043a\u043e\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0435\u0441\u043b\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043d\u0435\u043e\u043f\u043e\u0437\u043d\u0430\u043d\u043d\u043e, \u043c\u0435\u0442\u043e\u0434 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e    ) <\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0430\u043a\u0440\u043e\u0441 \u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0443\u0442\/\u043f\u0440\u0435\u0432\u0440\u0430\u0442\u044f\u0442 \u044d\u0442\u0443 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u0432\u044b\u0448\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044e.<\/p>\n<details class=\"spoiler\">\n<summary>\u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u043c\u0430\u043a\u0440\u043e\u0441\u044b.<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"lisp\">;;\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u0441\u043b\u043e\u0432 (define-macro (def-keys . param-list)    `(begin  ,@(make-def-keys param-list)))  ;;\u0441\u043e\u0437\u0430\u0435\u0442 \u043f\u043e \u0438\u043c\u0435\u043d\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u0430, \u0441\u0438\u043c\u0432\u043e\u043b \u043a\u043b\u044e\u0447(\u0441\u0438\u043c\u0432\u043e\u043b \u0441 \u0434\u0432\u043e\u0435\u0442\u043e\u0447\u0438\u0435\u043c) (define (sym2key s)    (string-&gt;symbol (string-append \":\"                                   (symbol-&gt;string s)))) ;;(sym2key 't1) ; :t1  ;;\u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043b\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0443\u0441\u043b\u043e\u0432\u0438\u0435 condition (define (condition-met-for-list condition lst)    (cond     ((null? lst) #f)     ((condition (car lst)) (car lst))     (else<\/code><\/pre>\n<\/div>\n<\/details>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-446613","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/446613","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=446613"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/446613\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=446613"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=446613"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=446613"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}