Sage-Code Laboratory
index<--

Wee Operators

Wee operators are created one ASCII symbol.

Brackets

Wee is using brackets for expressions and data structures.
symboldescription
() Comma separated enumeration of values
[] Array | Slice | Subscript
{} Multi-line comments

Delimiters

symbol description
'...' ASCII string literal
"..." Unicode string literal
/*...*/ Multi-line comments or expression comment

Single Symbols

symboldescription
^ Power symbol used with fractions or expressions
# Template placeholder
$ Global constant prefix | Environment variables
@ Global variable prefix | Wee global variables
? Query memory address | Generate an integer
: Assign value | Copy value
= Equivalent | Equal
; Statement separator
. Membership qualifier notation
* Multiplication
+ Numeric addition
- Numeric subtraction

Two Symbols

symboldescription
**Single line comment | Bold comment
//End of line comment | gray comment

Logic operators

Logical operators return: 1 = true or 0 = false
symbolmeaning arity
! NOT unary
^ XOR dual
& AND dual
| OR dual
= EQ dual
> GT dual
< LT dual

patterns:

!(x = y) ; divergence of two native values
!(x > y) ; equivalent (x <= y)
!(x < y) ; equivalent (x >= y)

The table of through

pq !p p ~ q p = q p & q p | q
11 00 111
10 01 001
01 11 001
00 10 100

Bit Manipulation

symboldescription
<< shift bits to left
<< shift bits to right
A B A & B A | BA ~ B
000000 00 11
010000 01 10
110101 11 00
101110 11 01
A !A A<<1 A>>2
0000 1111 0000 0000
1111 0000 1110 0011
0111 1000 1110 0001
0110 1001 1100 0001

Read next: Syntax Overview