In the following definitions the closure arguments must be closure
objects. The following bindings are exported by the library
(vicare system $codes).
Return the code object wrapped by the closure.
Evaluate to the contents of the word at index idx (a non–negative fixnum) in the array of free variables in the closure memory block.
To know at run time how many free variables are associated to closure we have to inspect the associated code object.
Annotated procedures exists for debugging purposes, they allow the association of an arbitrary annotation object to a function.
(import (rnrs) (vicare system $codes)) (define (the-proc) 123) (define the-annotated ($make-annotated-procedure 456 the-proc)) (the-annotated) ⇒ 123 ($annotated-procedure-annotation) ⇒ 456
Build and return a new closure object wrapping the closure object clo and just adding an annotation object to it. When such annotated closure is applied: it applies clo to the arguments.
annotation can be any Scheme object.
Given a closure object clo being an annotated procedure created by
$make-annotated-procedure: return the annotation object.