Path: news.cs.au.dk!news.net.uni-c.dk!howland.erols.net!newsfeed.cwix.com!newsfeed.icl.net!oleane.net!oleane!freenix!skynet.be!poster!not-for-mail From: Atle Newsgroups: comp.lang.beta Subject: Re: More newbie questions ... Date: Tue, 30 May 2000 18:46:03 -0100 Organization: Belgacom Skynet SA/NV Lines: 49 Message-ID: <39341A7B.745D47B3@skynet.be> References: <3932AB74.640B7ABE@skynet.be> NNTP-Posting-Host: dialup376.charleroi.skynet.be Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news0.skynet.be 959704982 32364 194.78.239.56 (30 May 2000 16:43:02 GMT) X-Complaints-To: abuse@skynet.be NNTP-Posting-Date: 30 May 2000 16:43:02 GMT X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.2.5-15 i686) X-Accept-Language: en Xref: news.cs.au.dk comp.lang.beta:12367 Flemming Gram Christensen wrote: > > Most are. Which do you have in mind? Eh, I was just unsure ... but I suppose I can work my way through to a mid-sized program without bumping into any incompatabilities (to put it another way?) > > Imperatives are similar to statements in Pascal or C. They do not generate a result value. > This is opposed to evaluations. Thanks! That put that one in place! Is there a one-liner to descripe each of these? > | > | > | > I see coroutines ... are there also 'generators' like in Icon? (If there aren't and your reaction is WHAT?? then it is related to the ProLog inference engine, and not in Beta :-) > Both. You can do a loop like: > > (for 10 repeat > "do something ten times" > for); Can you replace 10 by any evaluation (=expression?) > > or > > (for i:12 repeat > "do something parametrized by 'i' 12 times" > "eg. i->putint;" > for); Bearing in mind the WHAT?? possibility above, is i:12 a generator? > > or using a combination of a labelled imperative and restart/leave: > > (# i:@integer; > do 0->i; (* assign 0 (zero) to i *) > loop: > (if i < 8 then > i->putint; ' is less than 8'->putline; > i+1 -> i; (* assign i+1 to i *) > restart loop; (* begin from if again *) > if); > #); Is this a variant of goto? > > You are welcome in this newsgroup. Ask away. Thanks! I have 'studied' Beta for a couple of days now, but I still feel kinda 'fresh' :-) Atle