DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

(guile.info.gz) Procedure Properties

Info Catalog (guile.info.gz) Optional Arguments (guile.info.gz) Procedures and Macros (guile.info.gz) Procedures with Setters
 
 23.3 Procedure Properties and Meta-information
 ==============================================
 
 Procedures always have attached the environment in which they were
 created and information about how to apply them to actual arguments.  In
 addition to that, properties and meta-information can be stored with
 procedures.  The procedures in this section can be used to test whether
 a given procedure satisfies a condition; and to access and set a
 procedure's property.
 
    The first group of procedures 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.  `closure?' does not return `#t' for primitive
 procedures, and `thunk?' only returns `#t' for procedures which do not
 accept any arguments.
 
  -- Scheme Procedure: procedure? obj
  -- C Function: scm_procedure_p (obj)
      Return `#t' if OBJ is a procedure.
 
  -- Scheme Procedure: closure? obj
  -- C Function: scm_closure_p (obj)
      Return `#t' if OBJ is a closure.
 
  -- Scheme Procedure: thunk? obj
  -- C Function: scm_thunk_p (obj)
      Return `#t' if OBJ is a thunk.
 
    Procedure properties are general properties to be attached to
 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.
 
  -- Scheme Procedure: procedure-environment proc
  -- C Function: scm_procedure_environment (proc)
      Return the environment of the procedure PROC.
 
  -- Scheme Procedure: procedure-properties proc
  -- C Function: scm_procedure_properties (proc)
      Return OBJ's property list.
 
  -- Scheme Procedure: procedure-property obj key
  -- C Function: scm_procedure_property (obj, key)
      Return the property of OBJ with name KEY.
 
  -- Scheme Procedure: set-procedure-properties! proc alist
  -- C Function: scm_set_procedure_properties_x (proc, alist)
      Set OBJ's property list to ALIST.
 
  -- Scheme Procedure: set-procedure-property! obj key value
  -- C Function: scm_set_procedure_property_x (obj, key, value)
      In OBJ'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.
 
    Source properties are properties which are related to the source
 code of a procedure, such as the line and column numbers, the file name
 etc.
 
  -- Scheme Procedure: set-source-properties! obj plist
  -- C Function: scm_set_source_properties_x (obj, plist)
      Install the association list PLIST as the source property list for
      OBJ.
 
  -- Scheme Procedure: set-source-property! obj key datum
  -- C Function: scm_set_source_property_x (obj, key, datum)
      Set the source property of object OBJ, which is specified by KEY
      to DATUM.  Normally, the key will be a symbol.
 
  -- Scheme Procedure: source-properties obj
  -- C Function: scm_source_properties (obj)
      Return the source property association list of OBJ.
 
  -- Scheme Procedure: source-property obj key
  -- C Function: scm_source_property (obj, key)
      Return the source property specified by KEY from OBJ's source
      property list.
 
Info Catalog (guile.info.gz) Optional Arguments (guile.info.gz) Procedures and Macros (guile.info.gz) Procedures with Setters
automatically generated byinfo2html