Skip to content

Comment on One Major Difference Between Clojure and Common Lispparent

Comments

Porting code from Lisp-2 to Lisp-1 is not that difficult.

Example:

Lisp-2:

    (defun new-map (f l)
      (dolist (e l)
        (funcall f e)))
Lisp-1:
    (defun new-map (f l)
      (dolist (e l)
         (f e)))

Another example:

Lisp-2

    (defun foo (l)
      (flet ((new-map (f l)
               (dolist (e l)
                  (f e))))
        (new-map (function sin) l)))
Lisp-1
    (defun foo (l)
      (let ((new-map (lambda (f l)
                       (dolist (e l)
                         (f e)))))
        (new-map sin l)))
To make it easier, just define FUNCALL, FUNCTION and FLET in Lisp-1...
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.