7 Zuo Kernel Language
#lang zuo/kernel |
The body of a zuo/kernel module is a single expression using a set of core syntactic forms and primitives. The expression must produce a hash table that serves as the module’s representation (see Zuo Module Protocol).
7.1 Syntactic Forms
syntax
id
syntax
literal
syntax
(expr expr ...)
syntax
(lambda formals maybe-name maybe-arity-mask expr)
formals = (id ...) | id | (id ... . id) maybe-name = string |
maybe-arity-mask = integer |
syntax
(quote datum)
syntax
(if expr expr expr)
syntax
(let ([id expr]) expr)
syntax
(begin expr ...+)
A lambda form can optionally include a name and/or arity mask. If an arity mask is provided, it must be a subset of the mask implied by the formals. If formals allows 63 or more arguments, then it must allow any number of arguments (to be consistent with the possible arities expressed by a mask).
Although let and begin could be encoded with lambda easily enough, they’re useful shortcuts to make explicit internally.
7.2 Primitives
The following names provided by zuo are also available in zuo/kernel (and the values originate there):