Re: Ray tracer in Stalin



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
.



Relevant Pages

  • Re: Lambda forms and scoping
    ... A function carries its own local namespace, its own closure, and its ... a global statement) the global namespace. ...
    (comp.lang.python)
  • Re: Lambda forms and scoping
    ... A function carries its own local namespace, its own closure, and its ... for loop variable was when the surrounding function finished executing. ...
    (comp.lang.python)
  • Re: cl(bigcap_{1<=q<=infty} L^q) = L^p
    ... >>Ok, I'm trying to verify my often flawed logic, in this case, about ... >>helping me. ... >equality in the title of your post is not. ... >closure you specify, but it is not all of that closure. ...
    (sci.math)
  • Re: cl(bigcap_{1<=q<=infty} L^q) = L^p
    ... >Ok, I'm trying to verify my often flawed logic, in this case, about ... Define the n-boxed function of f, ... equality in the title of your post is not. ... closure you specify, but it is not all of that closure. ...
    (sci.math)
  • Re: cl(bigcap_{1<=q<=infty} L^q) = L^p
    ... >>>Lebesgue's Dominated Convergence Theorem gives ... >>equality in the title of your post is not. ... >>closure you specify, but it is not all of that closure. ... >What topology are you assuming? ...
    (sci.math)