Super BASIC coding style for Minerva

Anything QL Software or Programming Related.
tcat
Super Gold Card
Posts: 633
Joined: Fri Jan 18, 2013 5:27 pm
Location: Prague, Czech Republic

Re: Super BASIC coding style for Minerva

Post by tcat »

Hi,

Interestingly `ELSEIF' appeared in `Oberon' Language as a single word (Pascal / Modula had it as two words `ELSE IF'). This simplifies `Oberon' language implementation while offering object features at no extra big expense, unlike c++.

Tomas


User avatar
tofro
Font of All Knowledge
Posts: 2700
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Super BASIC coding style for Minerva

Post by tofro »

I'm a bit at loss on where you guys seem to see a difference (apart from the <space> character) between an ELSEIF and an ELSE IF?

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
swensont
Forum Moderator
Posts: 252
Joined: Tue Dec 06, 2011 3:30 am
Location: SF Bay Area
Contact:

Re: Super BASIC coding style for Minerva

Post by swensont »

> I'm a bit at loss on where you guys seem to see a difference (apart from the <space> character) between an ELSEIF and an ELSE IF?

Well, ELSEIF and ELSE IF are different. In Bourne/Korn shell, IF statements don't have END IF, but FI (IF backwards) and CASE ends with ESAC (CASE backwards). Both of these drive me crazy and I prefer C shell where IF ends with ENDIF.

We all have our pet peeves when it comes to languages and structures.

Tim Swenson


tcat
Super Gold Card
Posts: 633
Joined: Fri Jan 18, 2013 5:27 pm
Location: Prague, Czech Republic

Re: Super BASIC coding style for Minerva

Post by tcat »

Hi,

IF [expression] THEN [command]
ELSIF [expression] THEN [command]
ELSIF [expression] THEN [command]
...
ELSE [command]
END.

ELSEIF is an extra word to ELSE in the `Oberon' construct so the lexical analyser has easier job.

Tomas


User avatar
tofro
Font of All Knowledge
Posts: 2700
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Super BASIC coding style for Minerva

Post by tofro »

tcat wrote: ELSEIF is an extra word to ELSE in the `Oberon' construct so the lexical analyser has easier job.
That might or might not be easier, depending on the implementation of the lexer.

ql_freak, however, was pointing out a missing ELSEIF as a "missing feature of the S*Basic language". That's what I object to.

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
Post Reply