1168 |
@code{SCM} value is done using the @code{PTR2SCM} macro. |
@code{SCM} value is done using the @code{PTR2SCM} macro. |
1169 |
|
|
1170 |
@c (FIXME:: this name should be changed) |
@c (FIXME:: this name should be changed) |
1171 |
@deftypefn Macro (scm_cell *) SCM2PTR (SCM @var{x}) |
@deftypefn Macro (scm_t_cell *) SCM2PTR (SCM @var{x}) |
1172 |
Extract and return the heap cell pointer from a non-immediate @code{SCM} |
Extract and return the heap cell pointer from a non-immediate @code{SCM} |
1173 |
object @var{x}. |
object @var{x}. |
1174 |
@end deftypefn |
@end deftypefn |
1175 |
|
|
1176 |
@c (FIXME:: this name should be changed) |
@c (FIXME:: this name should be changed) |
1177 |
@deftypefn Macro SCM PTR2SCM (scm_cell * @var{x}) |
@deftypefn Macro SCM PTR2SCM (scm_t_cell * @var{x}) |
1178 |
Return a @code{SCM} value that encodes a reference to the heap cell |
Return a @code{SCM} value that encodes a reference to the heap cell |
1179 |
pointer @var{x}. |
pointer @var{x}. |
1180 |
@end deftypefn |
@end deftypefn |
1182 |
Note that it is also possible to transform a non-immediate @code{SCM} |
Note that it is also possible to transform a non-immediate @code{SCM} |
1183 |
value by using @code{SCM_UNPACK} into a @code{scm_bits_t} variable. |
value by using @code{SCM_UNPACK} into a @code{scm_bits_t} variable. |
1184 |
However, the result of @code{SCM_UNPACK} may not be used as a pointer to |
However, the result of @code{SCM_UNPACK} may not be used as a pointer to |
1185 |
a @code{scm_cell}: only @code{SCM2PTR} is guaranteed to transform a |
a @code{scm_t_cell}: only @code{SCM2PTR} is guaranteed to transform a |
1186 |
@code{SCM} object into a valid pointer to a heap cell. Also, it is not |
@code{SCM} object into a valid pointer to a heap cell. Also, it is not |
1187 |
allowed to apply @code{PTR2SCM} to anything that is not a valid pointer |
allowed to apply @code{PTR2SCM} to anything that is not a valid pointer |
1188 |
to a heap cell. |
to a heap cell. |
1194 |
Only use @code{SCM2PTR} on @code{SCM} values for which @code{SCM_IMP} is |
Only use @code{SCM2PTR} on @code{SCM} values for which @code{SCM_IMP} is |
1195 |
false! |
false! |
1196 |
@item |
@item |
1197 |
Don't use @code{(scm_cell *) SCM_UNPACK (@var{x})}! Use @code{SCM2PTR |
Don't use @code{(scm_t_cell *) SCM_UNPACK (@var{x})}! Use @code{SCM2PTR |
1198 |
(@var{x})} instead! |
(@var{x})} instead! |
1199 |
@item |
@item |
1200 |
Don't use @code{PTR2SCM} for anything but a cell pointer! |
Don't use @code{PTR2SCM} for anything but a cell pointer! |