|
PLT MzLib: Libraries Manual
|
|
Same as (
.not
(pair? v))
(
SYNTAX
define-structure
(name-identifier field-identifier ···)
)
Like define-struct
, except that the name-identifier
is
moved inside the parenthesis for fields. A second form of
define-structure
, below, supports initial-value expressions
for fields.
(
SYNTAX
define-structure
(name-identifier field-identifier ···) ((init-field-identifier init-expr) ···)
)
Like define-struct
, except that the name-identifier
is
moved inside the parenthesis for fields, and additional fields can be
specified with initial-value expressions.
The init-field-identifier
s do not have corresponding arguments
for the make-
constructor. Instead, the
name-identifier
init-field-identifier
's init-expr
is evaluated to obtain
the field's value when the constructor is called. The
field-identifier
s are bound in init-expr
s, but not the
init-field-identifier
s.
Example:
(define-structure (add left right) ([sum (+ left right)]))
(add-sum (make-add 3 6)) ; => 9
(getprop
sym property default
)
PROCEDURE
Gets a property value associated with the symbol sym
.
The property
argument is also a symbol that names the
property to be found. If the property is not found, default
is returned. If the default
argument is omitted, #f
is used as the default.
(new-cafe
[eval-handler
])
PROCEDURE
Emulates Chez Scheme's new-cafe
.
(putprop
sym property value
)
PROCEDURE
Installs a value for property
of the symbol sym
.
See getprop
above.
(sort
less-than?-proc list
)
PROCEDURE
This is the same as mergesort
(see section 18) with
the arguments reversed.