Path: news.daimi.aau.dk!news.uni-c.dk!sunic!sunic.sunet.se!trane.uninett.no!Norway.EU.net!EU.net!howland.reston.ans.net!swrinde!cam.news.pipex.net!pipex!edi.news.pipex.net!pipex!demon!bmtech.demon.co.uk!scottw From: Scott Wheeler Newsgroups: comp.object,comp.lang.beta Subject: Re: Beta example (Was: Pointers to classes?) Followup-To: comp.object,comp.lang.beta Date: Sat, 24 Jun 1995 18:00:36 +0000 Organization: British Maritime Technology Lines: 39 Message-ID: References: <3s80ek$rou@horus.infinet.com> <3s8k3t$n6e@engnews2.Eng.Sun.COM> <3sdvam$pfg@engnews2.Eng.Sun.COM> Reply-To: Scott Wheeler X-NNTP-Posting-Host: bmtech.demon.co.uk X-Newsreader: NewsBase v1.36 (Beta) Xref: news.daimi.aau.dk comp.object:32116 comp.lang.beta:424 In Article <3sdvam$pfg@engnews2.Eng.Sun.COM> Ole Lehrmann Madsen writes: >...[text omitted] >I can also recommend that you obtain a personal edition of the Mjolner >Beta System from Mjolner Informatics. I think the current price >is only US$ 60 plus shipping. Contact addresses are given below. > >Here is, however, a small complete Beta program that can be compiled >an run. The example and its output is given after the following >(long) explanation. Thanks for the example, Ole. I hadn't realised there was a "personal" version available, and I'll look into getting that. [In library text] > list: (# ... > scan: > (# current: ^element > do loop: > (if moreElements then > nextElement[] -> current[]; > inner; > restart loop > if) > #); > #) [In the example program] > courses.scan(#do current.display; newline #); I don't entirely follow the way "inner" is used here: I'd have thought that it would refer to the body of any extension to "scan" defined in a descendant of "list". Instead, if I understand correctly, here you are making up an anonymous pattern (a singleton?), which is then acted on by the scan pattern. It looks reminiscent of the use of lamdas in Lisp - can you store this anonymous pattern in a variable for separate use? Scott