Identifiers
Identifiers are names used for variables, functions, types, and other entities. They must start with a letter or an underscore and can contain letters, digits, and underscores.
let name = "Motoko";
let a1 = 123;
let camelCaseIdentifier = "best practice";
let snake_case_identifier = "for compatibility with other languages";
Reserved syntax keywords
Motoko reserves certain words for its syntax and they cannot be used as identifiers. These include:
actor
and
assert
async
async*
await
await*
break
case
catch
class
composite
continue
debug
debug_show
do
else
false
flexible
finally
for
from_candid
func
if
ignore
import
in
label
let
loop
module
not
null
object
or
persistent
private
public
query
return
shared
stable
switch
system
throw
to_candid
transient
true
try
type
var
while
with