DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

(guile.info.gz) Vector Data

Info Catalog (guile.info.gz) Pair Data (guile.info.gz) Non-immediate Datatypes (guile.info.gz) Procedures
 
 18.2.5.2 Vectors, Strings, and Symbols
 ......................................
 
 Vectors, strings, and symbols have some properties in common.  They all
 have a length, and they all have an array of elements.  In the case of a
 vector, the elements are `SCM' values; in the case of a string or
 symbol, the elements are characters.
 
    All these types store their length (along with some tagging bits) in
 the CAR of their header cell, and store a pointer to the elements in
 their CDR.  Thus, the `SCM_CAR' and `SCM_CDR' macros are (somewhat)
 meaningful when applied to these datatypes.
 
  -- Macro: int SCM_VECTORP (SCM X)
      Return non-zero iff X is a vector.
 
  -- Macro: int SCM_STRINGP (SCM X)
      Return non-zero iff X is a string.
 
  -- Macro: int SCM_SYMBOLP (SCM X)
      Return non-zero iff X is a symbol.
 
  -- Macro: int SCM_VECTOR_LENGTH (SCM X)
  -- Macro: int SCM_STRING_LENGTH (SCM X)
  -- Macro: int SCM_SYMBOL_LENGTH (SCM X)
      Return the length of the object X.  The result is undefined if X
      is not a vector, string, or symbol, respectively.
 
  -- Macro: SCM * SCM_VECTOR_BASE (SCM X)
      Return a pointer to the array of elements of the vector X.  The
      result is undefined if X is not a vector.
 
  -- Macro: char * SCM_STRING_CHARS (SCM X)
  -- Macro: char * SCM_SYMBOL_CHARS (SCM X)
      Return a pointer to the characters of X.  The result is undefined
      if X is not a symbol or string, respectively.
 
    There are also a few magic values stuffed into memory before a
 symbol's characters, but you don't want to know about those.  What
 cruft!
 
Info Catalog (guile.info.gz) Pair Data (guile.info.gz) Non-immediate Datatypes (guile.info.gz) Procedures
automatically generated byinfo2html