2 ms·
I decided to exclude global variables from my definition of closure to make it perfectly clear that closure, as it exists in JavaScript, LISP, Python and most o
by tomp 14y ago
I decided to exclude global variables from my definition of closure to make it perfectly clear that closure, as it exists in JavaScript, LISP, Python and most other functional/modern languages, is different from raw function that can be defined in C, Java, and similar.
No, I deliberately chose the "wrong" example, and included a Note, saying that the function doesn't close over the values of its free variables, but rather over the whole variables (in different words, over the references to the values).