[parenscript-devel] [PATCH] Make NIL the value (the last form in enclosing PROGN) of a LOOP macro with no default accumulator.

Daniel Gackle danielgackle at gmail.com
Thu Nov 5 19:11:12 UTC 2009


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 at 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 at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/parenscript-devel/attachments/20091105/751dd922/attachment.html>


More information about the parenscript-devel mailing list