A Keywords
These 37 words are the keywords of Zeno. A keyword is never a name: a
variable, function or field cannot be called match or
take, and the compiler says so if one is.
| Word | Means | Chapter |
|---|---|---|
and |
true when both sides are | 5 |
as |
names what is caught:
except ValueError as e |
14 |
assert |
in a test: this must be so | 25 |
break |
leave the loop now | 7 |
case |
one arm of a match |
12 |
class |
declares a class | 11 |
const |
a value fixed for the whole program | 4 |
continue |
go on with the next turn of the loop | 7 |
else |
the other branch of an
if |
7 |
enum |
declares an enum | 12 |
except |
catches an error of a kind | 14 |
false |
the bool that is not
true |
5 |
for |
goes through the items of something | 7 |
from |
from math import sqrt; and
needs ... from in a package |
21 |
function |
declares a function, or writes one in place | 8 |
if |
runs a block when a condition holds | 7 |
import |
brings in a module | 21 |
in |
is it in there? and
for x in xs |
9 |
interface |
declares an interface | 20 |
is |
with none only:
x is none; and class C is I |
13 |
let |
declares a name that keeps its value | 4 |
match |
runs the case that fits a value | 12 |
none |
nothing here | 13 |
not |
turns a bool round |
5 |
or |
true when either side is;
T or none |
5 |
owned |
a class or list with one owner | 30 |
private |
for its own file only | 21 |
raise |
raises an error | 14 |
raises |
in a heading: the errors a function may raise | 14 |
return |
gives a value back and ends the call | 8 |
strict |
as a file’s first line: every type must be known | 16 |
take |
on a parameter: the function takes the value over | 30 |
true |
the bool that is |
5 |
try |
runs a block whose errors may be caught | 14 |
unsafe |
a block for what Zeno cannot check | 33 |
var |
declares a name whose value can change | 4 |
while |
repeats a block while a condition holds | 7 |
Words that are not keywords
A few words have a meaning in one place and are ordinary names everywhere else, because in that place no name could stand:
test, before a string at the top of a file, starts a test (Testing).package,needsandatare the words of azeno.packagefile (Packages).The names of the built-in types (
int,str,list,u8and the rest), of the units (ms,V) and of the built-in functions (print,len) are names declared by Zeno, which a program may declare again in an inner block.
Words from other languages
These are not Zeno, and each gets a message with the Zeno spelling:
def and fn (function),
elif (else if), &&,
|| and ! (and, or,
not), and a ; at the end of a line. So do the
names other languages give to nothing and to the two truths:
None, null, nil,
NULL, nullptr and undefined are
told that Zeno spells it none, and True and
False that it spells them true and
false.