[parenscript-devel] Implicit RETURN for function bodies

Red Daly reddaly at gmail.com
Tue Aug 7 20:10:03 UTC 2007


Coming from Lisp, it is tiresome inserting return statements at the end of
each function.  Should we change the behavior of Parenscript so that the
last item in a function body is expected to be an expression and is
returned?

I am in favor of the change, though it may introduce incompatibility with
existing code.

An implementation:
(defscriptmacro fn (lambda-list &body
body)

`(lambda
,lambda-list

   ,@(butlast
body)

   (return ,(first (last body)))))

Red
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/parenscript-devel/attachments/20070807/21bbac6c/attachment.html>


More information about the parenscript-devel mailing list