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

438 commits

Author SHA1 Message Date
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
Jim Blandy
2c8f214468 * eval.c, debug.h: Revert changes of Dec 16 and Nov 21. They
cause an infinite loop (???).  So much for the algebraic
equivalency of variable-sized arrays and alloca...
1996-12-18 16:45:03 +00:00
Jim Blandy
2210c32f67 * eval.c (SCM_CEVAL): Use alloca, not GCC's extensions for arrays
with non-constant sizes.  (Thanks to Bernard Urban.)
1996-12-16 22:17:29 +00:00
Marius Vollmer
0aa1e432c0 * eval.c (scm_definedp): Use top_level_lookup_closure_var
and not top_level_lookup_thunk_var.
1996-11-27 23:29:29 +00:00
Marius Vollmer
ee33f8faed * eval.c (scm_definedp): Incompatibly changed to be a builtin
Scheme function, instead of syntax. Single argument is now a
symbol.
1996-11-27 13:22:58 +00:00
Jim Blandy
dc19d1d29a It's an "eval closure", not an "eval thunk." A thunk is a
function of no arguments.
* root.h (struct scm_root_state): Renamed
top_level_lookup_closure_var from top_level_lookup_thunk_var.
(scm_top_level_lookup_closure_var): Renamed from
scm_top_level_lookup_thunk_var.
* root.c (mark_root): Uses changed.
* gdbint.c (gdb_eval, gdb_binding): Uses changed.
* init.c (scm_start_stack): Uses changed.
* eval.c (scm_eval, scm_eval_x, scm_init_eval): Rename uses.
Change scheme-visible name to *top-level-lookup-closure* from
*top-level-lookup-thunk*.
1996-11-21 16:28:39 +00:00
Mikael Djurfeldt
11f77bfcc9 * * eval.c: Renamed debug option "deval" to "debug". 1996-11-02 20:53:32 +00:00
Gary Houston
523f526658 * load.c: change s_try_load and s_try_load_path to s_primitive_load
and s_primitive_load_path.

* eval.c, load.c, error.c (scm_wta): use scm_misc_error.

* error.h: don't declare error symbols.  prototype for scm_misc_error.

* stackchk.c (scm_stack_overflow_key): defined here instead of in
error.c.

* error.c: use SCM_SYMBOL to set up error keys.
scm_misc_error: new procedure.
1996-10-27 02:38:39 +00:00
Mikael Djurfeldt
a23afe534a * pairs.h, eval.c, eval.h, feature.c, gc.c, list.c, load.c,
ramap.c, symbols.c: Added new selectors SCM_CARLOC and SCM_CDRLOC
for obtaining the address of a car or cdr field.  Motivation:
&SCM_CXR make assumptions about the internal structure of the
SCM_CXR selectors.

* eval.h, eval.c: Added new selector SCM_GLOC_VAL_LOC.
Motivation: see SCM_CXRLOC.

* pairs.h, eval.c, gc.c, init.c, ioext.c, ports.c, ports.h,
srcprop.h, tags.h, throw.c, unif.c: Added new selectors
SCM_SETAND_CAR, SCM_SETAND_CDR, SCM_SETOR_CAR and SCM_SETOR_CDR.
Motivation: Safer use.  Some other macros are defined in terms of
these operations.  If these are defined using the SCM_SETCXR
(<e1>, SCM_CXR (<e1>) <op> <e2>) pattern a complex <e1> will lead
to inefficiency and an <e1> with side-effects could potentially
break.  Also, these particular operations are heavily utilized in
the garbage collector.  In unoptimized code there will be a
measurable speedup.

