This raises the question of how FOR and WHILE should be handled with implicit return. I suppose, if either of those is the last form in a function, the function should just return NIL?

Also, we can extend PS LOOP to do much as CL's LOOP does with intra-loop RETURNs. But we should hold off on this till implicit return is working in PS.

On Thu, Nov 5, 2009 at 12:05 PM, <sblist@me.com> wrote:
Hi Vladimir,

You'll probably want to handle FOR, WHILE separately in
the RETURN special form, but I think this works for our
purposes with the existing support for PROGN.

Generally, I think that the implicit return mechanism should
try its utmost to avoid generating JS syntax errors.

- Scott

---
 src/lib/ps-loop.lisp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/lib/ps-loop.lisp b/src/lib/ps-loop.lisp
index 7272247..8a383a4 100644
--- a/src/lib/ps-loop.lisp
+++ b/src/lib/ps-loop.lisp
@@ -325,4 +325,4 @@
           ,@(initially loop)
           ,main
           ,@(finally loop))
-        ,@(when (default-accum-var loop) `((return ,(default-accum-
var loop)))))))
+        ,(aif (default-accum-var loop) it nil))))
--
1.6.5.2



_______________________________________________
parenscript-devel mailing list
parenscript-devel@common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel