The idea is to introduce `gsubrs' whose arity is encoded in their type
(more precisely in the sizeof (void *) - 8 MSBs). This removes the
indirection introduced by cclos and simplifies the code.
* libguile/__scm.h (CCLO): Remove.
* libguile/debug.c (scm_procedure_source, scm_procedure_environment):
Remove references to `scm_tc7_cclo'.
* libguile/eval.c (scm_trampoline_0, scm_trampoline_1,
scm_trampoline_2): Replace `scm_tc7_cclo' with `scm_tc7_gsubr'.
* libguile/eval.i.c (CEVAL): Likewise. No longer make PROC the first
argument. Directly invoke `scm_gsubr_apply ()' instead of jump to the
`evap(N+1)' label or call to `SCM_APPLY ()'.
* libguile/evalext.c (scm_self_evaluating_p): Remove reference to
`scm_tc7_cclo'.
* libguile/gc-card.c (scm_i_sweep_card, scm_i_tag_name): Likewise.
* libguile/gc-mark.c (scm_gc_mark_dependencies): Likewise.
* libguile/goops.c (scm_class_of): Likewise.
* libguile/print.c (iprin1): Likewise.
* libguile/gsubr.c (create_gsubr): Use `unsigned int's for REQ, OPT and
RST. Use `scm_tc7_gsubr' instead of `scm_makcclo ()' in the default
case.
(scm_gsubr_apply): Remove calls to `SCM_GSUBR_PROC ()'.
(scm_f_gsubr_apply): Remove.
* libguile/gsubr.h (SCM_GSUBR_TYPE): New definition.
(SCM_GSUBR_MAX): Changed to 33.
(SCM_SET_GSUBR_TYPE, SCM_GSUBR_PROC, SCM_SET_GSUBR_PROC,
scm_f_gsubr_apply): Remove.
* libguile/procprop.c (scm_i_procedure_arity): Remove reference to
`scm_tc7_cclo'; add proper handling of `scm_tc7_gsubr'.
* libguile/procs.c (scm_makcclo, scm_make_cclo): Remove.
(scm_procedure_p): Remove reference to `scm_tc7_cclo'.
(scm_thunk_p): Likewise, plus add proper `scm_tc7_gsubr' handling.
* libguile/procs.h (SCM_CCLO_LENGTH, SCM_MAKE_CCLO_TAG,
SCM_SET_CCLO_LENGTH, SCM_CCLO_BASE, SCM_SET_CCLO_BASE, SCM_CCLO_REF,
SCM_CCLO_SET, SCM_CCLO_SUBR, SCM_SET_CCLO_SUBR, scm_makcclo,
scm_make_cclo): Remove.
* libguile/stacks.c (read_frames): Remove reference to `scm_f_gsubr_apply'.
* libguile/tags.h (scm_tc7_cclo): Remove.
(scm_tc7_gsubr): New.
(scm_tcs_subrs): Add `scm_tc7_gsubr'.
SCM_INUM): Deprecated by reenaming them to SCM_I_INUMP, SCM_I_NINUMP
and SCM_I_INUM, respectively and adding deprecated versions to
deprecated.h and deprecated.c. Changed all uses to either use the
SCM_I_ variants or scm_is_*, scm_to_*, or scm_from_*, as appropriate.
SCM_NEGATE_BOOL, SCM_BOOLP): Deprecated by moving into "deprecated.h".
Replaced all uses with scm_is_false, scm_is_true, scm_from_bool, and
scm_is_bool, respectively.
of functions (car, cdr etc.) from the dsubr family of functions
(i. e. functions that take a double precision floating point
argument). Further, the algorithm for handling the cxr function
is improved.
* eval.c (SCM_CEVAL, SCM_APPLY, scm_trampoline_1), numbers.c
(scm_asinh, scm_acosh, scm_atanh, scm_truncate, scm_round, floor,
ceil, sqrt, fabs, exp, log, sin, cos, tan, asin, acos, atan, sinh,
cosh, tanh), objects.c (scm_class_of), procprop.c
(scm_i_procedure_arity), ramap.c (scm_array_map_x), tags.h
(scm_tc7_dsubr, scm_tcs_subrs): Introduce scm_tc7_dsubr as new
typecode for the dsubr family of functions.
* ramap.c (ramap_cxr, ramap_dsubr): Renamed ramap_cxr to
ramap_dsubr.
* eval.c (SCM_CEVAL, SCM_APPLY, call_cxr_1), pairs.c
(scm_init_pairs): Make use of the (now usable) second cell element
of a scm_tc7_cxr function to implement the cxr family of functions
more efficiently.
with the versions in this module using
scm_c_extend_primitive_generic.
* goops.scm (equal?): Define default method.
* goops.c (scm_primitive_generic_generic): Enable primitive
generic if not enabled.
(scm_sys_goops_loaded): Setup unextended primitive generics.
* goops.c, goops.h (scm_c_extend_primitive_generic): New function.
* snarf.h (SCM_PRIMITIVE_GENERIC, SCM_PRIMITIVE_GENERIC_1): New
snarf macros.
* numbers.c (scm_abs): Use SCM_PRIMITIVE_GENERIC. (This is only a
testing example. All uses of SCM_GPROC should be converted.)
* procprop.c (scm_stand_in_scm_proc): Use scm_assq instead of
scm_assoc.
* eq.c (scm_equal_p): Turned into a primitive generic.
* *.c: add space after commas everywhere.
* *.c: use SCM_VECTOR_SET everywhere, where a vector is written.
Document cases where SCM_WRITABLE_VELTS() is used.
* vectors.h (SCM_VELTS): prepare for write barrier, and let
SCM_VELTS() return a const pointer
(SCM_VECTOR_SET): add macro.
* autogen.sh (mscripts): find and check version number of
autoconf. Complain if 2.53 is not found.
(scm_tc3_cons_gloc): Renamed to scm_tc3_struct. Changed all uses.
(scm_tcs_cons_gloc): Renamed to scm_tcs_struct. Changed all uses.
(SCM_ECONSP, SCM_NECONSP): Removed. Changed all uses to SCM_CONSP
or SCM_NCONSP, respectively.
* struct.c, struct.h, srcprop.c, procs.c, procprop.c, print.c,
objects.c. modules.c, goops.c, eval.c, debug.c: Changed all uses
of scm_tc3_cond_gloc and scm_tcs_cons_gloc. See above.
* print.c (scm_iprin1): Remove printing of glocs. Do not try to
tell glocs from structs.
* gc.c (scm_gc_mark, scm_gc_sweep): Remove handling of glocs.
* eval.c (scm_m_atbind): Make a list of variables, not glocs.
(scm_ceval, scm_deval): For SCM_IM_BIND, fiddle with variables
instead of with glocs.
(EVALCAR): Do not test for glocs.
(scm_lookupcar, scm_lookupcar1): Do not handle glocs in race
condition.
(scm_unmemocar): Do not handle glocs.
(scm_m_atfop): Memoize as a variable, not as a gloc.
(scm_eval_args, scm_deval_args): Do not handle glocs.
(scm_ceval, scm_deval): Likewise.
* eval.h (SCM_XEVALCAR): Do not test for glocs.
(SCM_GLOC_VAR, SCM_GLOC_VAL, SCM_GLOC_SET_VAL, SCM_GLOC_VAL_LOC):
Removed.
* debug.h, debug.c (scm_make_gloc, scm_gloc_p): Removed.
* dynwind.c (scm_swap_bindings): Likewise.
(scm_dowinds): Updated to recognize lists of variables instead of
lists of glocs.
* __scm.h (SCM_CAUTIOS, SCM_RECKLESS): Update comments.
custom tc7 type. This will make it easier to support R5RS
multiple value continuations, without the use of a Scheme-level
wrapper.
* continuations.c (scm_tc16_continuation, continuation_mark,
continuation_free, continuation_print, continuation_apply):
new SMOB support.
(scm_make_continuation): new procedure, replaces scm_make_cont
with a different interface.
(copy_stack_and_call, scm_dynthrow, scm_init_continuations): rewritten.
(CHEAP_CONTINUATIONS): removed non-working code completely.
(scm_call_continuation): removed.
* continuations.h (struct scm_contregs): add num_stack_items and
stack fields. previously stack was stored following this struct:
use a tail array instead.
(SCM_CONTINUATIONP): new macro.
(SCM_CONTINUATION_LENGTH, SCM_SET_CONTINUATION_LENGTH):
rewritten.
(SCM_SET_CONTREGS): removed.
* tags.h: removed scm_tc7_contin (was tag 61).
* debug.c, gc.c, hash.c, print.c, procprop.c, procs.c:
removed scm_tc7_contin support.
* eval.c: use scm_make_continuation instead of scm_make_cont.
don't set jump buffers here. remove scm_tc7_contin support.
* init.c, root.c: create SMOB continuation for rootcont instead
of scm_tc7_contin. call scm_init_continuations before
scm_init_root.
* root.c: remove support for static jmpbuf. It's not used by
default and I broke it. create SMOB continuation for rootcont.
* stacks.c: use SCM_CONTINUATIONP.
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.)
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).
* 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.
handle operators and entities.
(scm_procedure_property): No need to call scm_procedure_p since
scm_i_procedure_arity now does all necessary type checking.
Added #include "objects.h".
of procedure.
(scm_procedure_properties): Modified to return arity together with
other properties.
(scm_procedure_property): Added the read-only property `arity'.
(scm_set_procedure_property_x): It is an error to set the `arity'
property.