980 |
@var{x} is not a subr. |
@var{x} is not a subr. |
981 |
@end deftypefn |
@end deftypefn |
982 |
|
|
983 |
@deftypefun SCM scm_make_gsubr (char *@var{name}, int @var{req}, int @var{opt}, int @var{rest}, SCM (*@var{function})()) |
@c This used to be scm_make_gsubr which is now deprecated. |
984 |
|
@deftypefun SCM scm_c_define_gsubr (char *@var{name}, int @var{req}, int @var{opt}, int @var{rest}, SCM (*@var{function})()) |
985 |
Create a new subr object named @var{name}, based on the C function |
Create a new subr object named @var{name}, based on the C function |
986 |
@var{function}, make it visible to Scheme the value of as a global |
@var{function}, make it visible to Scheme the value of as a global |
987 |
variable named @var{name}, and return the subr object. |
variable named @var{name}, and return the subr object. |
1006 |
subr can take one required argument, or one required and one optional |
subr can take one required argument, or one required and one optional |
1007 |
argument, but a subr can't take one required and two optional arguments. |
argument, but a subr can't take one required and two optional arguments. |
1008 |
It's bizarre, but that's the way the interpreter was written. If the |
It's bizarre, but that's the way the interpreter was written. If the |
1009 |
arguments to @code{scm_make_gsubr} do not fit one of the predefined |
arguments to @code{scm_c_define_gsubr} do not fit one of the predefined |
1010 |
patterns, then @code{scm_make_gsubr} will return a compiled closure |
patterns, then @code{scm_c_define_gsubr} will return a compiled closure |
1011 |
object instead of a subr object. |
object instead of a subr object. |
1012 |
@end deftypefun |
@end deftypefun |
1013 |
|
|
1068 |
|
|
1069 |
In fact, there are two basic C data types to represent objects in Guile: |
In fact, there are two basic C data types to represent objects in Guile: |
1070 |
|
|
1071 |
@itemize @bullet |
@deftp {Data type} SCM |
|
@item |
|
1072 |
@code{SCM} is the user level abstract C type that is used to represent |
@code{SCM} is the user level abstract C type that is used to represent |
1073 |
all of Guile's Scheme objects, no matter what the Scheme object type is. |
all of Guile's Scheme objects, no matter what the Scheme object type is. |
1074 |
No C operation except assignment is guaranteed to work with variables of |
No C operation except assignment is guaranteed to work with variables of |
1075 |
type @code{SCM}, so you should only use macros and functions to work |
type @code{SCM}, so you should only use macros and functions to work |
1076 |
with @code{SCM} values. Values are converted between C data types and |
with @code{SCM} values. Values are converted between C data types and |
1077 |
the @code{SCM} type with utility functions and macros. |
the @code{SCM} type with utility functions and macros. |
1078 |
|
@end deftp |
1079 |
|
@cindex SCM data type |
1080 |
|
|
1081 |
@item |
@deftp {Data type} scm_t_bits |
1082 |
@code{scm_t_bits} is an integral data type that is guaranteed to be |
@code{scm_t_bits} is an integral data type that is guaranteed to be |
1083 |
large enough to hold all information that is required to represent any |
large enough to hold all information that is required to represent any |
1084 |
Scheme object. While this data type is mostly used to implement Guile's |
Scheme object. While this data type is mostly used to implement Guile's |
1085 |
internals, the use of this type is also necessary to write certain kinds |
internals, the use of this type is also necessary to write certain kinds |
1086 |
of extensions to Guile. |
of extensions to Guile. |
1087 |
@end itemize |
@end deftp |
1088 |
|
|
1089 |
@menu |
@menu |
1090 |
* Relationship between SCM and scm_t_bits:: |
* Relationship between SCM and scm_t_bits:: |