LINUX.ORG.RU

Развивается ли вообще? Плюсану за кложуру.

Hertz ★★★★★
()
Ответ на: комментарий от holuiitipun

Почему не clojure?

Там макросов нормальных нет.

Готова ли Кава к использованию в наколеночном недопродакшне?

Нормальных продолжений нет.

Also, call-with-current-continuation is only «upwards» (?). I.e. once a continuation has been exited, it cannot be invoked. These restricted continuations can be used to implement catch/throw (such as the examples in R4RS), but not co-routines or backtracking. (с) http://www.gnu.org/software/kawa/Compatibility.html

monk ★★★★★
()
Ответ на: комментарий от holuiitipun

Пример?

Например

(define-syntax (aif x)
  (syntax-case x ()
    ((aif cond then else)
     (with-syntax ((it (datum->syntax x 'it)))
       (syntax
        (let ((it cond))
          (if it then else) ) ) ) ) ) )

(define-syntax-rule (fwrite str x)
  (aif str (fprintf it "~a" x) #f))

(aif 3 (fwrite (current-output-port) it) #f) ;;; => печатает 3

Можешь написать на clojure? Вариант на CL не работает:

(defmacro aif (test then &optional else)
  `(let ((it ,test))
     (if it ,then ,else)))

(defmacro fwrite (stream x)
  `(aif ,stream (format it "~a" ,x) nil))

(fwrite t 3) ;  => 3
(aif 3 (fwrite t it)) ; => t

monk ★★★★★
()
Ответ на: комментарий от monk

Можешь написать на clojure?

Формируя списки руками - можно, но я не готов это делать)

holuiitipun
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.