elisp @@ macro
[bpt/guile.git] / doc / ref / api-scm.texi
CommitLineData
07d83abe
MV
1@c -*-texinfo-*-
2@c This is part of the GNU Guile Reference Manual.
3@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004
4@c Free Software Foundation, Inc.
5@c See the file guile.texi for copying conditions.
6
7
8@node The SCM Type
9@section The SCM Type
10
11Guile represents all Scheme values with the single C type @code{SCM}.
12For an introduction to this topic, @xref{Dynamic Types}.
13
14@deftp {C Type} SCM
15@code{SCM} is the user level abstract C type that is used to represent
16all of Guile's Scheme objects, no matter what the Scheme object type is.
17No C operation except assignment is guaranteed to work with variables of
18type @code{SCM}, so you should only use macros and functions to work
19with @code{SCM} values. Values are converted between C data types and
20the @code{SCM} type with utility functions and macros.
21@end deftp
22@cindex SCM data type
23
24@deftp {C Type} scm_t_bits
25@code{scm_t_bits} is an unsigned integral data type that is guaranteed
26to be large enough to hold all information that is required to
27represent any Scheme object. While this data type is mostly used to
28implement Guile's internals, the use of this type is also necessary to
29write certain kinds of extensions to Guile.
30@end deftp
31
32@deftp {C Type} scm_t_signed_bits
33This is a signed integral type of the same size as @code{scm_t_bits}.
34@end deftp
35
36@deftypefn {C Macro} scm_t_bits SCM_UNPACK (SCM @var{x})
37Transforms the @code{SCM} value @var{x} into its representation as an
38integral type. Only after applying @code{SCM_UNPACK} it is possible to
39access the bits and contents of the @code{SCM} value.
40@end deftypefn
41
42@deftypefn {C Macro} SCM SCM_PACK (scm_t_bits @var{x})
43Takes a valid integral representation of a Scheme object and transforms
44it into its representation as a @code{SCM} value.
45@end deftypefn