Is a language with first-class features necessarily closable?

I understand the broad concept of closure (functions are stored together with a snapshot of the environment at the time of their definition) and functions as first-class citizens, which means that functions can be transferred and returned, like any other type of data in the language.

Interestingly, all the languages ​​I worked with them have functions as first-class citizens, for example Python, Javascript, Scheme, it seems, always have closures.

Indeed, transferring and returning closures to and from a function is one of the ways to implement functions as citizens of the first class of this language, but I am not sure that the ability to write them is a direct and inevitable consequence of the fact that functions are first-class citizens.

To add more specific terms:

Can you provide an actual example of a language that has first-class features, but where closures can not be written?

+4
source share
1 answer

Such languages ​​are languages ​​in which functions are first class objects .

When a function is defined inside another function, a nested function is called a higher order function .

, , , , , , .. , , , . , Python , , .

, , - .

, : , - , , . , .

, (Pascal, Algol) , . , .

+2

All Articles