|
Posted by lawrence k on 04/24/07 07:42
On Apr 17, 3:39 am, Willem Bogaerts
<w.bogae...@kratz.maardanzonderditstuk.nl> wrote:
> > Anyone know if PHP supports enclosures, like Javascript or Ruby? I've
> > always assumed PHP lacked these. If I create a function with object
> > instances, will the instances retain their state if the function
> > definition is stored in a variable?
>
> In the object oriented sense, yes. You can pass a function even if it is
> a method of an instance. These functions are used in sorting, for
> example (usort function). I never used pure lambda functions as I once
> did in lisp, because I mainly write object-oriented code now.
I don't know Lisp, but from your response, I'll assume that functions
are not first class objects in Lisp.
Navigation:
[Reply to this message]
|