Path: news.daimi.aau.dk!grouleff From: Morten Grouleff Newsgroups: comp.lang.beta Subject: Re: constant & private attributes Date: 20 Nov 1996 14:06:03 +0100 Organization: DAIMI, Computer Science Dept. of Aarhus Univ. Lines: 30 Sender: grouleff@fraxinus.daimi.aau.dk Message-ID: References: <3292E2B6.41C67EA6@cs.kuleuven.ac.be> NNTP-Posting-Host: fraxinus.daimi.aau.dk Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit To: Walid Al-Ahmad X-Newsreader: Gnus v5.2.40/Emacs 19.30 Xref: news.daimi.aau.dk comp.lang.beta:10886 Walid Al-Ahmad writes: > > Hello evreybody, > > I have the following two questions for which I do not, directly, find > answer in the book of Madsen et al. : > 1) How can I define constant (integer, real, ..) attributes in Beta ? > How is PI defined in the math library for example ? In 'math.bet' in basiclib, the following pattern is declared: pi: (# Exit 3.14159265358979323846 #); This is in effect a costant. The compiler can optimize this into a constant in the generated code. > 2) Is it possible to manipulate attributes outside the pattern ? Are > they read-only variables like Eiffel's attributes ? Can I do something > like this : > A : (# x :@integer; ... #) > a : @A; 3->a.x Remote acces to attributes of an object is allowed. There is no access control keywords in the BETA language. For that purpose, one usually uses the fragment system. -- mailto:grouleff@daimi.aau.dk (Morten Grouleff)