The Freya Programming Language

Expressions

See also

Freya has a rich expression syntax, with several enhancements to the traditional Pascal syntax:

  1. Operator precedence has been expanded to avoid all those senseless conflicts caused by the minimalistic Pascal syntax.
  2. New symbolic operators has been added, mostly for bitwise operations:

In many cases, this has been necesary to support all user defined operators allowed by the Common Language Runtime.

Expression syntax

The simplest expressions you can write in Freya are literal constants:

The new operator creates and initialize instances from any concrete data types:

Freya provides literal arrays, for simplifying array initialization:

Unary operators include numeric plus and minus, logical negation and the bitwise complement:

Binary operators include the typical numeric operators, bitwise operators, comparisons and the new null coalescing operator, for working with reference and nullable types:

Freya also supports a small set of experimental features, including conditional and common expression blocks:

These new expression types add more power to the Freya expressions, and they are very useful for inline implementations and anonymous method blocks.

See also

The Freya Programming Language
Program and file structure
Type declarations
Type members
Statements
Method calls and object paths