| ||
Advanced Issues: More Versatile Control Structures |
An old idea in the BETA community, and a good one, is to provide "value" versions of the built-in control structures. This has been partially implemented in gbeta (but not in the Mjolner BETA System compiler). Such versions are used in assignment context or in evaluation context.
An example of a "value" version of an
b evaluates to true , and it works like:
b evaluates to false .
This is of course a similar semantics as that of the
if -statement in functional languages such as SML or
Haskell. The assignment variant:
"?:"
operator in C, meaning:
b evaluates to true , and:
b evaluates to false . Of course there is
a double-sided version of this, too:
There should be a similar "value" version of the general
After this slightly less serious section, we'll leave the language gbeta and look at a few changes in the modularization system.
|