Libguile should not be exporting random little strings.
* numbers.h (s_bignum): Extern declaration removed.
More const changes from Ken Raeburn.
* numbers.c (scm_s_bignum, fx): Now const.
(scm_logtab, scm_ilentab, s_adjbig): Now static and const.
* numbers.h (scm_s_bignum): Update declaration.
* eval.c (bodycheck): Argument WHAT now points to const.
* snarf.h (SCM_SYNTAX): Name is const.
* eval.c (scm_i_let): Make this globally visible, to avoid dynamic
linking crashes on NetBSD. (Thanks to Ken Raeburn.)
* eval.c, eval.h (scm_top_level_lookup_closure): New function:
Extract the lookup closure from an environment.
(scm_system_module_env_p): New function: Return non-#f if MODULE
is a system module.
* eval.c, procs.c, procs.h, procprop.c: Renamed getter ->
procedure throughout.
procedure throughout.
* eval.c, print.c (scm_iprin1): Added entries for scm_tc7_pws.
* eval.c, debug.c, tags.h (SCM_IM_SET_X): Renamed from SCM_IM_SET.
* eval.c: Renamed "set" --> "set_x" in various names for
consistency of name correspondence between Scheme and C;
Renamed scm_i_set_x --> scm_sym_set_x and made global.
Renamed s_set_x --> scm_s_set_x and made global.
* eval.c (SCM_CEVAL): Added ENTER_APPLY in code for SCM_IM_APPLY.
(Thanks to Eric Hanchrow.)
syntactic forms, similar to SCM_PROC.
* debug.c, eval.c, evalext.c: use SCM_SYNTAX to declare all special
forms, and SCM_SYMBOL or SCM_GLOBAL_SYMBOL to delcare C variables for
the name symbols when needed.
Previously, structs implanted in code were interpreted as forms
the operator of which was a gloc. We solve this by checking for
the zero in the emulated vcell in the struct vtable. Since
implanted structs always will look like forms with a gloc
operator, execution will only be slowed down by maximally one
extra test-and-branch per application.
that we can identify these in a backtrace. (This change doesn't
introduce any significant speed penalty.)
* eval.c: Added note about `serial-map' using scm_map.
scm_s_bindings, scm_s_variable, scm_s_clauses, scm_s_formals):
Renamed and made global.
* eval.c, eval.h (SCM_EVALIM): Renamed from EVALIM.
(SCM_XEVAL, SCM_XEVALCAR): Renamed from XEVAL, XEVALCAR.
* evalext.c (serial-map): New procedure: Version of `map' which
guarantees that the procedure is applied to the lists in serial
order.
(sequence->list): New syntax: Version of `begin' which returns a
list of the results of the body forms instead of the result of the
last body form.
(scm_definedp, scm_m_undefine): Moved from eval.c
* macros.c, macros.h: New files.
(procedure->syntax, procedure->macro, procedure->memoizing-macro,
macro?, macro-type, macro-name, macro-transformer): Moved from
eval.c
(scm_make_synt): Moved from eval.c
* procs.c, procs.h (procedure-documentation): Moved from eval.c.
options.c): Rename RECKLESS -> SCM_RECKLESS, CAUTIOUS ->
SCM_CAUTIOUS; this way, 1) there's only one version of each flag
to define (we used to have both RECKLESS and SCM_RECKLESS), and 2)
if we want to use them in a header file some day, we can. (Thanks
to Michael Livshin.)
scm_copy_tree on code in order not to let memoized code to leak
out. Thus, scm_copy_tree needs to copy vectors as well since
quasiquote can introduce evaluated code also inside vector
constants.
change makes the evaluator safer at the cost of evaluation speed.
It handles the case when the user has added a non-immediate
improper end of the application form, e.g., `(+ 0 . x)'.
(Earlier only cases like `(+ 0 . 0)' were handled.) I've tried to
minimize the extra cost as much as possible. The new code is
enclosed in #ifdef CAUTIOUS regions. NOTE: This also fixes the
problem with structs planted directly in the code (e.g. by a
macro). This no longer causes segmentation fault. (Thanks to
Eric Hanchrow.)
* eval.c, eval.h (scm_eval_args, scm_deval_args): Take one extra
arg `proc' in order to be able to throw errors; New argument
checking code.
scm_make_debugobj), eval.c (scm_makprom): SCM_DEFER/ALLOW_INTS -->
A section.
* __scm.h: Start the long-term project of moving to POSIX threads.
Phase 1: Classification of all critical sections.
(SCM_ENTER_A_SECTION, SCM_EXIT_A_SECTION): New macros: Delimiters
for A sections. (See comments in __scm.h for details.)
procedure apply: Copy argument lists before pushing them unto the
environment so that the environment won't get mutated due to
manipulation of procedure arguments. This should perhaps be
regarded as a temporary solution until someone finds a more
efficient one. (Thanks to Maciej Stachowiak.)
from debug.c --> eval.c
* eval.h, eval.c (scm_eval_options_interface): New options
interface.
(SCM_EVAL_STACK): New option: Size of newly created stacks,
i.e. stacks for new threads.
* eval.c (unsafe_setjmp): Removed with #if 0.
* eval.c, numbers.c, unif.c, srcprop.c: Added a few curly braces
to avoid compiler warnings.
Some indentation fixes.
* objects.h (SCM_METACLASS_STANDARD_LAYOUT): Printer field is no
longer a user field; New field: class_flags.
* objets.c, objects.h: New metaclass: scm_metaclass_operator.
Added #include "objects.h"
* eval.c (scm_makprom): Added SCM_DEFER_INTS and SCM_ALLOW_INTS.
Add #include "feature.h".
* ports.h (SCM_EOF_OBJECT_P): New macro predicate.
This test is needed at many places in the code and should be
abstracted. (Motivated by the need of this test in libguiletk.)
* ports.c (scm_eof_object_p), vports.c (sfgetc), strports.c
(scm_eval_string), load.c (scm_primitive_load,
scm_read_and_eval_x), gh_eval.c (gh_eval_str):
Use SCM_EOF_OBJECT_P.
* eval.c (scm_init_eval): Add feature `delay'.
* gsubr.c: New global symbol scm_i_inner_name.
* debug.c (scm_procedure_name): Try procedure property
`inner-name' if `name' fails.
* print.c (scm_iprin1): Use scm_macro_name.
* eval.c (scm_m_define): Give names to macros as well; Only the
first top-level definition gives a procedure/macro a name.
Otherwise confusing names can turn up in backtraces.
(SCM_CEVAL): SCM_IM_DEFINE: Set `inner-name' property instead of
`name'; Give names to macros as well.
* procs.c (scm_closure_p), print.c (scm_iprin1), eval.c
(scm_macro_transformer): Use SCM_CLOSUREP instead of
scm_closure_p.
procedures;
(prinmacro): Removed. The code has been moved/merged into print.c
in order to decrease code redundancy. We want macros to print in
a way equivalent to procedures, and it would be silly to duplicate
the required code. (We don't want to maintain two places.)
(macrosmob): Print field is now a NULL pointer.
* eval.h (scm_macro_p, scm_macro_type, scm_macro_name,
scm_macro_transformer): New prototypes.
(scm_tc16_macro): Declared.
* * print.c (scm_iprin1): Added code for printing of macros. Macros
are now printed in a way equivalent to procedures.
is defined, to avoid warnings; it's only used in the
conflict-checking code. Which might go away anyway.
(SCM_CEVAL): All goto's targeting the `dispatch' label are in
conditionals; put the label definition in an #if too, to stifle
warnings.
condition during lookup (when using threads).
(scm_lookupcar): Implement in terms of scm_lookupcar1.
(SCM_CEVAL): Use scm_lookupcar1 instead of scm_lookupcar in one
place.