(require mzlib/compat) | package: compatibility-lib |
The mzlib/compat library defines a number of procedures and syntactic forms that are commonly provided by other Scheme implementations. Most of the procedures are aliases for mzscheme procedures.
Same as gensym.
函数
(flush-output-port [o]) → void?
o : output-port? = (current-output-port)
Same as flush-output.
函数
Same as current-milliseconds.
函数
(atom? v) → any
v : any/c
语法
(define-structure (name-id field-id ...))
(define-structure (name-id field-id ...) ((init-field-id init-expr) ...))
Like define-struct, except that the name-id is moved
inside the parenthesis for fields. In addition,
init-field-ids can be specified with automatic initial-value
expression.
The init-field-ids do not have corresponding arguments for the make-name-id constructor. Instead, each init-field-id’s init-expr is evaluated to obtain the field’s value when the constructor is called. The field-ids are bound in init-exprs, but not other init-field-ids.
例如:
> (define-structure (add left right) ([sum (+ left right)])) > (add-sum (make-add 3 6)) 9
函数
(getprop sym property [default]) → any/c
sym : symbol? property : symbol? default : any/c = #f
函数
sym : symbol? property : symbol? value : any/c
The getprop function gets a property value associated with
sym. The property argument names the property to be
found. If the property is not found, default is returned.
The properties obtained with getprop are the ones installed with putprop.
函数
(new-cafe [eval-handler]) → any
eval-handler : (any/c . -> . any) = #f
Emulates Chez Scheme’s new-cafe by installing
eval-handler into the current-eval parameter while
running read-eval-print. In addition, current-exit
is set to escape from the call to new-cafe.