Path: news.cs.au.dk!not-for-mail From: "Kasper Osterbye" Newsgroups: comp.lang.beta Subject: How to do non-inner specialisation?? Date: Tue, 22 Feb 2000 21:28:13 +0100 Organization: University of Aarhus, Department of Computer Science (DAIMI) Lines: 43 Message-ID: <88urqu$ccagn$1@xinwen.cs.au.dk> NNTP-Posting-Host: lissi-15.cs.au.dk X-Trace: xinwen.cs.au.dk 951251614 12986903 255.255.255.255 (22 Feb 2000 20:33:34 GMT) X-Complaints-To: news@cs.au.dk NNTP-Posting-Date: 22 Feb 2000 20:33:34 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Xref: news.cs.au.dk comp.lang.beta:12248 Hi, Sometimes I need to do virtuals as it is done in all the other OO languages, especially I find it useful in connection with "print" methods that convert an object to text. Here it is not at all obvious that I need to text from the super class at all. The text below does the job, but I would have liked to capture it in a more compact abstraction - this is more of an ideom than an abstraction. printMS is short for printMostSpecific (# Once: (# done: @boolean; act: (# do (if not done then INNER ; true->done if) #) do INNER #); A: (# print: (# do 'I am an A'->putline #); printMS:< Once (# do INNER ; act (# do print #) #) #); B: A (# print: (# do 'I am a B'->putline #); printMS::< (# do INNER ; act (# do print #) #) #); C: B (# print: (# do 'I am a C'->putline #); printMS::< (# do INNER ; act (# do print #) #) #); someB: ^B do &C[]->someB[]; someB.print; '-----------'->putline; someB.printMS #) -- Kasper