handles are now double cells; Initialize SCM_STRUCT_GC_CHAIN to
0.
(scm_struct_gc_init, scm_free_structs): New GC C hooks.
(scm_struct_prehistory): Install them.
and we don't want that.
(INCLUDES): Removed all -I options except for the root source
directory and the root build directory.
* *.*: Change includes so that they always use the "prefixes"
libguile/, qt/, guile-readline/, or libltdl/.
(Thanks to Tim Mooney.)
name for a Scheme object (now a void*), and SCM as 32 bit word for
storing tags and immediates (now a long int). Introduced
SCM_ASWORD and SCM_ASSCM for conversion. Fixed various dubious
code in the process: arbiter.c (use macros), unif.c (scm_array_p),
displaying the expected type. Use SCM_LISTn in a couple places
instead of scm_cons-ing by hand.
* __scm.h: Added SCM_ASSERT_TYPE macro.
* validate.h, scm_validate.h: Added the former, as a renamed
version of the latter with SCM_ASSERT_TYPE used in
SCM_MAKE_VALIDATE (instead of just SCM_ASSERT)
* Makefile.am: Rename scm_validate.h to validate.h.
* *.c, *.h: Include validate.h, not scm_validate.h (old name's
prefix was superfluous).
added append docs from R4RS.
* strings.c: Docstring typo fix, + eliminate unneeded IMP tests.
Thanks Dirk Hermann!
* chars.h: Provide SCM_CHARP, SCM_CHAR, SCM_MAKE_CHAR and
deprecate SCM_ICHRP, SCM_ICHR, SCM_MAKICHR. Thanks Dirk Hermann!
* *.h, *.c: Use SCM_CHARP, SCM_CHAR, SCM_MAKE_CHAR throughout.
Drop use of SCM_P for function prototypes... assume an ANSI C
compiler. Thanks Dirk Hermann!
print warnings in an Emacs compile-mode parseable format.
* struct.c: Use SCM_ASSERT_RANGE instead of SCM_ASSERT w/
SCM_OUTOFRANGE as 3rd argument.
* random.c: Fix argument/number mismatch (that I introduced :-( ).
* __scm.h: Do not #define SCM_ARG* when snarfing;
lets us distinguish between 1 and SCM_ARG1 when snarfing as only
the former (using the number) requires the argument to match the
formal in the current argument snarfing check.
* ramap.c: Remove extraneous #undef FUNC_NAME.
* scm_validate.h: Added SCM_VALIDATE_THREAD.
* *.c: Remove SCM_NIMP(X) when it is an extraneous pre-test given
that SCM_FOOP macros all now include SCM_NIMP in their expansion.
This simplifies lots of code, making it far more readable.
GUILE_PROC1. Build guile-procedures.txt, and add that file to
pkgdata_DATA.
* load.c: Added `pkgdata-dir', `site-dir', `library-dir'
primitives.
* guile-doc-snarf.awk: Drop trailing space when no arguments:
e.g., "(foo )" is now "(foo)".
* *.c: moved all the documentation for primitives from
guile-doc/ref/{appendices,posix,scheme}.texi into the source code.
This leaves about half of the primitives undocumented. Also, all
the markup is currently still texinfo. I don't have a problem
with texinfo per se, but the markup is not very descriptive or
accurate.
function headers and argument checking. Switched SCM_PROC,
SCM_PROC1 macros to be GUILE_PROC, GUILE_PROC1 (may change names
later, but was useful to keep old versions around while migrate)
that has docstrings and argument lists embedded in the GUILE_PROC
macro invocations that expand into a function header. Use lots of
new SCM_VALIDATE_* macros to simplify error checking and reduce
tons of redundancy. This is very similar to what I did for Scwm.
Note that none of the extraction of the docstrings, nor software
engineering checks of Scwm is yet added to Guile. I'll work on
that tomorrow, I expect.
* Makefile.am: Added scm_validate.h to modinclude_HEADERS.
* chars.c: Added docstrings for the primitives defined in here.
* snarf.h: Added GUILE_PROC, GUILE_PROC1. Added
SCM_REGISTER_PROC to be like old SCM_PROC, though old SCM_PROC
still remains for now. Changed naming convention for the s_foo
string name of the primitive to be s_scm_foo for ease of use with
the macro.
* scm_validate.h: Lots of new SCM_VALIDATE macros to simplify
argument checking through guile. Maybe some of these should be
folded into the header file for the types they check, but for now
it was easiest to just stick them all in one place.
(scm_struct_i_free): New hidden struct slot. Holds destructor for
instances to this vtable.
(scm_struct_free_0): New destructor: Doesn't deallocate data.
(scm_struct_free_light): New destructor: Deallocates a light
struct (i.e. a struct without hidden slots).
(scm_struct_free_standard): New destructor: Deallocates standard
structs.
(scm_struct_free_entity): New destructor: Deallocates entity
structs.
(SCM_SET_VTABLE_DESTRUCTOR): New macro.
Changes to hidden slots:
(scm_struct_i_size): scm_struct_i_flags now shares space with
scm_struct_i_size which holds the size of light structs.
(scm_struct_i_n_words): This slot has changed meaning. Previously
it included hidden slots. Now it indicates visible slots.
(scm_alloc_struct): Clear flags.
(SCM_STRUCTF_MASK): 4 new flag positions added => 12 bits.
(struct_num, scm_struct_i_tag): Removed.
(scm_struct_vtable_tag): Base tag on the pointer to mallocated
memory.
(scm_struct_ihashq): Base hash value on pointer to struct handle.
(scm_struct_table): Weak key table with auxilliary information for
struct types. Currently used for names and wrapper classes.
(scm_struct_ihashq): Hash function for structs.
(scm_struct_create_handle): Get/create entry in scm_struct_table.
(scm_struct_vtable_name, scm_set_struct_vtable_name_x): Procedures
for accessing names of vtables. The record implementation in
boot-9.scm currently uses the setter to record the name of record
types. When the object system is initialized, it can use this
information to create wrapper classes with suitable names.
(scm_init_struct): Allocate scm_struct_table.
(scm_alloc_struct): Don't initialize scm_struct_i_tag here.
(struct tags are a finite resource and we might want to restrict
the use of tags to vtables only. E.g., Goops only uses tags for
classes.)
(scm_make_struct): Use scm_struct_entity_n_extra_words instead of
magic number 5.
(scm_struct_vtable_tag): Use scm_struct_i_tag instead of magic
number -1.
procedures if SCM_STRUCTF_ENTITY is set in vtable.
* struct.c, struct.h (scm_alloc_struct): Renamed from alloc_struct
and made global.
(scm_struct_init): Renamed from init_struct and made global.