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

475 commits

Author SHA1 Message Date
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
Mikael Djurfeldt
9cb5124fe3 * eval.c (scm_eval, scm_deval), eq.c (scm_equal_p): Use SCM_TICK
instead of SCM_ASYNC_TICK.
1998-01-30 21:07:51 +00:00
Mikael Djurfeldt
b971e6c65c * eval.c (macro-eval!): Removed. This function was a design bug.
It allowed memoized code to leak out to the scheme level.  Most
things that you could do with `macro-eval!' can be done with
`local-eval'.
1998-01-02 16:44:05 +00:00
Tom Tromey
b7f3516f99 * Makefile.in: Rebuilt.
* Makefile.am (libguile_la_SOURCES): Removed extchrs.c,
	mbstrings.c.
	(modinclude_HEADERS): Removed extchrs.h, mbstrings.h.
	* unif.c (scm_vector_set_length_x): Don't handle multibyte
	strings.
	* tag.c (scm_utag_mb_string, scm_utag_mb_substring): Removed.
	(scm_tag): Don't handle multibyte strings.
	* read.c: Don't include mbstrings.h.
	(scm_lreadr): Don't handle multibyte ports.
	* kw.c: Don't include mbstrings.h.
	* init.c: Don't include mbstrings.h.
	(scm_boot_guile_1): Don't init mbstrings module.
	* hash.c (scm_hasher): Don't handle mbstrings.
	* gscm.c (gscm_run_scm): Don't init mbstrings module.
	* gc.c (scm_gc_mark): Don't handle mbstrings.
	(scm_gc_sweep): Likewise.
	* eval.c (SCM_CEVAL): Don't handle mbstrings.
	* eq.c (scm_equal_p): Use SCM_TYP7S, not SCM_TYP7SD.
	* tags.h (SCM_TYP7SD): Removed.
	(SCM_TYP7D): Removed.
	(scm_tc7_mb_string): Removed.
	(scm_tc7_mb_substring): Removed.
	* print.c (scm_iprin1): Handle char printing directly.  Don't
	handle mbstrings.
	Don't include "mbstrings.h".
	* symbols.c (scm_intern_obarray_soft, scm_string_to_symbol,
	scm_string_to_obarray_symbol, msymbolize): Don't set symbol's
	multi-byte flag.
	Don't include "mbstrings.h".
	* symbols.h (SCM_SYMBOL_MULTI_BYTE_STRINGP): Removed.
	(SCM_SYMBOL_SLOTS): Define as 4.
	(SCM_ROSTRINGP): Use SCM_TYP7S, not SCM_TYP7SD.
	* arbiters.c, backtrace.c, debug.c, dynl.c, eval.c, fluids.c,
	gc.c, gsubr.c, ioext.c, kw.c, mallocs.c, numbers.c, ports.c,
	print.c, read.c, regex-posix.c, root.c, srcprop.c, stackchk.c,
	struct.c, threads.c, throw.c, unif.c, variable.c: Use new
	("gen"-less) I/O function names.
	* ports.c (scm_add_to_port_table): Don't set port's
	representation.
	* ports.h (scm_port_representation_type): Removed.
	(scm_string_representation_type): Removed.
	(struct scm_port_table ): Removed representation field.
	(SCM_PORT_REPRESENTATION): Removed.
	(SCM_SET_PORT_REPRESENTATION): Removed.
	* genio.h: Use new function names.
	* genio.c: Don't include "extchrs.h".
	(scm_gen_putc, scm_gen_puts, scm_gen_write, scm_get_getc):
	Removed.
	(scm_putc, scm_puts, scm_lfwrite): No longer static.
	(scm_getc): No longer static; handle line and column changes.
	(scm_ungetc): Renamed from scm_gen_ungetc.
	(scm_do_read_line): Renamed from scm_gen_read_line.
	* libguile.h: Don't include "extchrs.h" or "mbstrings.h"
	* extchrs.h, extchrs.c, mbstrings.h, mbstrings.c: Removed.
