Path: news.daimi.aau.dk!news.uni-c.dk!sunic!trane.uninett.no!nac.no!ifi.uio.no!nntp!alfh From: alfh@byleist.ifi.uio.no (Alf-Ivar Holm) Newsgroups: comp.lang.beta Subject: Re: Recursive, double INNER Date: 10 Feb 1995 14:33:20 GMT Organization: Dept. of Informatics, University of Oslo, Norway Lines: 40 Message-ID: References: <3hdl0d$c2l@belfort.daimi.aau.dk> NNTP-Posting-Host: byleist.ifi.uio.no In-reply-to: jco@daimi.aau.dk's message of 9 Feb 1995 17:56:29 GMT CC: In article <3hdl0d$c2l@belfort.daimi.aau.dk> jco@daimi.aau.dk (Jens Cornelius Olsen) writes: > My solution would be to use THIS() and pattern variables. In a *true* > recursive version this amounts to something like this > > forAllThings: > (# > before:< object; > after:< object; > callMe: ##forAllThings; > do before; > this(forAllThings)##-> callMe##; &callMe; > after; > #); Wow, it's so obvious now :-) This version is also much nicer than the one with a virtual "callMe" in the sense that the sub patterns only need to worry about "before" and "after", no fuzz with "callMe" (further binding). This is also a nice application of the pattern variable. > Where the pattern variable is used to duplicate the subpattern of forAllThings > in question. From previous email correspondance with Ole Lehrmann Madsen, one > of the designers of BETA, I know that it was (or is) considered to include > a shorter version of the two statements involving callMe in the syntax: > > &(this(forAllThings)##) > > but for now we are forced to use the callMe variable. Although the (this(patternName)##) statement would be shorter, I guess the use would be limited to object creation. (No computed references and the like.) Affi