From: Yohanes Santoso Date: 2002-04-03T06:54:04+09:00 Subject: Re: seeking to understand... ptkwt@shell1.aracnet.com (Phil Tomson) writes: > In article <87hemtaotb.fsf@jenny-gnome.dyndns.org>, > Yohanes Santoso wrote: > >ptkwt@shell1.aracnet.com (Phil Tomson) writes: > > > >> Ruby has several important features lacking in Python, such as lexical > >> closures. And the fact that Python just recently added iterators and > > > >What is this "lexical closures" that I've been hearing about? Most > >probably it is something that I have been taking for granted. > > > >YS. > > b. Using a Proc (which, remember, is a closure) allows me to do that. Thanks Phil for the explanation. Now I know for sure that I've been taking lexical closure for granted. I've been using Proc in the manner you described. However, intead of naming what I do as lexical closure, I named them dynamic action. Now I know its proper name. Priceless. In Java, lexical closure is achievable with the use of anonymous class with some additional work: keeping the values of a and b somewhere within the anon class. Am I correct to say performing lexical closure in Python is about equal to performing it in Java? YS.