Re: Re: Closure local return

From: Date: Mon, 03 May 2010 15:54:23 +0000
Subject: Re: Re: Closure local return
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-48180@lists.php.net to get a copy of this message
I think you actually misunderstand the difference in http://en.wikipedia.org/wiki/Closure_%28computer_science%29#Differences_in_semantics The way I read if the difference is wether it returns from the closure function or the surrounding function *calling* it. Not the *defining* scope. And no, it doesn't make sense in the PHP context IMHO. - Chris "returns from the closure function"
To go were? I had maintain a smalltalk compiler. I did not misunderstand the difference. The Common Lisp implementation is the more explicit one. For exemple: (defun eval-l1 (fct) (funcall fct)) (defun bar (x) (eval-l1 #'(lambda () (return-from bar 45)))
                        x)
(bar 23) -> 45 When funcall is apply you do not return from eval-l1. You return from bar. Which is the defining scope of the lanbda. -- Mathieu Suen

« previous php.internals (#48180) next »