Path: news.cs.au.dk!not-for-mail From: Flemming Gram Christensen Newsgroups: comp.lang.beta Subject: Re: More newbie questions ... Date: 30 May 2000 15:49:12 +0200 Organization: University of Aarhus, Department of Computer Science (DAIMI) Lines: 82 Message-ID: References: <3932AB74.640B7ABE@skynet.be> NNTP-Posting-Host: odin.mjolner.dk X-Trace: xinwen.cs.au.dk 959694555 17599558 255.255.255.255 (30 May 2000 13:49:15 GMT) X-Complaints-To: news@cs.au.dk NNTP-Posting-Date: 30 May 2000 13:49:15 GMT X-Newsreader: Gnus v5.7/Emacs 20.4 Xref: news.cs.au.dk comp.lang.beta:12365 Atle writes: > I have worked my way through some initial documentation, and only a few loose ends remain. > Hopefully, they should just require (Y/N) answers or one-liners. > Unfortunately, the saying goes: One idiot can ask more than ten wise men can answer :-) > This why I might be asking the wrong question, and in that case, the answer may not be so simple after all ... > > 1. Are compiler directives standardized across implmentations (Y/N)? Most are. Which do you have in mind? > > 2. Why are control structures called 'imperatives'? Can the difference be described with a 'one-liner', if not, I will be happy with > just the name of a document outlining the philosophy behind the Beta control structures ('imperatives'). Imperatives are similar to statements in Pascal or C. They do not generate a result value. This is opposed to evaluations. The imperatives are: ( found in beta/grammars/beta/beta-meta.gram, the grammar (please note the html version i beta/doc/grammars/beta) ) ::| | | | | | | | | ; > > 3. Are loops part of the language, or are they meant to be specialized from a general case (Y/N)? > Both. You can do a loop like: (for 10 repeat "do something ten times" for); or (for i:12 repeat "do something parametrized by 'i' 12 times" "eg. i->putint;" for); 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); #); etc. Another example is using the INNER construct. Eg. a list as found in beta/containers/list.bet can be scanned using: (# l:@list(# element::IntegerObject #); (* declare list of integerObjects *) do list.scan (# do current.value->putint; #); #) > With these things settled, I can start on my own hello.bet, and hopefully understand what I am doing along the way. > > Is there a Beta User Group (sorry, I had to capitalize :-) where I can meet other newbies, people who have just typed in their first > 'hello' program and want to program that killer app for the next millennium? > A place with > Best wishes Atle You are welcome in this newsgroup. Ask away. Flemming