Path: news.daimi.aau.dk!news.uni-c.dk!sunic!sunic.sunet.se!newsfeed.tip.net!news.seinf.abb.se!nooft.abb.no!Norway.EU.net!EU.net!howland.reston.ans.net!Germany.EU.net!news.dfn.de!gina.zfn.uni-bremen.de!marvin.pc-labor.uni-bremen.de!news.uni-stuttgart.de!news.belwue.de!fu-berlin.de!marie.physik.tu-berlin.DE!wpp From: wpp@marie.physik.tu-berlin.de (Kai Petzke) Newsgroups: comp.lang.beta Subject: Re: Just add water (from the OUTER space)! Date: 23 Jul 95 01:52:16 GMT Lines: 75 Message-ID: References: <9506261555.ZM1542@siren1.zcu.cz> NNTP-Posting-Host: marie.physik.tu-berlin.de (130.149.40.96) NNTP-Posting-User: wpp X-Access: 16 915 novy1@siren1.zcu.cz (Marek Novy) writes: >news:3se3ic$ar0@nic.zcu.cz >Erik, thanks for a such extended analysis. But my original idea was quite >different. I recognize my original definition with functional ancestor >being wrong. I'm sorry. >I'l try to show what I mean on a slightly modified Erik's example. I like the idea of the inner/outer/functional ancestor stuff. However, I think, that in Marek Novy's description, the term "outer" can be misleading. In current versions of BETA, do part are called from the super-pattern to the sub-pattern: a: (# do ... INNER ... #); b: a (# do ... INNER ... #); c: b (# do ... INNER ... #); d: c (# do ... INNER ... #); That means, that the do-part of b is called from the INNER of a, the do-part of c is called from the INNER of b, and so on. The idea is now to allow the do-part of a sub-pattern to be inserted at any place of the chain: a: (# do ... INNER ... #); b: a (# do ... INNER ... #); c: b ! a (# do ... INNER ... #); d: c (# do ... INNER ... #); If an instance of pattern b is executed, the do-parts are called as normal (first that of a, then that of b from the INNER of a). Things change, when we exectue an instance of pattern c. The difference is the "! a" in the pattern definition. It means: "call the do-part of pattern c from the do-part of pattern a". In that case, the INNER of c calls those do-parts, that have not yet been processed (so inner corresponds here to the outer proposed by others). In a diagram: normal execution path: a->b->c modified path in our example: a->c->b If an instance of the above pattern d is executed, the do-part of d gets the last element in the call chain in both cases: normal: a->b->c->d modified as in example: a->c->b->d In other words: using the "! " construct means to insert the current do-part at a different place in the call cahin. In some cases, it may also be wanted to abandon a part of the call chain. That can be done by supplying a pattern name to the INNER imperative, as in: a: (# do ... INNER ... #); b: a (# do ... INNER ... #); c: b ! a (# do ... INNER b ... #); d: c (# do ... INNER ... #); That means, that the do-part of c shall call the INNER of b. That means, that b is no longer called, the call chain reads now: a->c->d Kai -- Kai Petzke | How fast can computers get? Technical University of Berlin | Berlin, Germany | Warp 9, of course, on Star Trek. wpp@marie.physik.tu-berlin.de |