[pro] Lisp 2's and function values.

Alessio Stalla alessiostalla at gmail.com
Wed May 25 21:05:51 UTC 2011


On Wed, May 25, 2011 at 9:40 PM, Marco Antoniotti
<antoniotti.marco at disco.unimib.it> wrote:
> Hi
> I don't think there is a reasonable objection to forbid a form like
> ((returns-something-funcallable arg1 arg2 ... argN) 1 2 3 ... N)
> from "working as expected".

Me neither ;)

> As Martin pointed out, if the return value of
> the form is a "macro" then this would have to be interpreted in the
> "regular" evaluation regime.
> As per "extending" LET there have been a lot of proposals... IMHO a nice one
> is to go the LOOP way :)
> (LETS [var <symbol> <form>]*
>       [fun (<name> <arglist> <body>)]*
>       [labels (<name> <arglist> <body>)]*
>       [values <list> <form>]*
>   IN
>   <body>)
> Of course you can add some ways of extending the syntax by having something
> like
> (def-lets-binding <tag> ...)
> You get the idea....

It's not about syntax, it's about a missing feature: the ability to
bind a symbol's function "cell" to a value that's not known at compile
time. To me, that's a limitation of the spec; given that we have
funcall, it's obviously easy to implement and would be symmetrical to
let. With such a feature, the gap between Lisp-1 and Lisp-2 would be
effectively reduced:

(let ((list 42))
  (flet ((list (compose #'nreverse #'list)))
    (list #'list list)))

=> (42 #<compiled-function (lambda (...) ...)>)

The code above is horrible, but you get the idea.

Alessio




More information about the pro mailing list