1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 20:00:19 +02:00
Commit graph

254 commits

Author SHA1 Message Date
Mikael Djurfeldt
2ddb09208b * eval.c (SCM_APPLY), sort.c (closureless): Expand body when
evaluating closures.
1999-08-19 19:01:19 +00:00
Mikael Djurfeldt
2f0d1375c1 * backtrace.c, debug.c, eval.c, eval.h, gsubr.c, read.c,
srcprop.c, srcprop.h (scm_i_filename, scm_i_line, scm_i_column,
scm_i_copy, scm_i_name, scm_i_lambda, scm_i_source, scm_i_more,
scm_i_procname, scm_i_dot, scm_i_arrow, scm_i_else, scm_i_unquote,
scm_i_uq_splicing, scm_i_apply, scm_i_enter_frame,
scm_i_apply_frame, scm_i_exit_frame, scm_i_trace, scm_i_quote,
scm_i_begin, scm_i_if, scm_i_and, scm_i_or, scm_i_case,
scm_i_cond, scm_i_letstar, scm_i_do, scm_i_quasiquote,
scm_i_define, scm_i_letrec, scm_i_let, scm_i_atapply,
scm_i_atcall_cc, scm_i_breakpoint): Renamed: Consequently use
scm_sym_ as prefix for symbols.

