Michael, To your question, I don't want to encourage this style of programming.
Andi At 10:24 PM 8/23/2005, Michael Walter wrote:
Zeev, On 8/24/05, Michael Walter <[EMAIL PROTECTED]> wrote: > On 8/23/05, Zeev Suraski <[EMAIL PROTECTED]> wrote: > > >"Real" anonymous functions (as in, closures) should be able to capture > > >variables from its lexical environment, e.g.: > > > > create_function() accepts a string, and that string is constructed with > > full access to the lexical scope of the creating function, so I'm not > > exactly sure how it's different. My ML/LISP memory fails me. I misread. The obvious difference is that you're not creating code strings in ML/LISP, so (1) you can avoid all kind of error-prone marshalling and (2) you can compile the function at compile-time and simply fill out its free variables when "instantiating" the closure (using the current lexical environment), giving you syntax checks & performance. I intentionally phrased that sentence to resemble object instantiation: In fact it's pretty much the same thing with more less verbose/local syntax! I.e. as I believe you said, it is certainly *not* a question of how/whether we want that functionality, but whether we want to encourage this particular style of programming. Cheers, Michael -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php