From: David Vázquez Date: Sun, 23 Jun 2013 13:30:12 +0000 (+0200) Subject: Migrate %WHILE X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=b6ad5cd9c9607213bf7177ae026ef5ea454bd108;p=jscl.git Migrate %WHILE --- diff --git a/src/compiler.lisp b/src/compiler.lisp index 1f14de5..2bff550 100644 --- a/src/compiler.lisp +++ b/src/compiler.lisp @@ -559,11 +559,13 @@ (literal sexp)) (define-compilation %while (pred &rest body) - (js!selfcall - "while(" (ls-compile pred) " !== " (ls-compile nil) "){" *newline* - `(code ,(ls-compile-block body)) - "}" *newline* - "return " (ls-compile nil) ";" *newline*)) + (js!selfcall* + `(while (!== ,(ls-compile pred) ,(ls-compile nil)) + 0 ; TODO: Force + ; braces. Unnecesary when code + ; is gone + (code ,(ls-compile-block body))) + `(return ,(ls-compile nil)))) (define-compilation function (x) (cond