Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What is a closure?

0
10 Posted

What is a closure?

0

A closure is a restriction upon certain activities or public use of a defined area on the Forest. For example, closures might be implemented to help prevent human-caused fires, protect human life, or protect property. Vehicles may be restricted on certain roads when they are wet. The purpose of this type of closure would be to prevent damage to the road itself and subsequent damage to soils or streams from water or mud draining off the damaged road.

0
0

If any one is reading this they should probably look at the Wikipedia article on closures. The discussion section is particularly illuminating. Here is the general definition they give there: “In computer science, a closure is a function that is evaluated in an environment containing one or more bound variables. When called, the function can access these variables.” I will add a few belated comments to the original article in red. What do you understand is meant by the term, “closure”? In a discussion in the comp.lang.misc newsgroup almost everyone seemed to take it as meaning a partially instantiated function. BTW the term “partially instantiated function” is used by Jeffrey D. Ullman, author of “Elements of ML Programming”. It strikes me as a much more precise term; however it doesn’t seem to have caught on – a google search turns up few references. Partially instantiated function is close to the comp.lang.misc usage, though not necessarily to the wikipedia definition. Likewise, usin

0
10

What this function, make-counter, does is it returns a function, which we’ve called x, that will count up by one each time its called. Since we’re not providing any parameters to x it must somehow remember the count. It knows where to find it based on what’s called lexical scoping – it must look to the spot where it’s defined to find the value. This “hidden” value is what is called a closure.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123