Path: news.daimi.aau.dk!news.uni-c.dk!sunic!pipex!howland.reston.ans.net!math.ohio-state.edu!cs.utexas.edu!convex!news.duke.edu!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: 8 Sep 1994 21:02:55 GMT Organization: University of Delaware, Newark Lines: 53 Message-ID: <34nu5v$oou@louie.udel.edu> References: <34n2qe$d74@nz12.rz.uni-karlsruhe.de> NNTP-Posting-Host: hercules.cis.udel.edu Xref: news.daimi.aau.dk comp.lang.beta:11 comp.lang.lisp:13147 In article rv@cs.brown.edu (rodrigo vanegas) writes: >In article <34n2qe$d74@nz12.rz.uni-karlsruhe.de>, haible@ma2s2.mathematik.uni-karlsruhe.de (Bruno Haible) writes: > >> 4. PROGN, LET, Lisp closures, list objects, defstruct objects, CLOS instances >> all correspond to "pattern"s. > >So what are these "patterns" anyway? It sounds as if they are very >close if not identical to lisp closures. After all, can't each of the >above lisp stuff can be implemented as sugar for closures. 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. To make a jump backwards to the initial comparison idea, the key conceptual difference between Beta and Lisp is that Beta is very static: patterns are static entities which are compiled into programs. At runtime, a pattern is instantiated into an "object" which, depending on how it's used, may be a value or a procedure, or any combination thereof (just like a closure, because it IS a closure). 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. <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. <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. 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... -- || Mark Craig Chu-Carroll: || "I'm not dumb, || CIS Grad, U of Delaware || I just have a command of thoroughly || PGP key available by finger || useless information." || carroll@cis.udel.edu || -Calvin