Files
2026-02-27 17:11:45 +01:00

13 lines
829 B
TeX

\subsection{The bad news: The syntax}
In short: It's quite bad, but you will get used to it and some of the (arguably) poor looking syntax choices will start to make more sense.
You should use 2 space indents (yuck) and indents matter, just like in Python.
We can use binary functions in infix or prefix notation, i.e. \texttt{x `mod` z} and \texttt{mod x z} are equivalent.
For integers the following functions are available: Normal arithmetic operations \texttt{+, -, *, /, mod, abs}, as well as \texttt{\^} which is used for exponentiation.
To use prefix notation on non-alphanumeric function names, wrap them in parenthesis like this: \texttt{(+) x z}. Using \texttt{+ x z} does not work.
We can use the normal comparison operators that return a boolean on evaluation. \bi{Booleans} are \texttt{True} and \texttt{False}