Path: utzoo!attcan!uunet!mcsun!ukc!mucs!mario@r3.cs.man.ac.uk From: mario@r3.cs.man.ac.uk Newsgroups: comp.object Subject: Re: object-oriented this, that, and the other thing Message-ID: <374@m1.cs.man.ac.uk> Date: 20 Nov 89 21:06:16 GMT References: Sender: news@cs.man.ac.uk Organization: University of Manchester, UK Lines: 85 In article Piercarlo Grandi writes: > Oh yes, Smalltalk has some good support. But, but, of all people > you are the one to know that blocks in Smalltalk have some > disagreeable property that greatly limits their usefulness as > closures/etc... And where is detach/resume? (well, in processes, > but this seems a bit overdone). All of the serious problems have been fixed in the 2.4 and 2.5 releases from ParcPlace. Blocks are now reentrant, can have their own temporaries, and access them through proper scoping mechanisms. Unfortunately, they are still not full continuations (this was probably asking a bit much), and the implementation of non-local returns is still not Blue Book, but on the other hand there is a Lisp-like dynamic-unwind available in 2.5. > Those who program in Smalltalk already use closures an awful > lot, and even a form of continuation (albeit somewhat restricted) > that to me is much nicer than than most mechanisms built into > other languages for non-stack-based control flow. > > As to that, Simula 67 was *the* thing as to coroutines, > generators, etc... (resume and detach); indeed I could argue that > object oriented features were invented and added to Simula I/67 > precisely because non nested flow control is essential to writing > simulations. Continuations are more powerful than coroutines; you can implement coroutines using continuations. The Blue Book semantics for blocks also allows you to do it (I can send you some example code if you want), but the ParcPlace implementations don't. I hope this will be fixed, and continuations added, in a Smalltalk-of-the-future. The following papers are recommended reading; they demonstrate the elegance and power of first-class continuations: @incollection{FriedmanHaynesKohlbecker84, author = "Daniel P. Friedman and Christopher T. Haynes and Eugene Kohlbecker", title = "Programming with Continuations", pages = "263-274", publisher = springer, year = 1984, volume = "F8", series = "NATO ASI Series", editor = "P. Pepper", booktitle = "Program Transformation and Programming Environments" } @article{HaynesFriedman87, author = "Christopher T. Haynes and Daniel P. Friedman", title = "Embedding Continuations in Procedural Objects", journal = toplas, volume = 9, number = 4, pages = "582-598", year = 1987, month = oct } @article{HaynesFriedmanWand86, author = "Chistopher T. Haynes and Daniel P. Friedman and Mitchell Wand", title = "Obtaining Coroutines with Continuations", journal = "Computer Languages", volume = 11, number = "3/4", pages = "143-153", year = "1986" } > Well, I ten to agree that Smalltalk for one has nice FP like > technology, no doubt inspired by Interlisp among others; but > unfortunately Smalltalk is not what most people know as an OO > language. The likes of Object Pascal, C++, Ada (argh!) are > associated in the public's mind with OO programming. And more's the pity. Mario Wolczko ______ Dept. of Computer Science Internet: mario@cs.man.ac.uk /~ ~\ The University USENET: mcvax!ukc!man.cs!mario ( __ ) Manchester M13 9PL JANET: mario@uk.ac.man.cs `-': :`-' U.K. Tel: +44-61-275 6146 (FAX: 6280) ____; ;_____________the mushroom project___________________________________