1997-10-15 17:18:32 +00:00
Mikael Djurfeldt
da7f71d7d5 * eval.c (SCM_CEVAL, scm_apply): Completed GOOPS support code;
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.
1997-10-12 12:54:54 +00:00
Mikael Djurfeldt
0c32d76caf * init.c (scm_boot_guile_1): Added scm_init_objects ().
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'.
1997-09-22 00:43:52 +00:00
Mikael Djurfeldt
25eaf21abc * eval.c (scm_init_eval): Add feature `delay'. 1997-09-20 13:58:58 +00:00
Mikael Djurfeldt
e0e4ffd234 * sequences.h, sequences.c, append.h, append.c: Removed. These
files implemented non-R4RS operations which would encourage
non-portable programming style and less easy-to-read code.

* Makefile.am (sequences.h, sequences.c, append.h, append.c):
Removed.

* libguile.h, eval.c, init.c, stime.c, unif.c: Removed #include
sequences.h, #include append.h.

* init.c (scm_boot_guile_1): Removed calls to scm_init_append and
scm_init_sequences.

* stime.c (bdtime2c): Changed scm_obj_length --> scm_vector_length.
1997-09-15 21:26:06 +00:00
Mikael Djurfeldt
80ea260cdf * procprop.h: Added declaration of scm_i_inner_name.
* 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.
1997-09-11 00:09:57 +00:00
Mikael Djurfeldt
7332df6644 * * eval.c (macro?, macro-type, macro-name, macro-transfomer): New
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.
1997-09-10 20:05:28 +00:00
Mikael Djurfeldt
269861c775 * eval.c (scm_apply): Handle the case when a tc7_sybr_2 is applied
to a list of length zero correctly.
1997-07-25 15:04:50 +00:00
Jim Blandy
e3173f937c * eval.c (scm_lookupcar1): Don't declare var2 unless USE_THREADS
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.
1997-06-21 05:53:04 +00:00
Marius Vollmer
f8769b1d9b * eval.c (scm_lookupcar1): New procedure to cope with a race
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.
1997-06-08 15:46:19 +00:00
Jim Blandy
d16332b312 * eval.c: Include scmconfig.h at the beginning of the file so that
HAVE_ALLOCA_H may properly be defined.  Thanks to Bill Janssen for
pointing this out.
1997-05-29 02:20:19 +00:00
Jim Blandy
82892beda5 * Lots of files: New address for FSF. 1997-05-26 22:34:48 +00:00
Jim Blandy
30000774de * eval.c (SCM_APPLY): Set debug apply frame argument list correctly
when PROC is receiving no arguments.
1997-04-12 01:16:49 +00:00
Jim Blandy
82a2622ab6 * eval.c: Doc fixes. 1997-04-11 03:54:28 +00:00
Mikael Djurfeldt
c75e83b76e * eval.c (safe_setjmp): Temporarily use old setjmp until someone
has time to check why this doesn't work well with continuations.
1997-03-16 16:45:21 +00:00
Mikael Djurfeldt
220ff1eb2f * eval.c: Fixed comment to unmemocopy. 1997-03-10 14:18:47 +00:00
Mikael Djurfeldt
70ad422696 * eval.c (scm_m_define): Bugfix: Check that the object is a
closure before setting the procedure property!
1997-03-09 15:29:11 +00:00
Mikael Djurfeldt
71d3aa6de5 * eval.c (SCM_CEVAL): Added code sections for handling of rpsubrs
with 3 or more args internally to the evaluator.
1997-03-08 03:03:16 +00:00
Mikael Djurfeldt
399dedcca7 * eval.c (SCM_CEVAL): Added code sections for handling of asubrs
with 3 or more args internally to the evaluator.  This is mainly
because we don't want to pass entry and exit points of the
debug support twice, but it also seems to increase the speed of
the evaluator for such calls (e. g. (+ 1 2 3)).
1997-03-07 21:43:03 +00:00
Mikael Djurfeldt
ee4274a654 * tags.h, eval.c (iqq): Fixes to comments about SCM_ECONSP. 1997-03-06 00:57:11 +00:00
Mikael Djurfeldt
c6a4fbce36 * eval.c (scm_deval): Removed some old code.
(ENTER_APPLY): Bugfix: Reset apply-frame trap on trap as is done
with the others.
(ENTER_APPLY, scm_deval): Reset trace flag on apply-frame and
exit-frame traps.
1997-03-01 14:23:27 +00:00
Tom Tromey
5862b540cd * eval.c: Don't define alloca in GCC case. gcc will automatically
use __builtin_alloca if appropriate.
1997-02-05 18:19:57 +00:00
Jim Blandy
c4ac4d8862 * eval.c (safe_setjmp): New function: trivial wrapper for setjmp.
(SCM_CEVAL, SCM_APPLY): Call it, instead of setjmp, to make sure
that values of automatic variables are preserved.  See comments
for safe_setjmp for details.
1997-02-04 23:30:07 +00:00
Jim Blandy
48b96f4b04 * configure.in: Call AC_FUNC_ALLOCA, to see if we have alloca.
* eval.c: Add necessary CPP cruft to support that.
* configure, Makefile.in: regenerated.
1997-02-04 21:59:23 +00:00
Marius Vollmer
9b8d32883e * symbols.c (scm_sysintern): Renamed to
scm_sysintern_no_module_lookup.
(scm_sysintern): New function to take the place of the old
scm_sysintern. It uses the current toplevel lookup closure to give
the symbol its value.  This is a temporary hack to put packages
like gtcltk into their own module.
(scm_can_use_top_level_lookup_closure_var): New variable to tell
us whether `scm_top_level_lookup_closure_var' has been initialized
and is usable.
* eval.c (scm_init_eval): Set it.
1997-01-18 11:49:35 +00:00
Jim Blandy
fa88817815 * eval.c (unmemocopy): Add a semicolon to appease the Sun
compiler.
1997-01-07 23:41:45 +00:00
Jim Blandy
c0ab1b8d03 Don't use GCC extensions to allocate space for debugging frames.
(Here he goes again!  Why do we put up with this?!)
* debug.h (scm_debug_frame): Make the 'vect' member a pointer to
an scm_debug_info structure, not an in-line array of them.  Add
'info' member, to say how many vect elements we've used, for eval
frames.
* eval.c (SCM_CEVAL): Use alloca to allocate space for vect.  Use
a new variable debug_info_end to mark the end of vect, instead of
the address of the 'info' pointer itself.
[DEVAL] (ENTER_APPLY, SCM_CEVAL, SCM_APPLY): Remove casts of
&debug to scm_debug_frame *; debug is a real scm_debug_frame now.
(SCM_APPLY): Explicitly allocate space for debug.vect.
* debug.c (scm_m_start_stack): Same, for vframe.vect.
* stacks.c: Adjusted for new debug frame structure.
(RELOC_INFO, RELOC_FRAME): New macros.
(stack_depth, read_frames): Use them, and new scm_debug_frame
element 'info', instead of magically knowing that eval frames have
an info pointer sitting after vect.
(scm_make_stack, scm_stack_id, scm_last_stack_frame): Use
RELOC_FRAME.
(scm_init_stacks): Formatting tweaks.
1996-12-19 07:55:42 +00:00