* eval.c, eval.h (scm_sym_begin, scm_sym_if, scm_sym_and,
scm_sym_case, scm_sym_cond, scm_sym_letstar, scm_sym_do,
scm_sym_define, scm_sym_letrec, scm_sym_atapply,
scm_sym_atcall_cc): Made global.
1999-08-17 08:46:37 +00:00
Mikael Djurfeldt
6ded69e17a * eval.c (scm_sym_args): Made global. 1999-08-16 15:20:44 +00:00
Mikael Djurfeldt
f3d2630a64 * eval.c (SCM_IM_DISPATCH): Rewrote dispatch protocol. Dispatch
forms now contain the expressions to be dispatched upon instead of
depending on a surrounding lambda or let; Generic function
dispatch has been optimized; `apply' on a generic function now
works a little bit strangely.  It uses a trick so that the type
dispatch code in SCM_CEVAL can be reused.
1999-08-06 19:37:44 +00:00
Mikael Djurfeldt
04b6c08138 * eval.c (SCM_CEVAL:SCM_IM_DISPATCH): Bugfix: Jump back to
cdrxnoap and loopnoap instead of begin and loop.
1999-08-04 22:55:08 +00:00
Mikael Djurfeldt
ef67c5eac1 * eval.c (SCM_CEVAL): Improvements to SCM_IM_DISPATCH and
SCM_IM_HASH_DISPATCH.
1999-08-04 11:27:44 +00:00
Mikael Djurfeldt
3a3111a88d * eval.c (scm_m_expand_body): Use scm_cons_source. 1999-07-29 23:01:01 +00:00
Mikael Djurfeldt
367a06cb7d * eval.c (SCM_CEVAL): Removed old implementation of internal
define.
1999-07-29 21:12:25 +00:00
Mikael Djurfeldt
6203706f4a Removed superfluous code in scm_macroexp. 1999-07-29 19:15:08 +00:00
Mikael Djurfeldt
26d5b9b4a6 * eval.c, tags.h, print.c (SCM_IM_SLOT_REF, SCM_IM_SLOT_SET_X):
New isym operations.

* eval.c (SCM_IM_DISPATCH, SCM_IM_HASH_DISPATCH): Don't use
improper lists in the low-level representation, since that will
cause a begin to be prepended at macro expansion.

* eval.c (scm_cons_source): Version of cons which copies source
properties from an existing cell.
(scm_m_quote, scm_m_begin, scm_m_if, scm_m_set_x, scm_m_and,
scm_m_or, scm_m_case, scm_m_cond, scm_m_lambda, scm_m_letstar,
scm_m_do, scm_m_letrec, scm_m_let, scm_copy_tree): Use
scm_cons_source.
1999-07-29 18:12:51 +00:00
Mikael Djurfeldt
ca4be6ea9e * eval.c (SCM_IM_DISPATCH, SCM_IM_HASH_DISPATCH): Don't use
improper lists in the low-level representation, since that will
cause a begin to be prepended at macro expansion.

* eval.c, tags.h, print.c (SCM_IM_SLOT_REF, SCM_IM_SLOT_SET_X):
New isym operations.
1999-07-29 09:54:10 +00:00
Mikael Djurfeldt
4725c2983f Removed configuration option --enable-lang which was recently added. 1999-07-28 20:39:34 +00:00
Mikael Djurfeldt
73b6434264 * eval.c (scm_nil, scm_t): New symbols.
(nil-cond, nil-ify, t-ify, 0-cond, 0-ify, 1-ify): New special
forms for multi-language support.
1999-07-27 19:09:06 +00:00
Jim Blandy
ae904cfae3 * eval.c (scm_m_lambda): Let bodycheck check the body of the
lambda.  Let your sins be purified by the blood of the lambda.
(Thanks to Eric Hanchrow.)
1999-07-19 08:45:54 +00:00
Mikael Djurfeldt
23a621512f Greg's smob patch 1999-07-07 09:44:01 +00:00
Jim Blandy
ff4670212a Patch from Greg Harvey:
* eq.c, eval.c, list.c, ramap.c, vectors.c: Always write parens
around the condition of an `if', `while', etc., even if the
condition is a macro invocation that expands to something
surrounded by parens.  It's more readable.
1999-06-19 20:21:07 +00:00
Jim Blandy
d9c393f5fa * eval.c (scm_map, scm_for_each): Verify that all arguments are
proper lists, and of the appropriate lengths.
(check_map_args): New function.
1999-06-19 17:25:25 +00:00
Mikael Djurfeldt
944f4c7067 * eval.c, fports.c, libguile.h, ports.c: Removed #include
"markers.h".
1999-05-23 10:02:31 +00:00
Jim Blandy
e4755e5c7b * numbers.c (s_bignum): Renamed to s_bignum, and made static.
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.)
1999-04-17 16:03:32 +00:00
Mikael Djurfeldt
185905af69 * debug.c, eval.c, evalext.c, stacks.c: #include "modules.h".
* modules.c, modules.h, eval.c, eval.h (scm_env_top_level,
scm_top_level_env, scm_system_module_env_p): Moved to modules.c.
* eval.c, eval.h (scm_top_level_lookup_closure): Removed.
1999-03-19 02:27:12 +00:00
Mikael Djurfeldt
6bcb086819 * eval.c (scm_sym_system_module): New symbol.
* 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.
1999-03-12 08:16:26 +00:00
Mikael Djurfeldt
89efbff42e * eval.c, procs.c, procs.h, procprop.c: Renamed getter ->
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.)
1999-03-11 11:45:06 +00:00
Jim Blandy
3eeba8d4f5 * chars.c (scm_lowers, scm_uppers, scm_charnames, scm_charnums),
eval.c (s_expression, s_test, s_body, s_bindings, s_variable,
s_clauses, s_formals): Variables now const.
* eval.c (promsmob): Now const.
* macros.c (macrosmob): Now const.
* smob.c (scm_newsmob): Smobfuns argument now points to const.
(freecell, flob, bigob): Now const.
* dynl.c (scm_make_argv_from_stringlist, scm_coerce_rostring),
error.c (scm_error, scm_syserror, scm_syserror_msg,
scm_num_overflow, scm_out_of_range, scm_wrong_type_arg,
scm_memory_error, scm_misc_error, scm_wta), macros.c
(scm_make_synt), feature.c (scm_add_feature), filesys.c
(scm_input_waiting_p), gc.c (scm_gc_start, scm_igc,
scm_must_malloc, scm_must_realloc), gsubr.c (scm_make_gsubr),
numbers.c (scm_num2dbl, scm_two_doubles, scm_num2long,
scm_num2long_long, scm_num2ulong),
options.c (scm_options), posix.c (scm_convert_exec_args,
environ_list_to_c), procs.c (scm_make_subr_opt, scm_make_subr),
ramap.c (scm_ramapc), read.c (scm_flush_ws), socket.c
(scm_sock_fd_to_port, scm_fill_sockaddr, scm_addr_vector), stime.c
(setzone, restorezone, bdtime2c), strop.c (scm_i_index),
strports.c (scm_mkstrport), symbols.c (scm_intern_obarray_soft,
scm_intern_obarray, scm_intern, scm_intern0,
scm_sysintern0_no_module_lookup, scm_sysintern, scm_sysintern0,
scm_symbol_value0), unif.c (scm_aind, scm_shap2ra): Argument
indicating calling subr, error message text, reason for error,
symbol name or feature name are now pointer to const.
* snarf.h (SCM_PROC, SCM_PROC1): String variables are now const.
* procs.c (scm_init_iprocs): iproc argument now points to const.
* pairs.c (cxrs): Now const.
* chars.h, error.h, feature.h, filesys.h, gc.h, gsubr.h, macros.h,
numbers.h, options.h, procs.h, ramap.h, read.h, smob.h,
strports.h, symbols.h, unif.h: Update variable declarations and
function prototypes for above changes.
* dynl.c, dynl-dld.c, dynl-dl.c, dynl-shl.c (sysdep_dynl_link,
sysdep_dynl_unlink, sysdep_dynl_func): Arguments FNAME, SUBR, and
SYMB now point to const.
1999-02-06 12:31:04 +00:00
Mikael Djurfeldt
c79450dd07 * eval.c (SCM_CEVAL): Added ENTER_APPLY in code for SCM_IM_APPLY. 1999-01-22 06:40:39 +00:00
Mikael Djurfeldt
7688430d05 Correction of mistake (should have committed onto a branch...) 1999-01-05 09:40:49 +00:00
Mikael Djurfeldt
98fae09612 *** empty log message *** 1999-01-05 09:25:59 +00:00
Maciej Stachowiak
b8229a3bab * snarf.h (SCM_SYNTAX): New macro to allow convenient declaration of
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.
1998-12-14 15:19:59 +00:00
Mikael Djurfeldt
9b07e212d5 * eval.c (SCM_CEVAL): Jump to badfun if trying to apply a struct
which isn't an operator.
(SCM_APPLY): Ditto, but jump to badproc.
1998-11-21 17:00:44 +00:00
Mikael Djurfeldt
aa00bd1e54 * eval.c (SCM_CEVAL): Allow structs implanted in code.
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.
1998-11-20 17:14:07 +00:00
Mikael Djurfeldt
224822be69 * eval.c (SCM_CEVAL): Added missing case for cclo. (Thanks to
Christian Lynbech.)
1998-11-17 08:03:18 +00:00
Mikael Djurfeldt
067affe319 * eval.c (scm_copy_tree): Copy source properties if existent. 1998-11-10 14:17:24 +00:00
Mikael Djurfeldt
7c3540523f * eval.c (SCM_CEVAL): Use SCM_SET/CLEAR_MACROEXP. 1998-11-10 06:10:11 +00:00
Mikael Djurfeldt
368bf056f9 * eval.c (SCM_CEVAL): Mark macro frames at `handle_a_macro' so
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.
1998-11-09 14:13:31 +00:00
Mikael Djurfeldt
d0b7bad785 * eval.c: Don't #define scm_lookupcar to scm_lookupcar1. Instead
make sure that there always is a "real" scm_lookupcar.
1998-11-01 04:40:33 +00:00
Mikael Djurfeldt
6cb702daed * eval.c (scm_s_expression, scm_s_test, scm_s_body,
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.
1998-10-31 13:05:07 +00:00
Jim Blandy
7dc6e7547a * __scm.h, alist.c, async.c, async.h, backtrace.h, chars.c,
continuations.c, debug.c, debug.h, dynl-dl.c, dynl.c, dynl.h,
dynwind.c, dynwind.h, eq.c, error.c, error.h, eval.c, eval.h,
feature.c, filesys.c, filesys.h, fports.c, fports.h, gc.c, gc.h,
genio.c, genio.h, gh.h, gh_data.c, gsubr.c, gsubr.h, hash.c,
hashtab.c, init.c, init.h, ioext.c, ioext.h, kw.c, libguile.h,
list.c, list.h, load.c, load.h, mallocs.c, markers.c,
mit-pthreads.c, net_db.c, numbers.c, numbers.h, options.c,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, regex-posix.c,
regex-posix.h, root.c, root.h, scmsigs.c, scmsigs.h, script.c,
script.h, simpos.c, simpos.h, smob.c, smob.h, snarf.h, socket.c,
srcprop.c, stackchk.c, stackchk.h, stacks.c, stime.c, stime.h,
strings.c, strings.h, strports.c, struct.c, struct.h, symbols.c,
symbols.h, tags.h, threads.c, throw.h, unif.c, variable.c,
vectors.c, vectors.h, version.h, vports.c, weaks.c: Update
copyright years.
1998-10-19 21:36:50 +00:00
Jim Blandy
cf7c17e976 * (__scm.h, alist.c, eval.c, feature.c, gsubr.c, numbers.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.)
1998-10-14 07:32:13 +00:00
Jim Blandy
ca6ef71ad9 * eval.c (safe_setjmp): Remove this misunderstanding.
(ENTER_APPLY, SCM_CEVAL, SCM_APPLY): Replace with references to
ordinary setjmp.
1998-10-07 10:02:34 +00:00
Jim Blandy
eed6e03e7e * eval.c (scm_force): Assert that x is SCM_NIMP to fix segv when
(force 9) is tried.  (Thanks to Karl M. Hegbloom.)
1998-09-26 09:57:37 +00:00
Mikael Djurfeldt
b6d7594844 * eval.h, eval.c: New evaluator trap flag: SCM_TRAPS_P.
* eval.c (SCM_CEVAL, SCM_APPLY): Removed resetting of trap flags.
Check SCM_TRAPS_P before trapping.
1998-08-21 08:13:55 +00:00
Jim Blandy
8ecf1f1359 * eval.h (scm_eval_options_interface): Add external prototype for this.
* eval.c (scm_eval_options_interface): Use prototype-style def'n.
* eval.c (scm_lookupcar1): Make this static.
1998-07-30 14:44:01 +00:00
Mikael Djurfeldt
3910272e9f * eval.c (scm_copy_tree): Reverted last change: `eval' uses
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.
1998-07-16 23:15:57 +00:00
Mikael Djurfeldt
240ed1e5f3 * eval.c (scm_copy_tree): Removed ability to copy vectors. 1998-07-16 22:38:36 +00:00
Mikael Djurfeldt
a8741caa54 * eval.c, filesys.c, fluids.c, gc.c, gh_data.c, init.c, kw.c,
net_db.c, posix.c, print.c, regex-posix.c, scmsigs.c, socket.c,
stime.c, symbols.c, unif.c, vectors.c, weaks.c: Removed third
argument in call to scm_make_vector.
1998-07-12 00:10:02 +00:00
Mikael Djurfeldt
65e417214c * eval.c (SCM_CEVAL): Moved scm_tc7_contin case above
scm_tcs_cons_gloc case in zero args switch; Fixed args
construction for operators in scm_tcs_cons_gloc case in two args
switch.
1998-05-04 11:31:45 +00:00
Mikael Djurfeldt
680ed4a802 * eval.c (SCM_CEVAL): Do more thorough argument checking. This
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.
1998-05-02 16:26:21 +00:00
Mikael Djurfeldt
f83e27370c * continuations.c (scm_make_cont), debug.c (scm_make_memoized,
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.)
1998-04-19 20:16:36 +00:00
Mikael Djurfeldt
a74145b809 * eval.c, eval.h, coop.c (scm_eval_stack, SCM_EVAL_STACK): Measure
stack size in machine words.
1998-04-12 23:34:43 +00:00
Mikael Djurfeldt
1609038c87 * eval.c (SCM_CEVAL, SCM_APPLY): In SCM_IM_APPLY and in the
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.)
1998-04-12 10:10:29 +00:00
Mikael Djurfeldt
33b974026b * eval.h, eval.c, debug.h, debug.c (scm_evaluator_traps): Moved
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.
1998-03-30 21:02:59 +00:00