[pro] Lisp 2's and function values.

Matthew Swank akopa.gmane.poster at gmail.com
Wed May 25 15:51:28 UTC 2011


Alessio Stalla <alessiostalla at ...> writes:

> 
> On Wed, May 25, 2011 at 4:45 PM, Matthew Swank
> <akopa.gmane.poster at ...> wrote:
> > Pascal Costanza <pc at ...> writes:
> >
> >>
> >>
> >> On 25 May 2011, at 04:51, Matthew D. Swank wrote:
> >
> >> > However, consider the following:
> >> >
> >> > ((returns-a-function) arg arg ...)
> >> >
> >> > Would it be reasonable to allow this as a legal form as well?
> 
> While in principle I like such a thing, I think it doesn't play well
> with Lisp-2 (or more specifically, with Common Lisp). If ((whatever)
> ...) is a valid expression, then one would expect (let ((foo
> (whatever))) (foo ...)) to be equivalent, but it's not. And you can't
> use flet/labels for the same effect. 

Well, let bindings could be extended to use an operator to specify the namespace:

(let (((function foo) (lambda (arg ...) ...))
      (bar  (lambda (arg ...) ...)))
  (foo ...)
  (funcall bar ...))


and flet/labels would transform into a generalized let binding.

This would make the standard transformation of let -> function call a little
problematic, however.

I suppose at the bottom of all this is an implied primitive binding operator for
operators: perhaps flambda!

Matt






More information about the pro mailing list