Sent from my iPad 在 2012-4-13,2:07,Nikita Popov <nikita....@googlemail.com> 写道:
> On Thu, Apr 12, 2012 at 7:38 PM, Robert Williams <rewilli...@thesba.com> > wrote: >> Also, remember that the closure is in fact another function, a function >> that performs its own actions independent of the parent. Just as other >> functions can pick whatever parameter names make the most sense to them >> internally, I think it makes sense to allow closures to pick whatever >> used-variables names make the most sense to them internally. It's >> certainly not a requirement, but used judiciously, I think it can >> definitely lead to easier-to-read (i.e., easier-to-maintain) code since it >> means variables can be named to best reflect their usage in both parents >> and closures. > Thanks, this is convincing. > > The only thing I'm not really sure about then is whether it is a good > idea to allow importing $this using an alias. As $this is already > available by default I don't see much point in allowing it. It's > somewhere between useless and confusion. > This $this is not that $this , plz thinking : $closuer->bindTo And $this become the new scope, but the alias still refer to the obj who own this closure. Thanks > Nikita > > -- > 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