GS>>1) syntactical:  the amount of escaping/funkyjunk you need to do to 
GS>>have anonymous functions look like regular functions in their 
GS>>declaration is huge (yes, you can use heredocs, but they have their 
GS>>(big if you run up against them) limitations as well).

Well, this is right and valid, but if you use advanced stuff like closures 
you may expect you code look "advanced" :)

GS>>2) no garbage collection on them (so in something like perl, when you
GS>>anonymous sub goes out of scope, it's cleaned up).

This is a valid concern, though I don't see how to fix it without creating 
a new type, and creating anew type just for that seems a bit of overkill 
to me.

GS>>3) runtime vs. compiletime definition
GS>>
GS>>For me 3 is good the way it is (the whole point of anon. functions (for me)
GS>>is to allow me to easily vary their definition at runtime).

This one I miss. Like, why should it matter when you compile it? 
Compilation time is still the same. Even more, in runtime you don't spend 
time compiling it unless it's really needed. 

GS>>$max = function ($a, $b) {
GS>>  return $a < $b?$b:$a;
GS>>}

$max = create_function('$a,$b', 'return $a < $b?$b:$a;');

Is it _that_ different? 
-- 
Stanislav Malyshev, Zend Products Engineer
[EMAIL PROTECTED]  http://www.zend.com/ +972-3-6139665 ext.115

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to