In addition to
define (which can take an optional type specifier),
Kawa has some extra definition forms.
define, except that
nameis not exported.
nameto have the given
value. The value is readonly, and you cannot assign to it. (This is not fully enforced.) If the definition is at module level, then the compiler will create a
finalfield with the given name and type. The
valueis evaluated as normal; however, if it is a compile-time constant, it defaults to being static.
initis specified and
namedoes not have a global variable binding, then
initis evaluated, and
namebound to the result. Otherwise, the value bound to
namedoes not change. (Note that
initis not evaluated if
namedoes have a global variable binding.)
Also, declares to the compiler that
namewill be looked up in the dynamic environment. This can be useful for shutting up warnings from
This is similar to the Common Lisp
defvarform. However, the Kawa version is (currently) only allowed at module level.