Talk:Closure (computer programming): Difference between revisions

Content deleted Content added
explaining recent edit
closure implementation
Line 62:
 
If you want to do a more involved programming example, IMO you should create an article for [[first-class function]] or [[higher-order function]] and write it there; or, better still add it to [[functional programming]]. The term "closure", as commonly used by language designers/implementors, refers specifically to the data structure with the code pointer and environment pointer. Programming using higher-order functions is a broader idea, and belongs in a broader article. [[User:K.lee|k.lee]] 00:44, 24 Oct 2003 (UTC)
----
Re: typical implementation as "a set of values that record the values of the relevant variables in the function's lexical environment at the time of binding", this was not correct. A naive Lisp interpreter can implement a closure as a pair containing a pointer to the function and a pointer to the actual lexical environment (activation record) at the point of capture. There's no recording of values, or selection of relevant variables for capture. Wasteful and slow, but adequate. [[User:K.lee|k.lee]] 17:27, 24 Oct 2003 (UTC)