Next: Standard Pre-Scheme environment, Previous: Differences between Pre-Scheme & Scheme, Up: Pre-Scheme
Although Pre-Scheme's static type system is based mostly on Hindley-Milner type inference, with as little explicit type information as possible, there are still places where it is necessary to specify types explicitly; for example, see Pre-Scheme access to C functions and macros. There are several different kinds of types with different syntax:
define-record-type
special form described
later; the following base types are defined:
integer
long
. The actual size depends on the size of C's long
,
which on most architectures is 32 bits.
float
double
.
null
null
type translates to the C
void
type.
unit
void
, so that it has one value is not strictly true.
boolean
char
type. #t
is emitted as
TRUE
, and #f
, as FALSE
; these are usually the same
as 1
& 0
, respectively.
input-port
output-port
stdio
, these are
translated to FILE *
s, stdio
file streams.
char
char
type.
address
(=> (
argument-type ...)
return-type ...)
(^
type)
vector-ref
—; addresses simply index bytes, on which only
direct dereferencing, but also arbitrary address arithmetic, is
available. Pointers and addresses are not interchangeable, and
and there is no way to convert between them, as that would break the
type safety of Pre-Scheme pointers.
(tuple
type ...)