Re: What's wrong with Common Lisp's lambda ?



On Thu, 28 Sep 2006 10:48:58 -0400, Barry Margolin wrote:

In article <1159451585.361549.266980@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
"Karol Skocik" <Karol.Skocik@xxxxxxxxx> wrote:

Hi,
I have just read this article:

http://www.ddj.com/184404384;jsessionid=KLMB3AY1Q0DHQQSNDLPCKH0CJUNN2JVN?_requ
estid=71496

and in the section "Impact of Logic", I saw this :

Scheme, a dialect of Lisp which got lambda right (Guy Steele and Gerald
Sussman, 1975; http://www.schemers .org/).

I am a happy CL lambda user, and can't find something wrong in CL's
lambda...

Could some functional guru explain me what they meant?

Common Lisp adopted some features of Scheme's lambda, so it doesn't have
as many problems as earlier dialects of Lisp. But there are still
holes. Although CL has lexical extent for variable bindings, it only
has dynamic extent for control bindings. So you can't do:

(defun make-bad-closure ()
(tagbody
label
(print 'got-here)
(lambda () (go label))))


Shouldn't this read:


(defun make-bad-closure ()
(tagbody
label
(print 'got-here)
(return-from make-bad-closure (lambda () (go label)))))

Form file:///usr/share/doc/hyperspec/Body/s_tagbod.htm:

... If at any time there are no remaining statements,
tagbody returns nil.


Cheers, Ralf Mattes


(funcall (make-bad-closure))


.



Relevant Pages

  • Re: quote semantics
    ... with some useful work on Lisp libraries, if you fall that way GTF ... ask for that one, too, whether it was all that related to the Lambda ... And certainly CL took influence from Scheme, ... claim that this community, which is entirely composed of people who, ...
    (comp.lang.lisp)
  • Re: reading file to list
    ... Common Lisp is the other way around. ... that many old emacs users, which includes significant portion of emacs ... 2 fundamental problems of lisp i feel this ruby ... The way the above works is that each of f, g, h is a lambda themselves ...
    (comp.lang.python)
  • Re: What is the main advantage of macros over functions?
    ... if one is allergic to reading Lambda one may better not use ... Lisp authors, doesn't help you much, I'd say. ... >> Readmacros are a completely different mechanism. ... Macros and Readmacros ...
    (comp.lang.lisp)
  • Re: Hacking CL into a Lisp-1 (an intro to code-walking)
    ... function name to refer to a function you can also use a lambda ... Extended function designators ... As a Lisp pedagog you can't count on your students cutting Lisp ... Minor glitches and oddities, ...
    (comp.lang.lisp)
  • Re: Whats wrong with Common Lisps lambda ?
    ... Scheme, a dialect of Lisp which got lambda right (Guy Steele and Gerald ...
    (comp.lang.lisp)