lotus



previous page: C14.2) New features in version 5.2 of the Compiler
  
page up: BETA Programming Language FAQ
  
next page: C14.4) New features in version 5.0 of the Compiler

C14.3) New features in version 5.1 of the Compiler




Description

This article is from the FAQ, by with numerous contributions by others.

C14.3) New features in version 5.1 of the Compiler

The following new features have been implemented in version 5.1 of the
compiler, compared to version 5.0.

General Repetitions
Repetitions of static objects are now allowed. That is, given

        A: (# ... #); V:< A;
        P: (# ... #);
        S: <<SLOT SS:Descriptor>>;

then

        X:  [10] @P;
        XC: [11] @|P;
        Y:  [12] @V;
        YC: [13] @|V;
        Z:  [14] @S;
        ZC: [15] @|S;

are all allowed. The operators new and extend also applies to
repetitions of this kind, like for other repetitions.

Qualification from pattern attributes
It is now possible to qualify a reference as in the following example:

        grammar: (# symbol: (# ... #); .... #);
        A: ^grammar.symbol

This was previously forbidden because grammar is not an object.

THIS(P) applies to prefix
Previously THIS(P) was only known to work inside the P pattern. Now it
also works for prefixes of P, e.g.:

        Q: (# x:  @integer; ... #);
        P: Q(# x: @integer;
           do ... THIS(Q).x -> ... (* will get the x of Q *)
           #)

Short-circuit Boolean Expressions
Boolean expressions are now implemented as short-circuit. That is, B2
is not evaluated if B1 is true in

B1 or B2

and B2 is not evaluated if B1 is false in

B1 and B2

Final Binding to a Virtual Pattern
Final binding of a virtual pattern to another pattern, which is virtual
itself, is now allowed. That is, given the following:

        P1: (# V:< ... (* V virtual *)
               W:< ... (* W virtual *)
            #);

it is now allowed to do the following in a specialization of P1:

P2: P1(# W:: V (* V still virtual, but W now final bound *) #);

The implementation of this is somewhat preliminary.

Special Characters in String Literals
The compiler will no longer accept newline, carriage return or file
separator characters in string literals, not even if escaped by \. This
is to prevent errors that could occur when a string literal was not
closed, i.e. a closing quote was forgotten. This kind of error is no
longer possible. Of course, \n is still accepted in string literals.

Furthermore literal null-characters \000 in strings will now result in
a warning, since this may yield unpredictable results.

MAKE Property Behavior
When specifying a MAKE property for automatic recompilation of external
sources, the makefiles which are run are now executed relative to the
directory in which the file containing the MAKE property is placed.
This simplifies writing of makefiles a lot.

Consistent Command Line Options
The command line options that can be used when activating the compiler
have been revised and are now more consistent than previously: most
options now have an activating and a deactivating form. Furthermore
most options now have a short one-character equivalent for the
non-default form. The short options have been chosen so that the
character matches the first character in the long form as often as
possible. Short options can now be concatenated.

Please inspect chapter 8 of the Compiler manual for details, and please
note that a few options have different meanings than previously, e.g.
-c now corresponds to --noCode, where it previously corresponded to
--noLink.

 

Continue to:















TOP
previous page: C14.2) New features in version 5.2 of the Compiler
  
page up: BETA Programming Language FAQ
  
next page: C14.4) New features in version 5.0 of the Compiler