Re: Ray tracer in Stalin
- From: Jon Harrop <usenet@xxxxxxxxxxxxxx>
- Date: Tue, 23 Aug 2005 15:10:24 +0100
Edi Weitz wrote:
> What do you mean?
I wasn't sure if functions were comparable in CL.
> Functions in Common Lisp are of course "comparable
> for equality with other entities."
>
> * (let* ((foo (lambda (x) x))
> (bar foo)
> (baz 42))
> (values (eql foo bar)
> (eql foo baz)))
> T
> NIL
> * (eql (lambda (x) x)
> (lambda (x) x))
> NIL
>
> You might expect the second expression to return T but that's not
> required by the definition in question.
Ok. The situation is similar in OCaml, with physical and structural
equality. In Mathematica, there is only structural equality between ASTs.
So closures are first class objects in CL, as you would expect. The
confusion is that there are separate namespaces. Do variables with closure
values appear in the non-function namespace but their exact equivalents as
functions appear in the function namespace? So how you get a closure value
from a function/variable name in CL depends upon how that closure was
defined?
--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com
.
- Follow-Ups:
- Re: Ray tracer in Stalin
- From: Pascal Costanza
- Re: Ray tracer in Stalin
- References:
- Re: Ray tracer in Stalin
- From: Jon Harrop
- Re: Ray tracer in Stalin
- From: Joe Marshall
- Re: Ray tracer in Stalin
- From: GP lisper
- Re: Ray tracer in Stalin
- From: Rob Thorpe
- Re: Ray tracer in Stalin
- From: Peter Seibel
- Re: Ray tracer in Stalin
- From: Rob Thorpe
- Re: Ray tracer in Stalin
- From: Pascal Costanza
- Re: Ray tracer in Stalin
- From: Jon Harrop
- Re: Ray tracer in Stalin
- From: Edi Weitz
- Re: Ray tracer in Stalin
- Prev by Date: Re: string interpolation (newbie)
- Next by Date: Re: Ray tracer in Stalin
- Previous by thread: Re: Ray tracer in Stalin
- Next by thread: Re: Ray tracer in Stalin
- Index(es):
Relevant Pages
|