From 34b79808c580ec5155548212586eb2b6a88e174e Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20V=C3=A1zquez?= Date: Thu, 7 Feb 2013 23:58:07 +0100 Subject: [PATCH] New special form: labels --- ecmalisp.lisp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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) -- 1.7.10.4