On Mon, Aug 18, 2003 at 05:49:16PM -0400, Kurt Starsinic wrote: > It seems very strange to me to say that an anonymous sub with > no private variables is "not a closure." Is not the (shorthand) > definition of a closure "a subroutine, associated with all its > bindings," even when "all" == 0? > > It's great that we have the optimization of not cloning CV's > unnecessarily. It's unfortunate that we have the misfeature of > Simon's no-DESTRUCT behavior. It's needlessly confusing to say > that anonymous subs that have no private bindings aren't closures. > > Remember the etymology of "closure." It's from set theory. > The empty set is a subset of *all* sets. Well, I've never been very conversant with set theory, so I've never understood the etymology. I've always used it in the sense of something which captures outside lexicals. Otherwise *every* sub is/has a closure, and and the term seems rather to lose its usefulness. Considering that most of the perl documentation still seems to imply that only anon subs can be closures, I had assumed I was already on the liberal wing as regards closure terminology :-) Dave. PS - I've been having some sendmail problems this afternoon, so replies to some of my emails may have bounced or been silently queued, due the hostname 'gizmo' leaking into sender addresses. Gack I hate sendmail. -- Technology is dominated by two types of people: those who understand what they do not manage, and those who manage what they do not understand.Thread Previous | Thread Next