Path: news.daimi.aau.dk!olm From: olm@daimi.aau.dk (Ole Lehrmann Madsen) Newsgroups: comp.lang.java.advocacy,comp.lang.beta Subject: Re: inner classes are hideous Date: 9 Aug 1997 13:21:16 GMT Organization: DAIMI, Computer Science Dept. at Aarhus University Lines: 83 Message-ID: <5shqsc$fq$1@gjallar.daimi.aau.dk> References: <01bc958d$10ec9a00$3fe82299@mayura> <33EA55A0.DEE@earthlink.net> <33EA63AB.2DDB@earthlink.net> <33EC29CA.7CD5@earthlink.net> NNTP-Posting-Host: ariel.daimi.aau.dk X-Newsreader: NN version 6.5.1 (NOV) Xref: news.daimi.aau.dk comp.lang.java.advocacy:13025 comp.lang.beta:11230 Jay Martin writes: >Anatoly Vorobey wrote: >> >> On Thu, 07 Aug 1997 17:09:15 -0700, Jay Martin wrote >> What do inner classes (as hideous as they are) have in common with >> theoretical functional languages, O Clueless One? Or are you simply >> enjoying flaming everything you don't understand? >Inner classes are like "closures" like from Scheme. The ability >to nest and for the nested entities to automatically get access >to all objects in the enclosing scopes. Something that has >not been in the mainstream strongly typed object oriented model >with respect to classes until this "genius" discovery of >inner classes. Basically, Inner classes seems to be the >result of a "language designer" with a "Scheme" mentality >axe to grind at any cost. Inner Classes (or nested classes) originate from Simula, the first object-oriented language. They have been further developed in the BETA programming language. I am not familiar with the details of inner classes in Java, but in Simula and BETA nested classes are considered a very useful feature and used for a large variety of reasons. Nested classes in Simula is a generalization of nested procedures and blocks from Algol 60 (sometimes called block structure). To my knowledge, the Algol concept of block structure (including lexical scoping) has influenced the design of Scheme. I thus think that Inner Classes in Java can be just as well traced back to an Algol/Simula/BETA OO-style as to a Scheme style. ---olm References ---------- If you are interested in how nested classes are used in OO languages, here are some (incomplete and BETA biazed) references: In 1-3 the use of nested classes in object.oriented languages are discussed. 4. discuss the combination of part objects and anonymous nested classes. 5 and 6 are general papers about Simula and BETA published in 8, and 7 is a book on BETA. 1. O.L. Madsen: "Block Structure and Object Oriented Languages" In: B.D. Shriver, P. Wegner (eds.): Research Directions in Object Oriented Programming, MIT Press, 1987 (Also in ACM SIGPLAN Notices late 1986) 2. P. A: Buhr, C.R. Zarnke: "Nesting in an Object-Oriented Language is NOT for the Birds" ECOOP'88, Oslo, LNCS 322, Springer Verlag, 1988 3. C. Rapin: "Block Structured Object Programming" ACM SIGPLAN Notices, v 32(4), April 1997 4. O.L Madsen, B.Moller-Pedersen: Parts Objects and their Location In: Proceedings of TOOLS 7, Technology of Object-Oriented Languages and Systems, Dortmund, Prentice Hall, 1992 5. B. Magnusson: An Overview of Simula In: 8 6. O.L. Madsen: An overview of the BETA Programming Language In: 8. 7. O.L. Madsen, B. Moeller-Pedersen, K. Nygaard: Object-Oriented Programming in the BETA Programming Language. ACM Press/Addison Wesley, 1993, ISBN 0-201-62430-3 8. J.L. Knudsen, M. Loefgren, O.L. Madsen, B. Magnusson (eds.): Object-Oriented Environments - The Mjolner Approach. Prentice-Hall, 1992, ISBN 0-13-009291-6 4 and 6 are available from http://www.daimi.aau.dk/~beta/ For more information on BETA see http://www.mjolner.com