Re: gensym with multiple-value-bind
- From: Edi Weitz <spamtrap@xxxxxxxxxx>
- Date: Mon, 17 Oct 2005 12:22:00 +0200
On 17 Oct 2005 02:50:43 -0700, "Kaz Kylheku" <kkylheku@xxxxxxxxx> wrote:
> For instance in a LOOP, you can (RETURN) which breaks out the loop.
> That shadows any lexical function or macrolet named RETURN. Or, more
> precisely CL:RETURN.
I think you're not right here. First, from my understanding of
11.1.2.1.2 you can't lexically bind CL:RETURN as a function or macro
anyway in conforming programs. There are some implementations which
won't complain but in that case the lexical function isn't shadowed by
LOOP. LispWorks:
CL-USER 1 > (flet ((return (x) (print (list 'foo x))))
(loop for i below 10 when (oddp i) do (return i)))
(FOO 1)
(FOO 3)
(FOO 5)
(FOO 7)
(FOO 9)
NIL
Second, there's the LOOP /keyword/ RETURN but LOOP keywords are
recognized by name (STRING=) not by symbol identity:
CL-USER 1 > (defpackage my-package)
#<PACKAGE MY-PACKAGE>
CL-USER 2 > (loop for i below 10 when (oddp i) my-package::return i)
1
Cheers,
Edi.
--
Lisp is not dead, it just smells funny.
Real email: (replace (subseq "spamtrap@xxxxxxxxxx" 5) "edi")
.
- References:
- gensym with multiple-value-bind
- From: Patrick May
- Re: gensym with multiple-value-bind
- From: Will Fitzgerald
- Re: gensym with multiple-value-bind
- From: Patrick May
- Re: gensym with multiple-value-bind
- From: Patrick May
- gensym with multiple-value-bind
- Prev by Date: Re: Lisp versus Prolog
- Next by Date: Re: multiple-value-bind only accepts symbols
- Previous by thread: Re: gensym with multiple-value-bind
- Next by thread: Re: gensym with multiple-value-bind
- Index(es):
Relevant Pages
|