Path: news.daimi.aau.dk!news.uni-c.dk!sunic!trane.uninett.no!eunet.no!nuug!EU.net!howland.reston.ans.net!europa.eng.gtefsd.com!MathWorks.Com!udel!hercules.cis.udel.edu!carroll From: carroll@hercules.cis.udel.edu (Mark C. Chu-Carroll) Newsgroups: comp.lang.beta,comp.lang.lisp Subject: Re: Comparison: Beta - Lisp Date: 9 Sep 1994 17:44:28 GMT Organization: University of Delaware, Newark Lines: 79 Message-ID: <34q6ts$dbb@louie.udel.edu> References: <34n2qe$d74@nz12.rz.uni-karlsruhe.de> <34nu5v$oou@louie.udel.edu> NNTP-Posting-Host: hercules.cis.udel.edu Xref: news.daimi.aau.dk comp.lang.beta:23 comp.lang.lisp:13177 In article bobo@ptolemy.arc.nasa.gov writes: ]In article <34nu5v$oou@louie.udel.edu> carroll@hercules.cis.udel.edu ](Mark C. Chu-Carroll) writes: ] ] You're basically pretty much correct. A pattern is essentially the ] same thing as a closure, the primary difference being that a pattern ] is static. Essentially, a pattern is a uniform code construct which ] will be instantiated into a closure at runtime. ] ]OK, so let's equate a pattern with a lambda expression which is ]instantiated into a closure at runtime. Yep, that's pretty much it. ] The important differences come about because of three things: ] ] <1] Static typing - in Beta, the types of variables are always declared ] statically. Programs in Beta is very static, which makes it very ] different from the dynamic nature of lisp programming. ] ]Agreed, although it wouldn't take much of a stretch to imagine a lisp ]which required type declarations. Admittedly, most lisp users would ]hate that. ] ] <2] Single inheritance- the Beta object model uses only single inheritance. ] The designers decided that rather than try to work out a system for ] resolving the confusion caused by MI (namespace collisions, repeated ] inheritance, etc.), it was better to do without it. I don't necessarily ] agree with them, but it did result in keeping Beta simple. ] ]But it looked to me like the object system that Beta uses is one based ]on closures. That sort of object system has been used in lisp and has ]the same sort of single inheritance. For the same matter, I assume ]that one could build a CLOS type multiple inheritance object system ]in Beta which did not use closures in such a direct way. Again, you're pretty much right. It's *very* similar to closure based object systems. It reminds me quite a lot of a closure based object system I implemented for Scheme as an undergrad. ] <3] Virtual patterns - the object model is rather different. Instead of ] the CLOS model where a child method overrides a parent method, Beta ] uses the Simula model, where the child extends the parent method. The ] parent implementation of a method contains calls to inner, which are ] dynamically bound to the correct extension for the actual child type. ] ]See my last comment. ] ] Going further, since everything (functions, procedures, methods, values) ] is just a pattern, the virtual pattern idea can be applied to *any* ] method at all. This results in a *very* interesting program model, ] where you can write any procedure to be dynamically extensible. This can ] actually be used to write lambda expressions! It's quite elegant... ] ]Could you give an example here which doesn't look like a closure. I ]guess I'm looking for something which would not have a straightforward ]translation into lisp. If there's something new here I'd really like ]to know. No, I can't give an example which doesn't look like a closure, because as I've said, the comparison to closures is pretty damned exact. The differences that I've pointed out are primarily differences in programming style that wind up in common programs. Programming styles in Beta do end up being somewhat different than styles in Lisp, primarily because of the factors I've mentioned above. The Beta idioms could be used to implement the programming styles used by most commonlisp people; and the commonlisp idioms could be used to implement the beta style. It's not a semantic difference, just a stylistic one. -- || Mark Craig Chu-Carroll: || "A libertarian is just a republican || CIS Grad, U of Delaware || who takes drugs" || PGP Key Available, by finger || - Bob Black || carroll@cis.udel.edu ||