From: David Vázquez Date: Thu, 7 Feb 2013 22:58:07 +0000 (+0100) Subject: New special form: labels X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=34b79808c580ec5155548212586eb2b6a88e174e;p=jscl.git New special form: labels --- diff --git a/ecmalisp.lisp b/ecmalisp.lisp index d6ba178..62fe386 100644 --- a/ecmalisp.lisp +++ b/ecmalisp.lisp @@ -1437,6 +1437,22 @@ (indent body)) "})(" (join cfuncs ",") ")"))) +(define-compilation labels (definitions &rest body) + (let* ((fnames (mapcar #'car definitions)) + (fbody (mapcar #'cdr definitions)) + (*environment* + (extend-lexenv (mapcar #'make-function-binding fnames) + *environment* + 'function)) + (cfuncs (mapcar #'compile-function-definition fbody))) + (concat "(function(){" *newline* + (join (mapcar (lambda (func) + ()) + definitions)) + (let ((body (ls-compile-block body t))) + (indent body)) + "})"))) + (defvar *compiling-file* nil)