Path: news.daimi.aau.dk!rws From: rws@daimi.aau.dk (Rene Wenzel Schmidt) Newsgroups: comp.lang.beta Subject: Re: Overriding procedural patterns Date: 26 May 1995 10:02:05 GMT Organization: DAIMI, Computer Science Dept. at Aarhus University Lines: 61 Message-ID: <3q48ut$g7a@belfort.daimi.aau.dk> References: <3o315c$9he@pulm1.accessone.com> <3odefd$hbp@belfort.daimi.aau.dk> <3otick$s3l@belfort.daimi.aau.dk> NNTP-Posting-Host: quercus.daimi.aau.dk Thus spake wpp@lise.physik.tu-berlin.de (Kai Petzke): >rws@daimi.aau.dk (Rene Wenzel Schmidt) writes: >[discussion about override and OUTER snippped] >>>I also think it should allow for an efficient implementation, even >>>though it demands some changes compared to the methods used today in >>>Mjølner BETA. Then again it might help in implementing virtual prefix >>>and other as-yet-unsupported kinds of inheritance. >>It is actually straight forward to implement and can also >>be implemented very efficient. OUTER corresponds to C++'s A::B >>syntax, so a similar implementation is possible. >>It is statically know at compile-time what code the OUTER is >>calling, so a direct jump-subrutine call can be generated. This >>is in contrast to INNER where an indirect jump is needed. The >>way INNER dispatch is handled through the INNER dispatch-table >>does not need to be changed. >This is true. However, the override operator again adds some >complexity, as calling a pattern must then be done indirectly: in >general, at compile time it is no longer known, which do-part has >to be invocated first, thus the indirect call. >But otherwise, I think of this as a good concept. That is right. This can be implemented by letting the generation-code for a virtual procedure return a pointer to the do-part to be invocated first. If the pattern has a final binding, you can still bind it statically. >As far, as I understand the override operator, it will override >all the do parts on top of the pattern, that is defined with that >operator. Would it also make sense to have an override operator, >that overrides only a given number of do-Parts, or does that get >too complex? Could you be a little more specific. I am not quite sure what you mean. The semantic the Erik suggested for overriding (or weak-inheritance) is similar to Smalltalk semantic. OUTER corresponds to Smalltalk's super. >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 | /Rene --- Rene Wenzel Schmidt Fax: +45 8942 3255 Department of Computer Science Phone: +45 8942 3257 University of Aarhus Email: rws@daimi.aau.dk 8000 Aarhus C, Denmark WWW: http://www.daimi.aau.dk/~rws