Groovy Concept of Closure -


I am somewhat confused as the word "conclusion" used within Grivi, according to the documentation, a closing of their Definition looks more like an anonymous function or lambda.

I understand that such languages ​​that support first-class works, usually constitute closure, though there is a distinction between the two concepts. For example, according to Groovy Docs:

Groovy is an anonymous part of a code that can take logic, return a value, and the variables declared in the area around it Use.

In the language of functional language, such an anonymous code block can be referred to as an anonymous lambda expression with unbound in normal or lambda expressions, variables or closed lambda expressions if it contains unbound variables References are not included (such as thresholds in the previous example). Groovy does not make such a distinction.

Then according to the page on the closure:

Closing the word is often used to perform an anonymous operation incorrectly.

What am I missing?

As the next paragraph is in:

Strictly speaking , A closing can not be defined. You can define a block of code that reflects local variables or fields / properties, but it only stops one when you "bind" (give it a meaning) to end this block of code for a variable There is meaningful concept, just like an example, which you can not define, just make it. If strictly speaking, there is only one closing if all free variables are bound. Unless this happens, it only partially closes, so there is not really a shutdown, since Groove does not provide a way to define a closed lambda function and the block of code is not exactly closed lambda function ( Because there is free variable in it), we ask you to stop - even as a syntactic concept. We are talking about this as a syntax concept, because the code to define and create an example is no different, there is no difference, we know very well that this term is more or less wrong, but it is a language When talking about code, it simplifies many things that do not "know" the difference.

Comments