These types are predefined with the following names.
Instead of plain
you can also use
< with angle brackets,
but that syntax is no longer recommended, because it doesn’t
“fit” as well with some ways type names are used.
To find which Java classes these types map into, look in
Note that the value of these variables are instances
not (as you might at first expect)
The numeric types (
are discussed in Numerical types.
are discussed in Characters.
An arbitrary Scheme value - and hence an arbitrary Java object.
The type of Scheme symbols. (Implemented using the Java class
gnu.mapping.Symbol.) (Compatibility note: Previous versions of Kawa implemented a simple Scheme symbol using an interned
The type of keyword values. See Keywords.
The type of Scheme lists (pure and impure, including the empty list).
The type of Scheme pairs. This is a sub-type of
The type of Scheme strings. (Implemented using
java.lang.Stringfor immutable strings, and
gnu.lists.FStringfor mutable strings. Both of these implement the interface
java.lang.CharSequence. In the future, we may change the representation for strings containing “surrogate characters”, for efficient indexing.) (Compatibility note: Previous versions of Kawa implemented always used
The type of Scheme character values. This is a sub-type of
Object, in contrast to type
char, which is the primitive Java
The type of Scheme vectors.
The type of Scheme procedures.
The type of Scheme input ports.
The type of Scheme output ports.
This type name is a special case. It specifies the class
java.lang.String. However, coercing a value to
Stringis done by invoking the
toStringmethod on the value to be coerced. Thus it "works" for all objects. It also works for
When Scheme code invokes a Java methods any parameter whose type is
java.lang.Stringis converted as if it was declared as a
A parameter object, as created by
make-parameter. This type can take a type parameter (sic):(define-constant client ::parameter[Client] (make-parameter #!null))
This lets Kawa know that reading the parameter (as in
(client)return a value of the specified type (in this case
More will be added later.
A type specifier can also be one of the primitive Java types.
The numeric types
double are converted from the
corresponding Scheme number classes. Similarly,
can be converted to and from Scheme characters. The type
boolean matches any object, and the result is
if and only if the actual argument is
#f is identical to
#t is identical to
The return type
void indicates that no value is returned.
A type specifier can also be a fully-qualified Java class name
java.lang.StringBuffer). In that case,
the actual argument is cast at run time to the named class.
an array of references to
Used to specify that the type is unknown, and is likely to change at run-time. Warnings about unknown member names are supressed (a run-time name lookup is formed). An expression of type
dynamicis (statically) compatible with any type.