Path: news.daimi.aau.dk!jlk From: jlk@daimi.aau.dk (Jorgen Lindskov Knudsen) Newsgroups: comp.lang.beta Subject: Re: Metaclasses in Beta Date: 16 Nov 1996 15:25:52 GMT Organization: DAIMI, Computer Science Dept. at Aarhus University Lines: 46 Message-ID: <56kme0$od$1@gjallar.daimi.aau.dk> References: <328C37F7.41C67EA6@cs.kuleuven.ac.be> Reply-To: jlknudsen@daimi.aau.dk (Jorgen Lindskov Knudsen) NNTP-Posting-Host: arsenic.daimi.aau.dk X-Newsreader: NN version 6.5.1 (NOV) Xref: news.daimi.aau.dk comp.lang.beta:10879 In <328C37F7.41C67EA6@cs.kuleuven.ac.be> Walid Al-Ahmad writes: >Beta considers patterns as objects in the sense that they are >first-class values (pattern variables). However, it seems that Beta does >not support the notion of metaclass as in Smalltalk. Right. However a few proposals have been made to support various aspects of metaclasses in BETA, but nothing have made it into the public version (yet). >Some languages like >Java, C++, Eiffel do not treat classes as objects, but they do offer >facilities to define class data; i.e., data common to all objects of the >class (static members in C++, static variables and methods in Java, and >once routines in Eiffel). >My question is whether or not Beta offers some support to achieve the >same effect ? BETA does, but blockstructure can be used to simulate the 'class variables'. Assume, you want a class X with class variables x1, x2 (let's say they i are text variables). In BETA, you can simulate this by: Xenv: @ (# x1, x2: @text; X: (# ...x1...x2... #); #) You create instances of X by: aX: @Xenv.X; and you access the x1, and x2 class variables by e.g.: Xenv.x1[]->putline; It shoud be noted, that in typical BETA programs, the design is not based on the model of class variables, as in Smalltalk, but on composite objects, nesting and inheritance. >Please let me know where to find information in literature >on Beta regarding this topic. >Thank you very much beforehand, >Best regards, >Walid Al-Ahmad Regards Jorgen Lindskov Knudsen