Re: [PHP-DEV] Closure/lambda semantic comparaison

2010-03-01 Thread Ionut G. Stan
In my opinion this is consistent with the fact that PHP has no block-scoped variables. The situation is similar with the one in JavaScript. In JavaScript the problem has been solved by Mozilla with so-called let definitions[1], which are block-scoped. 1: https://developer.mozilla.org/en/New_

Re: [PHP-DEV] Closure/lambda semantic comparaison

2010-03-01 Thread mathieu.suen
Etienne Kneuss wrote: Hello, On Mon, Mar 1, 2010 at 1:33 PM, mathieu.suen wrote: Hi, I am proposing a comparison between PHP closure with lisp one. First thing to compare is how scope are capture: Suppose I want to create a function that add. The common idiom to do it in lisp is: (defun

Re: [PHP-DEV] Closure/lambda semantic comparaison

2010-03-01 Thread Etienne Kneuss
Hello, On Mon, Mar 1, 2010 at 1:33 PM, mathieu.suen wrote: > Hi, > > I am proposing a comparison between PHP closure with lisp one. > > First thing to compare is how scope are capture: > Suppose I want to create a function that add. > The common idiom to do it in lisp is: > > (defun adder (x) #'(