manpagez: man pages & more
info guile
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.9.7 Procedure Properties and Meta-information

In addition to the information that is strictly necessary to run, procedures may have other associated information. For example, the name of a procedure is information not for the procedure, but about the procedure. This meta-information can be accessed via the procedure properties interface.

The first group of procedures in this meta-interface are predicates to test whether a Scheme object is a procedure, or a special procedure, respectively. procedure? is the most general predicates, it returns #t for any kind of procedure.

Scheme Procedure: procedure? obj
C Function: scm_procedure_p (obj)

Return #t if obj is a procedure.

Scheme Procedure: thunk? obj
C Function: scm_thunk_p (obj)

Return #t if obj is a thunk—a procedure that does not accept arguments.

Procedure properties are general properties associated with procedures. These can be the name of a procedure or other relevant information, such as debug hints.

Scheme Procedure: procedure-name proc
C Function: scm_procedure_name (proc)

Return the name of the procedure proc

Scheme Procedure: procedure-source proc
C Function: scm_procedure_source (proc)

Return the source of the procedure proc. Returns #f if the source code is not available.

Scheme Procedure: procedure-properties proc
C Function: scm_procedure_properties (proc)

Return the properties associated with proc, as an association list.

Scheme Procedure: procedure-property proc key
C Function: scm_procedure_property (proc, key)

Return the property of proc with name key.

Scheme Procedure: set-procedure-properties! proc alist
C Function: scm_set_procedure_properties_x (proc, alist)

Set proc’s property list to alist.

Scheme Procedure: set-procedure-property! proc key value
C Function: scm_set_procedure_property_x (proc, key, value)

In proc’s property list, set the property named key to value.

Documentation for a procedure can be accessed with the procedure procedure-documentation.

Scheme Procedure: procedure-documentation proc
C Function: scm_procedure_documentation (proc)

Return the documentation string associated with proc. By convention, if a procedure contains more than one expression and the first expression is a string constant, that string is assumed to contain documentation for that procedure.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on April 20, 2013 using texi2html 5.0.

© manpagez.com 2000-2024
Individual documents may contain additional copyright information.