www.delorie.com/gnu/docs/guile/data-rep_24.html   search  
 
Buy GNU books!


Untitled Document

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

1.2.7 Unpacking the SCM Type

The previous sections have explained how SCM values can refer to immediate and non-immediate Scheme objects. For immediate objects, the complete object value is stored in the SCM word itself, while for non-immediates, the SCM word contains a pointer to a heap cell, and further information about the object in question is stored in that cell. This section describes how the SCM type is actually represented and used at the C level.

In fact, there are two basic C data types to represent objects in Guile:

Data type: SCM
SCM is the user level abstract C type that is used to represent all of Guile's Scheme objects, no matter what the Scheme object type is. No C operation except assignment is guaranteed to work with variables of type SCM, so you should only use macros and functions to work with SCM values. Values are converted between C data types and the SCM type with utility functions and macros.

Data type: scm_t_bits
scm_t_bits is an integral data type that is guaranteed to be large enough to hold all information that is required to represent any Scheme object. While this data type is mostly used to implement Guile's internals, the use of this type is also necessary to write certain kinds of extensions to Guile.

1.2.7.1 Relationship between SCM and scm_t_bits  
1.2.7.2 Immediate objects  
1.2.7.3 Non-immediate objects  
1.2.7.4 Heap Cell Type Information  
1.2.7.5 Accessing Cell Entries  
1.2.7.6 Basic Rules for Accessing Cell Entries  


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

  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003