From: Mark Nowiasz Newsgroups: comp.lang.beta Subject: Re: Inconsistency in the Mjoelner implementation? Date: 13 Feb 1998 20:06:04 GMT Organization: University of Dortmund Lines: 68 Sender: Mark Nowiasz; ; Message-ID: <6c293c$980@nx2.HRZ.Uni-Dortmund.DE> References: <6c1hga$39h@nx2.HRZ.Uni-Dortmund.DE> NNTP-Posting-Host: sx2.hrz.uni-dortmund.de User-Agent: tin/pre-1.4-980105 (UNIX) (SunOS/5.5.1 (sun4u)) Path: news.daimi.aau.dk!news-feed.inet.tele.dk!Cabal.CESspool!bofh.vszbr.cz!fu-berlin.de!news.CS.Uni-Magdeburg.De!RRZ.Uni-Koeln.DE!news.rhrz.uni-bonn.de!news.chemietechnik.uni-dortmund.de!Uni-Dortmund.DE!not-for-mail Xref: news.daimi.aau.dk comp.lang.beta:11399 Peter von der Ahe wrote: > As defined on page 80 in the BETA book E->P->A, where P is a pattern, > the P object is called an inserted item. Oops, thanks for not telling me to RTFM :-) > The E->P->A form is normally preferred as it will lead to more > efficient loops. OK, but I do critize the this behavoiur for the following reasons: - Critics of C++ have pointed out that it isn't necessary anymore for the programmer to support the compiler to produce optimized code (e.G. inline, register, etc.). Now, the use of inserted items to support the compiler is exactly the same behaviour. I think it's rather easy for a compiler to decide if it should generate lots of object or just one "inserted" object - As I've stated before, I consider this construct to be illogical, because it looks like one would call a pattern directly without instantiating an object. Furthermore, this construct is rather dangerous, see below. - In my opinion (being used to C++ and Objective C [which I consider to be superior to C++ and BETA]) each object should be indepent unless specified otherwise. Now, by implicitely attaching an object to the surrounding environment this freedom is given up for the sake of efficiency. So, I think it's a very bad mistake to have this strange construct in the language definition just to help the compiler to produce optimized code. > However, in The Mjolner BETA System implementation, P is a synonym for > &P and therefore there is no difference as to writing P or &P. Ouch, this is actually dangerous IMHO. The Mjolner BETA System is currently the only working BETA implementation available and one could get used to the idea that a->b->c ist always a synonym for a->&b->c. In this case, it doesn't matter if an inserted object or a new object is being generated, but in a reursive pattern it's not. or take for example pattern that generate references to new objects: (# a_pattern : (# ... #); return : ^a_pattern; do 10 -> a_pattern -> return[]; exit return[] #) This example isn't theoretical, I've programmed a couple of hours ago just a similar pattern. So the question is (in the definition of BETA), is a_pattern (and return[] pointing to it) a object of it's own or does ist belong to the surrounding object? Regards, Mark -- |\ _,,,---,,_ Mark Nowiasz (buckaroo@blackbox.free.de) /,.-'' -. ;-;;,_ PGP-Key available at keyservers/request. |,4- ) )-,_..;\ ( '-' http://www.free.de/~buckaroo/ '---''(_/--' -'\_) IRC: Buckaroo | Voice: +49 177 2190385