Various named option control how Kawa compiles certain forms.
--module-static
module-static is specified, generate a static module
(as if (module-static #t) were specified). See Module classes.
--warn-invoke-unknown-method
invoke function calls a named method
for which there is no matching method in the compile-time type of the receiver.
This (currently) defaults to on;
to turn it off use the --no-warn-invoke-unknown-method flag.
--warn-undefined-variable
define-variable form can be used to silence warnings.
It declares to the compiler that a variable is to be resolved dynamically.)
An option can be followed by a value, as
in --warn-invoke-unknown-method=no.
For boolean options, the values yes, true, on, or 1
enable the option, while no, false, off,
or 0 disable it.
You can also negate an option by prefixing it with no-:
The option --no-warn-invoke-unknown-method
is the same as --warn-invoke-unknown-method=no.
You can set the same options (except, for now, module-static)
within your Scheme source file. (In that case they override the
options on the command line.)
| module-compile-options [key: value] ... | Syntax |
This sets the value of the key option to value
for the current module (source file). It takes effect as
soon it is seen during the first macro-expansion pass,
and is active thereafter (unless overridden by with-compile-options).
The key is one of the above option names.
(The following colon make it a Kawa keyword.)
The value must be a literal value: either a boolean
( (module-compile-options warn-undefined-variable: #t)
;; This causes a warning message that y is unknown.
(define (func x) (list x y))
|
| with-compile-options [key: value] ... body | Syntax |
Similar to module-compile-options, but the option
is only active within body.
(define (func x)
(with-compile-options warn-invoke-unknown-method: #f
(invoke x 'size)))
|