-
Notifications
You must be signed in to change notification settings - Fork 0
module std.ref
Jan Špaček edited this page Apr 12, 2016
·
1 revision
Mutable references are boxes with value that can be imperatively changed. They
behave as one-element arrays, but are more efficient. When two refs are compared
by equal?
, the current content is ignored -- two refs are eqv?
or equal?
only if they are the same object.
-
(ref-new val)
creates a new mutable reference with valueval
. -
(ref? x)
returns true ifx
is a mutable reference. -
(ref-get ref)
returns the value currently held inref
. -
(ref-set! ref val)
assigns theval
into theref
.