[parenscript-devel] Implicit RETURN for function bodies
Henrik Hjelte
henrik at evahjelte.com
Wed Aug 8 06:51:23 UTC 2007
On 8/7/07, Red Daly <reddaly at gmail.com> wrote:
> 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 prefer the core parenscript to be exactly equal to javascript with
sexp syntax. I suggest another layer/language/something for Lisp-like
additions like this. We have had a discussion about this before, one
of my main points is that It makes it more easy to know what
javascript is generated from your parenscript code.
The easiest thing is perhaps to add a prefix (for example the letter
L) or postfix(for exampe a +) to forms that do magic stuff. So
lambda+ and defun+ could have return values like this. I think the
recent addition of optional and keyword parameteters (which by the way
is a nice feature) should also go into a lambda+ function instead of
the core parenscript.
Best wishes,
Henrik Hjelte
More information about the parenscript-devel
mailing list