Compiler Directives
In U, Compiler Directives are denoted by a colon (:)
.
When you write code, the U compiler assists you by allowing you to modify its behavior using directives. Nearly all programming concepts can be implemented through compiler directives, enabling you to freely choose characters for clear expression of:
- Symbols,
- Control flows,
- Concurrency operations
- ...
:? x % 2 :> \< 'x is odd'
# ':?' => ':' + '?' => <if> control flow
# ':>' => ':' + '>' => inline function declaration
A colon surrounded by spaces, like ' : ', is for binding: an association betwenn left and right values. See Variables.