* alist.c, arbiters.c, continuations.c, debug.c, debug.h, eval.c,
eval.h, feature.c, filesys.c, fports.c, gc.c, gsubr.c, init.c,
ioext.c, kw.c, list.c, load.c, mallocs.c, numbers.c, numbers.h,
pairs.c, pairs.h, ports.c, ports.h, posix.c, procprop.c, procs.c,
procs.h, ramap.c, read.c, root.c, srcprop.c, srcprop.h,
strports.c, symbols.c, tags.h, throw.c, unif.c, variable.c,
vports.c: Cleaned up use of pairs: Don't make any special
assumptions about the internal structure of selectors and
mutators: SCM_CXR (<e1>) = <e2> --> SCM_SETCXR (<e1>, <e2>),
SCM_CXR (<e1>) &= <e2> --> SCM_SETAND_CXR (<e1>, <e2>) etc.
(Among other things, this change makes it easier to build Guile
with certain compilers which have problems with casted lvalues.)
1996-10-20 03:30:16 +00:00
Mikael Djurfeldt
38bd0b3b0e * eval.c: scm_i_name moved to gsubr.c
(scm_m_define): Record names of all kinds of procedure
objects.  (Earlier, only closures were recorded.)
1996-10-14 20:28:08 +00:00
Mikael Djurfeldt
4e646a03d6 * eval.c: Added new debug options maxdepth' and indent'. 1996-10-14 03:25:40 +00:00
Jim Blandy
1cc91f1b29 * __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes.  (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
Jim Blandy
b145c1720c * eval.c (scm_nconc2last): Don't accept an empty list; apply must
be given at least two arguments.  Insist that lst's last element
be a list, but don't make any requirements of its predecessors.
1996-10-14 00:58:30 +00:00
Gary Houston
01f61221f4 * error.c, eval.c, load.c, stackchk.c: use scm_error not lgh_error.
* __scm.h (lgh_error): removed, lgh shouldn't be in libguile.

* stime.c, stime.h: use SCM_P method.
1996-10-12 21:59:40 +00:00
Jim Blandy
1e79802357 * eval.c (scm_nconc2last): Revert last change; there seems to be
other stuff going on here.
1996-10-11 08:59:38 +00:00
Jim Blandy
a9d61ae5c2 * eval.c (scm_nconc2last): Make sure that each element of lst
(which is a list of argument lists, except for the tail) is a
proper list, i.e., finite and terminated by '().
1996-10-11 07:56:11 +00:00
Mikael Djurfeldt
1646d37b71 * continuations.c, debug.[ch], eval.c, gscm.c init.c, root.c,
throw.c: Renamed last_debug_info_frame -> scm_last_debug_frame.
1996-10-05 16:49:31 +00:00
Jim Blandy
ddef832786 * _scm.h: #include "print.h" here, since it seems to be used just
about everywhere.
* eval.c, gdbint.c, genio.h, numbers.h, smob.h, srcprop.c,
strports.c, unif.h: Don't #include "print.h".
1996-10-03 05:44:52 +00:00
Mikael Djurfeldt
1940267936 * eval.c, numbers.h, unif.h, smob.h, srcprop.c: Added #include
"print.h"

* arbiters.c (prinarb),
async.c (print_async),
debug.c (prindebugobj, prinmemoized),
eval.c (prinprom, prinmacro),
filesys.c (scm_fd_print, scm_dir_print),
kw.c (print_kw),
mallocs.c (prinmalloc),
numbers.c, numbers.h (scm_floprint, scm_bigprint),
smob.h (scm_smobfuns),
srcprop.c (prinsrcprops),
throw.c (prinjb),
unif.c, unif.h (scm_raprin1, rapr1),
variable.c (prin_var): Changed argument `int writing' to
`scm_print_state *pstate'.
1996-09-22 22:41:10 +00:00
Gary Houston
f5bf2977c6 * filesys.c (scsm_sys_stat): don't SIGSEGV if argument is an
integer (assuming for now accepting an integer is a good thing).

	* error.c, fports.c: replace use of %S in lgh_error args with %s.
	%S will be used instead for write'ing arguments.

	* unif.c (scm_transpose_array): change arguments in the SCM_WNA
	asserts.  fix a few other asserts.
	(scm_aind, scm_enclose_array, scm_array_in_bounds_p,
	scm_uniform_vector_ref,	scm_array_set_x,
	scm_dimensions_to_unform_array): change args in
	SCM_WNA SCM_ASSERTS and change scm_wta's to scm_wrong_num_args.
	strop.c (scm_substring_move_left_x, scm_substring_move_right_x,
	scm_substring_fill_x): likewise.
	gsubr.c (scm_gsubr_apply): likewise.
	eval.c (SCM_APPLY): likewise.

	* eval.c (4 places): replace scm_everr with lgh_error or
	scm_wrong_num_args.

	* error.c, error.h (scm_wrong_num_args, scm_wrong_type_arg,
	scm_memory_error): new procedures.
*	scm_everr: deleted.  can use scm_wta, dropping first two args.
	scm_error: convert NULL subr to SCM_BOOL_F.

	* __scm.h: don't define SCM_STACK_OVFLOW, SCM_EXIT, SCM_ARG6, SCM_ARG7,
	SCM_ARGERR.

	* stackchk.c (scm_report_stack_overflow): use lgh_error instead
	of scm_wta.

	* error.c, error.h: new error keys: scm_arg_type_key,
	scm_args_number_key, scm_memory_alloc_key, scm_stack_overflow_key,
	scm_misc_error_key.
	scm_wta: reimplement using lgh_error instead of scm_everr.
1996-09-19 09:08:07 +00:00
Mikael Djurfeldt
ac46ab165a * eval.c: Added #include "hash.h" 1996-09-18 19:33:22 +00:00
Mikael Djurfeldt
e2806c1000 * __scm.h, chars.c, debug.c, eval.c, eval.h, extchrs.c, extchrs.h,
fdsocket.c, feature.c, mbstrings.c, mbstrings.h, numbers.c,
numbers.h, print.c, scmhob.h, simpos.h, symbols.c, symbols.h,
tags.h, throw.c, variable.h: Name cleanup.  Lots of xxxSCM_yyy
removed.  (These were introduced by unsupervised name
substitution.)
1996-09-13 11:07:24 +00:00
Jim Blandy
20e6290e38 C files should #include only the header files they need, not
libguile.h (which #includes all the header files); the pointless
recompilation was wasting my time.
* Makefile.in (all .o dependency lists): Regenerated.
* libguile.h: Don't try to get a definition for size_t here...
* __scm.h: Do it here.
* _scm.h: Since this is the internal libguile header, put things
here that all (or a majority) of the libguile files will want.
Don't #include <libguile.h> here; that generates dependencies on
way too much.  Instead, get "__scm.h", "error.h", "pairs.h",
"list.h", "gc.h", "gsubr.h", "procs.h", "numbers.h", "symbols.h",
"boolean.h", "strings.h", "vectors.h", "root.h", "ports.h", and
"async.h".
* alist.c: Get "eq.h", "list.h", "alist.h".
* append.c: Get "append.h", "list.h".
* arbiters.c: Get "arbiters.h", "smob.h".
* async.c: Get "async.h", "smob.h", "throw.h", "eval.h".
* boolean.c: Get "boolean.h".
* chars.c: Get "chars.h".
* continuations.c: Get "continuations.h", "dynwind.h", "debug.h",
"stackchk.h".
* debug.c: Get "debug.h", "feature.h", "read.h", "strports.h",
"continuations.h", "alist.h", "srcprop.h", "procprop.h", "smob.h",
"genio.h", "throw.h", "eval.h".
* dynwind.c: Get "dynwind.h", "alist.h", "eval.h".
* eq.c: Get "eq.h", "unif.h", "smob.h", "strorder.h",
"stackchk.h".
* error.c: Get "error.h", "throw.h", "genio.h", "pairs.h".
* eval.c: Get "eval.h", "stackchk.h", "srcprop.h", "debug.h",
"hashtab.h", "procprop.h", "markers.h", "smob.h", "throw.h",
"continuations.h", "eq.h", "sequences.h", "alist.h", "append.h",
"debug.h".
* fdsocket.c: Get "fdsocket.h", "unif.h", "filesys.h".
* feature.c: Get "feature.h".
* files.c: Get "files.h".
* filesys.c: Get "filesys.h", "smob.h", "genio.h".
* fports.c: Get "fports.h", "markers.h".
* gc.c: Get "async.h", "unif.h", "smob.h", "weaks.h",
"genio.h", "struct.h", "stackchk.h", "stime.h".
* gdbint.c: Get "gdbint.h", "chars.h", "eval.h", "print.h",
"read.h", "strports.h", "tag.h".
* genio.c: Get "genio.h", "chars.h".
* gsubr.c: Get "gsubr.h", "genio.h".
* hash.c: Get "hash.h", "chars.h".
* hashtab.c: Get "hashtab.h", "eval.h", "hash.h", "alist.h".
* init.c: Get everyone who has an scm_init_mumble function:
"weaks.h", "vports.h", "version.h", "vectors.h", "variable.h",
"unif.h", "throw.h", "tag.h", "symbols.h", "struct.h",
"strports.h", "strorder.h", "strop.h", "strings.h", "stime.h",
"stackchk.h", "srcprop.h", "socket.h", "simpos.h", "sequences.h",
"scmsigs.h", "read.h", "ramap.h", "procs.h", "procprop.h",
"print.h", "posix.h", "ports.h", "pairs.h", "options.h",
"objprop.h", "numbers.h", "mbstrings.h", "mallocs.h", "load.h",
"list.h", "kw.h", "ioext.h", "hashtab.h", "hash.h", "gsubr.h",
"gdbint.h", "gc.h", "fports.h", "filesys.h", "files.h",
"feature.h", "fdsocket.h", "eval.h", "error.h", "eq.h",
"dynwind.h", "debug.h", "continuations.h", "chars.h", "boolean.h",
"async.h", "arbiters.h", "append.h", "alist.h".
* ioext.c: Get "ioext.h", "fports.h".
* kw.c: Get "kw.h", "smob.h", "mbstrings.h", "genio.h".
* list.c: Get "list.h", "eq.h".
* load.c: Get "load.h", "eval.h", "read.h", "fports.h".
* mallocs.c: Get "smob.h", "genio.h".
* markers.c: Get "markers.h".
* mbstrings.c: Get "mbstrings.h", "read.h", "genio.h", "unif.h",
"chars.h".
* numbers.c: Get "unif.h", "genio.h".
* objprop.c: Get "objprop.h", "weaks.h", "alist.h", "hashtab.h".
* options.c: Get "options.h".
* ports.c: Get "ports.h", "vports.h", "strports.h", "fports.h",
"markers.h", "chars.h", "genio.h".
* posix.c: Get "posix.h", "sequences.h", "feature.h", "unif.h",
"read.h", "scmsigs.h", "genio.h", "fports.h".
* print.c: Get "print.h",  "unif.h", "weaks.h", "read.h",
"procprop.h", "eval.h", "smob.h", "mbstrings.h", "genio.h",
"chars.h".
* procprop.c: Get "procprop.h", "eval.h", "alist.h".
* procs.c: Get "procs.h".
* ramap.c: Get "ramap.h", "feature.h", "eval.h", "eq.h",
"chars.h", "smob.h", "unif.h".
* read.c: Get "alist.h", "kw.h", "mbstrings.h", "unif.h",
"eval.h", "genio.h", "chars.h".
* root.c: Get "root.h", "stackchk.h".
* scmsigs.c: Get "scmsigs.h".
* sequences.c: Get "sequences.h".
* simpos.c: Get "simpos.h", "scmsigs.h".
* smob.c: Get "smob.h".
* socket.c: Get "socket.h", "feature.h".
* srcprop.c: Get "srcprop.h", "weaks.h", "hashtab.h", "debug.h",
"alist.h", "smob.h".
* stackchk.c: Get "stackchk.h", "genio.h".
* stime.c: Get "stime.h"."libguile/continuations.h".
* strings.c: Get "strings.h", "chars.h".
* strop.c: Get "strop.h", "chars.h".
* strorder.c: Get "strorder.h", "chars.h".
* strports.c: Get "strports.h", "print.h", "eval.h", "unif.h".
* struct.c: Get "struct.h", "chars.h".
* symbols.c: Get "symbols.h", "mbstrings.h", "alist.h",
"variable.h", "eval.h", "chars.h".
* tag.c: Get "tag.h", "struct.h", "chars.h".
* throw.c: Get "throw.h", "continuations.h", "debug.h",
"dynwind.h", "eval.h", "alist.h", "smob.h", "genio.h".
* unif.c: Get "unif.h", "feature.h", "strop.h", "sequences.h",
"smob.h", "genio.h", "eval.h", "chars.h".
* variable.c: Get "variable.h", "smob.h", "genio.h".
* vectors.c: Get "vectors.h", "eq.h".
* version.c: Get "version.h".
* vports.c: Get "vports.h", "fports.h", "chars.h", "eval.h".
* weaks.c: Get "weaks.h".
1996-09-10 02:26:07 +00:00
Mikael Djurfeldt
b7ff98ddd6 * eval.c, print.h, print.c, read.h, read.c: Modifications to
run-time options.
1996-08-23 01:20:34 +00:00
Mikael Djurfeldt
6dbd0af506 * * eval.c: scm_m_set and SCM_IM_SET no longer supports multiple
argument pairs.  Extensive modifications to the debugging
	evaluator.  Added "SECTION:" commentaries to clarify what happens
	when, during double compilation.  Renamed EVALIMP --> EVALIM.
	Renamed EVAL --> XEVAL.  Removed function evalcar.  Defined
	evalcar to scm_eval_car.  Added explanation of "EVAL" symbols to
	the beginning of the file.  New procedure: scm_unmemocopy.
	Added some global state variables needed by the debugging
	evaluator: scm_ceval_ptr, last_debug_info_frame, debug_mode,
	check_entry, check_apply, check_exit, debug_options and
	evaluator_traps.  New acro: undefine.
1996-08-20 17:09:07 +00:00
Jim Blandy
0f2d19dd46 maintainer changed: was lord, now jimb; first import 1996-07-25 22:56:11 +00:00