(guile.info.gz) Closures
Info Catalog
(guile.info.gz) Procedures
(guile.info.gz) Non-immediate Datatypes
(guile.info.gz) Subrs
18.2.5.4 Closures
.................
[FIXME: this needs to be further subbed, but texinfo has no subsubsub]
A closure is a procedure object, generated as the value of a
`lambda' expression in Scheme. The representation of a closure is
straightforward -- it contains a pointer to the code of the lambda
expression from which it was created, and a pointer to the environment
it closes over.
In Guile, each closure also has a property list, allowing the system
to store information about the closure. I'm not sure what this is used
for at the moment -- the debugger, maybe?
-- Macro: int SCM_CLOSUREP (SCM X)
Return non-zero iff X is a closure.
-- Macro: SCM SCM_PROCPROPS (SCM X)
Return the property list of the closure X. The results are
undefined if X is not a closure.
-- Macro: void SCM_SETPROCPROPS (SCM X, SCM P)
Set the property list of the closure X to P. The results are
undefined if X is not a closure.
-- Macro: SCM SCM_CODE (SCM X)
Return the code of the closure X. The result is undefined if X is
not a closure.
This function should probably only be used internally by the
interpreter, since the representation of the code is intimately
connected with the interpreter's implementation.
-- Macro: SCM SCM_ENV (SCM X)
Return the environment enclosed by X. The result is undefined if
X is not a closure.
This function should probably only be used internally by the
interpreter, since the representation of the environment is
intimately connected with the interpreter's implementation.
Info Catalog
(guile.info.gz) Procedures
(guile.info.gz) Non-immediate Datatypes
(guile.info.gz) Subrs
automatically generated byinfo2html