From: Raimon Grau Date: Fri, 14 Dec 2012 23:54:03 +0000 (+0100) Subject: Merge branch 'while' X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=dd0a430770e923d0712aa25049d8ba57d975e747;p=jscl.git Merge branch 'while' Conflicts: lispstrack.lisp --- dd0a430770e923d0712aa25049d8ba57d975e747 diff --cc lispstrack.lisp index a1d4add,d7e41a1..ba97bd6 --- a/lispstrack.lisp +++ b/lispstrack.lisp @@@ -78,9 -90,11 +90,14 @@@ body can access to the local environmen (define-compilation quote (sexp) (lisp->js sexp)) +(define-compilation debug (form) + (format nil "console.log(~a)" (ls-compile form env))) + + (define-compilation while (pred &rest body) + (format nil "(function(){while(~a){~a}})() " + (ls-compile pred env) + (ls-compile-sexps body env))) + (defparameter *env* '()) (defparameter *env-fun* '())