(if E0 // E1 then ... // E2 then ... ... // En then ... if)
with a possible else-part.
The value of E0, E1, E2, ..., En must be of type int, bool, char, real, iref or cref.
It is thus not possible to compare a list of values as in:
(# P: (# ... exit(e1,e2,e3) #); A: (# ... exit(f1,f2,f3) #); do (if P // A then ... // (g1,g2,g3) then ... if) #)
Often the following If imperative is used:
(if boolExp // true then ... else ... if);
The current version of the compiler supports an extension to the BETA language called Simple If Imperative. This extension means, that the case-selector // may be omitted, if the evaluation on the left hand side exits a boolean. That is, the above may be written
(if boolExp then ... else ... if);
Like in the general if-statement, the else part is optional.
(L: imp1; imp2; ...; impN :L)
has been eliminated from the language. Instead the following construct may be used:
L: (# do imp1; imp2; ... ; impN; #)
Inserted items with no declarations and no superpattern will be inlined in the enclosing code. There will thus be no execution overhead compared to the old (never implemented) labeled compound imperative statement.
P: (# do ... leave P ... restart P; ... #)
Leave/restart from an inserted item, however, is not supported by the current version of the compiler:
P: (# do ... (# do ... leave P; (* ILLEGAL *) ... restart P; (* ILLEGAL *) ... #) ... #)
(# ... do ...; P; ... #)
Inserted items are implemented as dynamic items (&P).
Inserted components ([MMN93Madsen93], section 5.10.3):
do ...; |(# ... #); ...
have not been implemented.
BETA Language Modifications - Reference Manual | © 1999-2004 Mjølner Informatics |
[Modified: Sunday October 22nd 2000 at 0:53]
|