Newsgroups: comp.lang.lisp,comp.lang.dylan
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!gatech!csulb.edu!hammer.uoregon.edu!arclight.uoregon.edu!feed1.news.erols.com!howland.erols.net!newsfeed.internetmci.com!in1.uu.net!Gamma.RU!srcc!demos!pluscom!usenet
From: moroz@inist.ru (Oleg Moroz)
Subject: Re: Inner Classes in Java
X-Newsreader: Forte Agent .99d/32.182
Sender: usenet@news.rinet.ru (Superuser)
Nntp-Posting-Host: inist.cronyx.ru
Organization: A/O Plus & Cronyx Ltd. Internet Node
Message-ID: <32791bb6.14446503@news-win.rinet.ru>
References: <x5n2x4utt2.fsf@rsi.jhuapl.edu> <55ali0$il4@pravda.cc.gatech.edu>
Date: Thu, 31 Oct 1996 22:05:29 GMT
Lines: 17
Xref: glinda.oz.cs.cmu.edu comp.lang.lisp:23459 comp.lang.dylan:7479

On 31 Oct 1996 11:53:20 -0500, lyman@cc.gatech.edu (Lyman S. Taylor) wrote:

>  [ In an initial scan I'm not convinced that this going to give you
>	"closures" per se. In pascal you can define a procuedure within
>	 a procedure. While a nested lexical scope it isn't a "closure".
>         There is still no way to dynamically create a new method and return
>	 it. [ For Java the VM creates all classes/methods. In Pascal it is 
>	 illegal period.   ]

The main difference between Pascal-style inner procedure and the real closure is
that the closure is closed over it's free variables. The closure can outlive the
invocation of the enclosing block and more than one closure can share the same
code at the same time but have it's private data (from the parent's invocation).
Java ineer classes (those defined inside the method) have this property, so they
are more like closures not just lexically-scoped procedures.

Oleg
