Talk:Closure (computer programming): Difference between revisions

Content deleted Content added
No edit summary
explaining recent edit
Line 58:
 
[[user:bjt|bjt]]
----
IMO the example ''was'' too complex. Also, Perl is a heinous language for explaining computer science concepts (e.g., you have to use "shift" to peel off arguments --- utterly obscure --- not to mention all the other random syntactic noise that comes with Perl). I replaced it with a more basic explanation that just conveys the idea of lexical scope capture. I used ML, which has a far more concise and pseudocode-like syntax than Perl.
 
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)