* libguile/debug.h:
* libguile/debug.c (scm_procedure_module): New procedure, returns the
module that was current when the given procedure was defined. Used by
syncase to scope free identifiers.
* module/ice-9/psyntax-pp.scm: Recompiled.
* module/ice-9/psyntax.scm: Thread the module through the syntax
expansion. This is harder than it would appear because in many places
the different components of syntax objects are destructured.
* module/ice-9/syncase.scm (guile-macro): Adapt to new signature for
syntax transformer functions.
* libguile/debug.c (init_stack_limit): Initialize the stack limit based
on operating system limits (via getrlimit(2)), or 1 MB -- whichever is
smaller.
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'.
* module/system/vm/program.scm:
* libguile/programs.h:
* libguile/programs.c (scm_program_bindings, scm_program_bindings)
(scm_program_properties, scm_program_name): Unfortunately, implement
more procs in C, so that C can use them more easily.
* libguile/debug.c (scm_procedure_name): Dispatch to scm_program_name as
appropriate.
* libguile/vm-i-system.c (call): Tick in a call.
* ice-9/boot-9.scm (start-stack): Define as a defmacro instead of an acro
in C. We have a way to delay evaluation of the exp, after all: putting
it in a thunk is sufficient.
* libguile/debug.h:
* libguile/debug.c (scm_sys_start_stack): Renamed from scm_start_stack,
and exposed to the user. Takes a thunk instead of an expression +
environment.
(scm_m_start_stack): Remove this acro.
* module/language/scheme/translate.scm (custom-transformer-table): Remove
the start-stack special case.
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.
scm_i_unmemoize_expr for unmemoizing a memoized object holding a
single memoized expression.
* debug.c (memoized_print): Don't try to unmemoize the memoized
object, since we can't know whether it holds a single expression
or a body.
(scm_mem_to_proc): Removed check for lambda expression, since it
was moot anyway. Whoever uses these functions for debugging
purposes should know what they do: Creating invalid memoized code
will cause crashes, independent of whether this check is present
or not.
(scm_proc_to_mem): Take the closure's code as it is and don't
append a SCM_IM_LAMBDA isym. To allow easier debugging, the
memoized code should not be modified.
* debug.[ch] (scm_unmemoize, scm_i_unmemoize_expr): Removed
scm_unmemoize from public use, but made scm_i_unmemoize_expr
available as a guile internal function instead. However,
scm_i_unmemoize_expr will only work on memoized objects that hold
a single memoized expression. It won't work with bodies.
* debug.c (scm_procedure_source), macros.c (macro_print), print.c
(scm_iprin1): Call scm_i_unmemocopy_body for unmemoizing a body,
i. e. a list of expressions.
* eval.c (unmemoize_exprs): Drop internal body markers from the
output during unmemoization.
* eval.[ch] (scm_unmemocopy, scm_i_unmemocopy_expr,
scm_i_unmemocopy_body): Removed scm_unmemocopy from public use,
but made scm_i_unmemocopy_expr and scm_i_unmemocopy_body available
as guile internal functions instead. scm_i_unmemoize_expr will
only work on a single memoized expression, while
scm_i_unmemocopy_body will only work on bodies.
copy lists that are known to be finite (though not necessarily
proper).
* debug.c (scm_procedure_source): Don't have scm_unmemocopy treat
a closure's argument list like an expression of a body.
* eval.c (unmemoize_expression, unmemoize_exprs, unmemoize_and,
unmemoize_begin, unmemoize_case, unmemoize_cond, unmemoize_delay,
unmemoize_do, unmemoize_if, unmemoize_lambda, unmemoize_let,
unmemoize_letrec, unmemoize_letstar, unmemoize_or,
unmemoize_set_x, unmemoize_apply, unmemoize_atcall_cc,
unmemoize_at_call_with_values, unmemoize_future, sym_atslot_ref,
unmemoize_atslot_ref, sym_atslot_set_x, unmemoize_atslot_set_x,
unmemoize_builtin_macro): New static functions and symbols.
(scm_unmemocopy): Rewritten in terms of the above. scm_unmemocopy
now has a slightly different meaning: The memoized form that is
receives as its argument is now interpreted as a sequence of
expressions from a body.
(unmemocar, scm_unmemocar): Since the whole functionality of
unmemocar and scm_unmemocar is not needed any more, scm_unmemocar
has its old content back and is deprecated, while unmemocar has
been removed.
(SCM_BIT7): Removed.
(CEVAL): For unmemoizing a single expression, call
unmemoize_expression instead of scm_unmemocopy, which now expects
a sequence of body expressions. Eliminated unnecessary empty
environment frame when executing let* forms. Eliminated
unmemoization step from evaluator.
SCM_DEBUG_DEBUGGING_SUPPORT): Renamed macro
SCM_DEBUG_DEBUGGER_SUPPORT to SCM_DEBUG_DEBUGGING_SUPPORT and
generalized it to apply not only to C level functions but also to
scheme level functions.
* debug.c, debug.h, eval.c (make-iloc, scm_make_iloc, iloc?,
scm_iloc_p, dbg-make-iloc, scm_dbg_make_iloc, dbg-iloc?,
scm_dbg_iloc_p): Moved functions scm_make_iloc, scm_iloc_p to
eval.c, made them available under SCM_DEBUG_DEBUGGING_SUPPORT == 1
only and renamed them to scm_dbg_make_iloc, scm_dbg_iloc_p,
respectively.
* deprecated.h, eval.c, eval.h (SCM_ILOC00, SCM_IDINC,
SCM_IDSTMSK): Deprecated. The macro definitions are moved from
eval.h into eval.c and a copy is placed into deprecated.h.
* eval.c, eval.h (SCM_MAKE_ILOC): Removed from eval.h and placed
into eval.c. This definition was not part of the API in any
officially released version of guile and thus does not need to go
through a phase of deprecation.
* *.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_lookupcar, scm_lookupcar1, scm_badargsp, SCM_CEVAL,
SCM_APPLY, scm_map, scm_for_each), feature.c (scm_init_feature),
gsubr.c (scm_gsubr_apply), numbers.c (scm_logand, scm_logior,
scm_logxor, scm_i_dbl2big), srcprop.c (scm_source_properties,
scm_set_source_properties_x, scm_source_property): Removed
compile time option SCM_RECKLESS to clean up the code. Full
number of arguments checking of closures is mandatory now.
However, the option to disable the checking has most probably not
been used anyway.
* srcprop.c (scm_source_properties, scm_set_source_properties_x,
scm_source_property): Use !SCM_CONSP instead of SCM_NCONSP.
(scm_memcons, scm_mem_to_proc): When building lists, prefer
scm_list_<n> over scm_cons[2]?.
(scm_mem_to_proc): Prefer SCM_CONSP over SCM_NIMP.
(scm_procedure_name): Use SCM_CADR instead of explicit form.
(debugobj_print): Coerce scm_intprint arg 1 to long, not int.
Thanks to Rob Browning for the patch (see log entry 2001-09-21) -
for some reason his patch didn't make it into the cvs.
(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.
(SCM_NUM2{SIZE,PTRDIFF,SHORT,USHORT,BITS,UBITS,INT,UINT}[_DEF]):
new macros.
* unif.h: type renaming:
scm_array -> scm_array_t
scm_array_dim -> scm_array_dim_t
the old names are deprecated, all in-Guile uses changed.
* tags.h (scm_ubits_t): new typedef, representing unsigned
scm_bits_t.
* stacks.h: type renaming:
scm_info_frame -> scm_info_frame_t
scm_stack -> scm_stack_t
the old names are deprecated, all in-Guile uses changed.
* srcprop.h: type renaming:
scm_srcprops -> scm_srcprops_t
scm_srcprops_chunk -> scm_srcprops_chunk_t
the old names are deprecated, all in-Guile uses changed.
* gsubr.c, procs.c, print.c, ports.c, read.c, rdelim.c, ramap.c,
rw.c, smob.c, sort.c, srcprop.c, stacks.c, strings.c, strop.c,
strorder.c, strports.c, struct.c, symbols.c, unif.c, values.c,
vectors.c, vports.c, weaks.c:
various int/size_t -> size_t/scm_bits_t changes.
* random.h: type renaming:
scm_rstate -> scm_rstate_t
scm_rng -> scm_rng_t
scm_i_rstate -> scm_i_rstate_t
the old names are deprecated, all in-Guile uses changed.
* procs.h: type renaming:
scm_subr_entry -> scm_subr_entry_t
the old name is deprecated, all in-Guile uses changed.
* options.h (scm_option_t.val): unsigned long -> scm_bits_t.
type renaming:
scm_option -> scm_option_t
the old name is deprecated, all in-Guile uses changed.
* objects.c: various long -> scm_bits_t changes.
(scm_i_make_class_object): flags: unsigned long -> scm_ubits_t
* numbers.h (SCM_FIXNUM_BIT): deprecated, renamed to
SCM_I_FIXNUM_BIT.
* num2integral.i.c: new file, multiply included by numbers.c, used
to "templatize" the various integral <-> num conversion routines.
* numbers.c (scm_mkbig, scm_big2num, scm_adjbig, scm_normbig,
scm_copybig, scm_2ulong2big, scm_dbl2big, scm_big2dbl):
deprecated.
(scm_i_mkbig, scm_i_big2inum, scm_i_adjbig, scm_i_normbig,
scm_i_copybig, scm_i_short2big, scm_i_ushort2big, scm_i_int2big,
scm_i_uint2big, scm_i_long2big, scm_i_ulong2big, scm_i_bits2big,
scm_i_ubits2big, scm_i_size2big, scm_i_ptrdiff2big,
scm_i_long_long2big, scm_i_ulong_long2big, scm_i_dbl2big,
scm_i_big2dbl, scm_short2num, scm_ushort2num, scm_int2num,
scm_uint2num, scm_bits2num, scm_ubits2num, scm_size2num,
scm_ptrdiff2num, scm_num2short, scm_num2ushort, scm_num2int,
scm_num2uint, scm_num2bits, scm_num2ubits, scm_num2ptrdiff,
scm_num2size): new functions.
* modules.c (scm_module_reverse_lookup): i, n: int -> scm_bits_t.x
* load.c: change int -> size_t in various places (where the
variable is used to store a string length).
(search-path): call scm_done_free, not scm_done_malloc.
* list.c (scm_ilength): return a scm_bits_t, not long.
some other {int,long} -> scm_bits_t changes.
* hashtab.c: various [u]int -> scm_bits_t changes.
scm_ihashx_closure -> scm_ihashx_closure_t (and made a typedef).
(scm_ihashx): n: uint -> scm_bits_t
use scm_bits2num instead of scm_ulong2num.
* gsubr.c: various int -> scm_bits_t changes.
* gh_data.c (gh_scm2double): no loss of precision any more.
* gh.h (gh_str2scm): len: int -> size_t
(gh_{get,set}_substr): start: int -> scm_bits_t,
len: int -> size_t
(gh_<num>2scm): n: int -> scm_bits_t
(gh_*vector_length): return scm_[u]size_t, not unsigned long.
(gh_length): return scm_bits_t, not unsigned long.
* fports.h: type renaming:
scm_fport -> scm_fport_t
the old name is deprecated, all in-Guile uses changed.
* fports.c (fport_fill_input): count: int -> scm_bits_t
(fport_flush): init_size, remaining, count: int -> scm_bits_t
* debug.h (scm_lookup_cstr, scm_lookup_soft, scm_evstr): removed
those prototypes, as the functions they prototype don't exist.
* fports.c (default_buffer_size): int -> size_t
(scm_fport_buffer_add): read_size, write_size: int -> scm_bits_t
default_size: int -> size_t
(scm_setvbuf): csize: int -> scm_bits_t
* fluids.c (n_fluids): int -> scm_bits_t
(grow_fluids): old_length, i: int -> scm_bits_t
(next_fluid_num, scm_fluid_ref, scm_fluid_set_x): n: int ->
scm_bits_t
(scm_c_with_fluids): flen, vlen: int -> scm_bits_t
* filesys.c (s_scm_open_fdes): changed calls to SCM_NUM2LONG to
the new and shiny SCM_NUM2INT.
* extensions.c: extension -> extension_t (and made a typedef).
* eval.h (SCM_IFRAME): cast to scm_bits_t, not int. just so
there are no nasty surprises if/when the various deeply magic tag
bits move somewhere else.
* eval.c: changed the locals used to store results of SCM_IFRAME,
scm_ilength and such to be of type scm_bits_t (and not int/long).
(iqq): depth, edepth: int -> scm_bits_t
(scm_eval_stack): int -> scm_bits_t
(SCM_CEVAL): various vars are not scm_bits_t instead of int.
(check_map_args, scm_map, scm_for_each): len: long -> scm_bits_t
i: int -> scm_bits_t
* environments.c: changed the many calls to scm_ulong2num to
scm_ubits2num.
(import_environment_fold): proc_as_ul: ulong -> scm_ubits_t
* dynwind.c (scm_dowinds): delta: long -> scm_bits_t
* debug.h: type renaming:
scm_debug_info -> scm_debug_info_t
scm_debug_frame -> scm_debug_frame_t
the old names are deprecated, all in-Guile uses changed.
(scm_debug_eframe_size): int -> scm_bits_t
* debug.c (scm_init_debug): use scm_c_define instead of the
deprecated scm_define.
* continuations.h: type renaming:
scm_contregs -> scm_contregs_t
the old name is deprecated, all in-Guile uses changed.
(scm_contregs_t.num_stack_items): size_t -> scm_bits_t
(scm_contregs_t.num_stack_items): ulong -> scm_ubits_t
* continuations.c (scm_make_continuation): change the type of
stack_size form long to scm_bits_t.
* ports.h: type renaming:
scm_port_rw_active -> scm_port_rw_active_t (and made a typedef)
scm_port -> scm_port_t
scm_ptob_descriptor -> scm_ptob_descriptor_t
the old names are deprecated, all in-Guile uses changed.
(scm_port_t.entry): int -> scm_bits_t.
(scm_port_t.line_number): int -> long.
(scm_port_t.putback_buf_size): int -> size_t.
* __scm.h (long_long, ulong_long): deprecated (they pollute the
global namespace and have little value besides that).
(SCM_BITS_LENGTH): new, is the bit size of scm_bits_t (i.e. of an
SCM handle).
(ifdef spaghetti): include sys/types.h and sys/stdtypes.h, if they
exist (for size_t & ptrdiff_t)
(scm_sizet): deprecated.
* Makefile.am (noinst_HEADERS): add num2integral.i.c