Expressions
Math, literals, null words, count phrases, trick calls. What works in assign and print.
Used in print, assign right-hand sides, stash slot values, and trick returns.
Numbers and math
| Fragment | Parses as | Synonyms |
|---|---|---|
2 plus 3 | Binary(PLUS, …) | plus, add, or + token |
4 minus 1 | Binary(MINUS, …) | minus, spends |
2 times 3 | Binary(STAR, …) | times, *, multiply, double, doubles, whelps, … |
6 divided by 2 | Binary(SLASH, …) | divided by, /, broke, divide, halves |
not false | Not(false) | not, never |
"a" plus "b" | string concat | If both sides are numbers, adds; otherwise joins text |
Division by zero throws a runtime error.
Literals
| Fragment | Parses as |
|---|---|
true, yes, yeah, yep | BooleanLiteral(true) |
false, no, nope | BooleanLiteral(false) |
nothing, empty, starving, hungry, … | NullLiteral (see null-clear list in Stashes and piles) |
memory | Variable(memory) |
ball | Variable(ball) (registered object) |
Count phrases (use in math)
| Fragment | Parses as | Need to know |
|---|---|---|
how many toys she has | Field(she, items) | Dog count |
how many treats the labrador has | Field(labrador, food) | |
count of the items in the cookie jar | StashAccess(COUNT) | Jar or pile size |
memory minus how many toys she has | Binary(MINUS, …) | Example: 4 − 2 = 2 |
Not in math: how many items are in the cookie jar (print phrase only). In math use count of the items in ….
Not valid: minus her treats (use minus how many treats she has).
Trick calls
add with 2, 3 → FunctionCall(add, [2, 3]). Name must match a defined trick; with introduces arguments (comma-separated).
See Share, pass, tricks.
