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

FragmentParses asSynonyms
2 plus 3Binary(PLUS, …)plus, add, or + token
4 minus 1Binary(MINUS, …)minus, spends
2 times 3Binary(STAR, …)times, *, multiply, double, doubles, whelps, …
6 divided by 2Binary(SLASH, …)divided by, /, broke, divide, halves
not falseNot(false)not, never
"a" plus "b"string concatIf both sides are numbers, adds; otherwise joins text

Division by zero throws a runtime error.

Literals

FragmentParses as
true, yes, yeah, yepBooleanLiteral(true)
false, no, nopeBooleanLiteral(false)
nothing, empty, starving, hungry, …NullLiteral (see null-clear list in Stashes and piles)
memoryVariable(memory)
ballVariable(ball) (registered object)

Count phrases (use in math)

FragmentParses asNeed to know
how many toys she hasField(she, items)Dog count
how many treats the labrador hasField(labrador, food)
count of the items in the cookie jarStashAccess(COUNT)Jar or pile size
memory minus how many toys she hasBinary(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, 3FunctionCall(add, [2, 3]). Name must match a defined trick; with introduces arguments (comma-separated).

See Share, pass, tricks.