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

504 commits

Author SHA1 Message Date
Marius Vollmer
d9d39d76e7 Cosmetic cleanups. 2001-03-03 17:24:51 +00:00
Marius Vollmer
5280aacabc * eval.h (SCM_EVALIM2): New macro. Use it when a
immediate, literal constant should be evaluated.
* eval.c (scm_s_duplicate_formals): New error message string.
(scm_c_improper_memq): New function.
(scm_m_lambda): Check for duplicate arguments.
(scm_ceval, scm_deval): When executing a body: only cons a new
toplevel environment frame when it is different from the
existing one; use EVALCAR instead of SIDEVAL so that we can properly
check for empty combinations; use SCM_EVALIM2 for the same reason
in the non-toplevel loop.
(nontoplevel_cdrxnoap, nontoplevel_cdrxbegin, nontoplevel_begin):
New labels with the meaning of their non-"nontoplevel" partners,
but they are used when it is known that the body is not evaluated at
top-level.
(scm_apply, scm_dapply): use SCM_EVALIM2 to get proper error
reporting for empty combinations.
2001-03-03 15:10:37 +00:00
Neil Jerram
2069af3835 * Minor docstring updates. 2001-02-23 20:24:15 +00:00
Marius Vollmer
23c46fa69a * eval.c (scm_ceval, scm_deval): When evaluating expressions on
top level, create a fresh top-level environment for each
expression instead of mutating the exisint frame.  This is
important when that frame is closed over.
2001-02-22 20:54:12 +00:00
Marius Vollmer
a820af98a7 Only check number of arguments for closures, see last change.
I just love this evaluator, man.
2001-02-21 22:52:59 +00:00
Marius Vollmer
e37a4fbae1 * eval.c (scm_ceval, scm_deval): Check for wrong number of args
before applying arrow procedure in `cond' and before applying
receiver procedure in call-with-current-continuation.
(scm_i_eval): Do not invoke scm_copy_tree in argument in SCM_XEVAL
macro.  The argument is expanded more than one time.
2001-02-21 20:14:47 +00:00
Martin Grabmüller
b3f26b140b (scm_eval_options_interface, scm_evaluator_traps, s_scm_nconc2last):
Added docstrings.
2001-02-16 15:20:00 +00:00
Marius Vollmer
018008c17f Do not use "//" comment syntax. It's not ANSI. 2001-02-15 15:39:32 +00:00
Marius Vollmer
a2abcb5823 * eval.c (scm_ceval, scm_deval): use `SIDEVAL' instead of
SCM_CEVAL when evaluating subforms of `begin' forms.  SCM_CEVAL
can not deal with immediates.
2001-02-13 01:09:00 +00:00
Marius Vollmer
4163eb7236 * eval.c (scm_ceval, scm_deval): Recognize when `begin' is being
evaluated at top-level and synronize lookup closure before
executing every subform.
(scm_primitve_eval_x, scm_primitive_eval): New functions.
(scm_eval_x, scm_eval): Reimplement in terms of
scm_primitive_eval_x and scm_primitive_eval, respectively.
2001-02-11 18:13:07 +00:00
Marius Vollmer
aa767bc58f * modules.h (scm_selected_module, scm_current_module): Renamed
scm_selected_module to scm_current_module to synchronize Scheme
and C names.
(scm_select_module, scm_set_current_module): Likewise.  Changed
all uses.
2001-02-08 18:49:52 +00:00
Keisuke Nishida
00ffa0e7d6 New functions: scm_c_make_vector, scm_c_make_hash_table. 2001-02-02 04:56:25 +00:00
Mikael Djurfeldt
41ee56dde3 * eval.c (SCM_APPLY): Check that primitives which take 1 arg
really get that arg.
2001-01-29 18:23:34 +00:00
Mikael Djurfeldt
f1e06a96a2 * eval.c (SCM_APPLY): Added # args check for application of
procedures with arity 3.  (Thanks to Anders Holst.)
2001-01-24 01:26:44 +00:00
Dirk Herrmann
312ae976ad * Move all real functionality from scm_eval into inner_eval.
* Avoid to copy the evaluated expression twice.
2001-01-22 13:32:08 +00:00
Dirk Herrmann
4567ed787c * Applied Martin Grabmueller's fix of case's handling of 'else. 2001-01-19 17:16:52 +00:00
Dirk Herrmann
5d2b97cd07 * Fixed the changelog entry regarding re-introduction of struct member
properties (I continuously talked of member 'documentation' instead)
* Replace calls to scm_remember with calls to scm_remember_upto_here_1.
2000-12-28 16:49:09 +00:00
Dirk Herrmann
2e9c835db9 * Make sure, re-entering the dynamic scope of an eval statement will
restore the latest selected module.
2000-12-21 17:51:55 +00:00
Dirk Herrmann
09074dbf9c * Fix a bug in scm_eval. 2000-12-15 14:00:18 +00:00
Dirk Herrmann
85db4a2c8e * Initialize symbols using SCM_(GLOBAL_)?SYMBOL instead of scm_sysintern...
* Use scm_str2symbol instead of scm_sysintern0.
* Garbage collection initialization code now within gc.c only.
2000-12-11 14:48:23 +00:00
Keisuke Nishida
e841c3e0c0 Smob-related creanup. 2000-12-08 17:32:56 +00:00
Keisuke Nishida
68b069240f Some cleanup on smob calls. 2000-12-07 07:10:26 +00:00
Keisuke Nishida
cb1c46c57e Improved smob calls. 2000-12-07 00:55:12 +00:00
Dirk Herrmann
fd3363659b * eval.c: remove commented code, remove #ifdef CCLO conditionals
* remove uses of older GC marking and cell accessing macros
2000-12-06 15:16:59 +00:00
Gary Houston
5f144b105d * use an applicable SMOB to represent continuations, instead of a
custom tc7 type.  This will make it easier to support R5RS
	multiple value continuations, without the use of a Scheme-level
	wrapper.

	* continuations.c (scm_tc16_continuation, continuation_mark,
	continuation_free, continuation_print, continuation_apply):
	new SMOB support.
	(scm_make_continuation): new procedure, replaces scm_make_cont
	with a different interface.
	(copy_stack_and_call, scm_dynthrow, scm_init_continuations): rewritten.
	(CHEAP_CONTINUATIONS): removed non-working code completely.
	(scm_call_continuation): removed.
	* continuations.h (struct scm_contregs): add num_stack_items and
	stack fields.  previously stack was stored following this struct:
	use a tail array instead.
	(SCM_CONTINUATIONP): new macro.
	(SCM_CONTINUATION_LENGTH, SCM_SET_CONTINUATION_LENGTH):
	rewritten.
	(SCM_SET_CONTREGS): removed.
	* tags.h: removed scm_tc7_contin (was tag 61).
	* debug.c, gc.c, hash.c, print.c, procprop.c, procs.c:
	removed scm_tc7_contin support.
	* eval.c: use scm_make_continuation instead of scm_make_cont.
	don't set jump buffers here.  remove scm_tc7_contin support.
	* init.c, root.c: create SMOB continuation for rootcont instead
	of scm_tc7_contin.  call scm_init_continuations before
	scm_init_root.
	* root.c: remove support for static jmpbuf.  It's not used by
	default and I broke it.  create SMOB continuation for rootcont.
	* stacks.c: use SCM_CONTINUATIONP.
2000-11-25 16:58:25 +00:00
Marius Vollmer
8dc9439fc6 * alist.c, arbiters.c, async.c, backtrace.c, boolean.c, chars.c,
continuations.c, debug-malloc.c, debug.c, dynl.c, dynwind.c,
environments.c, eq.c, error.c, eval.c, evalext.c, feature.c,
filesys.c, fluids.c, fports.c, gc.c, goops.c, guardians.c, hash.c,
hashtab.c, hooks.c, ioext.c, iselect.c, keywords.c, lang.c,
list.c, load.c, macros.c, modules.c, net_db.c, numbers.c,
objects.c, objprop.c, options.c, pairs.c, ports.c, posix.c,
print.c, procprop.c, procs.c, properties.c, ramap.c, random.c,
read.c, regex-posix.c, root.c, scmsigs.c, script.c, simpos.c,
socket.c, sort.c, srcprop.c, stackchk.c, stacks.c, stime.c,
strings.c, strop.c, strorder.c, strports.c, struct.c, symbols.c,
tag.c, threads.c, throw.c, unif.c, variable.c, vectors.c,
version.c, vports.c, weaks.c: Makes sure the snarfer output
inclusion is disabled when the snarfer is run on the file.  Thanks
to Lars J. Aas!

* Makefile.am: Install guile-procedures.txt in version-specific
directory to enable multiple installed guile versions.  Suggested
by Karl M. Hegbloom <karlheg@debian.org, patch by Matthias Koeppe.
2000-11-17 16:25:05 +00:00
Mikael Djurfeldt
4ea6a43186 * eval.c (SCM_IM_DISPATCH), objects.c (scm_mcache_lookup_cmethod):
Count n_specialized + 1 turns before letting a match through.
2000-11-07 02:18:11 +00:00
Mikael Djurfeldt
5e8904311f * goops.c, objects.c, objects.h, eval.c (scm_make_extended_class,
scm_make_port_classes, scm_change_object_class,
scm_memoize_method): Changed to ordinary functions (was plugin
slots).
2000-10-25 14:50:28 +00:00
Dirk Herrmann
d1ca2c6423 * Some more work to get rid of SCM_LENGTH
* Eliminated some cell type bit fiddling
* Various minor changes
2000-10-25 11:01:03 +00:00
Dirk Herrmann
b5c2579a34 * Removed further calls to SCM_LENGTH. 2000-10-10 09:22:31 +00:00
Dirk Herrmann
3db4adfced * Removed some more references to SCM_CHARS.
* Provided SCM_U?VECTOR_BASE as replacements for SCM_VELTS.
2000-09-26 19:20:39 +00:00
Dirk Herrmann
f151f91293 * Eliminated some more calls to SCM_CHARS. 2000-09-22 17:43:57 +00:00
Dirk Herrmann
28b06554ca * Unified ssymbols and msymbols to a single symbol type 'scm_tc7_symbol'.
* Added scm_string_hash and deprecated scm_strhash.
2000-09-12 12:30:36 +00:00
Keisuke Nishida
afa38f6e60 * eval.c (SCM_APPLY): Fixed bugs in the applicable-smob calls. 2000-09-10 13:41:18 +00:00
Neil Jerram
11768c044a * Docstring updates. 2000-09-02 23:23:16 +00:00
Keisuke Nishida
0717dfd871 * smob.h (scm_smob_descriptor): Added apply\' and gsubr_type\'.
* smob.c (scm_make_smob_type): Initialize `apply\' and `gsubr_type\'.
(scm_set_smob_apply): New function.
(scm_smob_apply_0, scm_smob_apply_1, scm_smob_apply_2,
scm_smob_apply_3): New functions.
* eval.c (SCM_CEVAL, SCM_APPLY): Added dispatch for applicable smobs.
* procs.c (s_scm_procedure_p): Check applicable smobs.
2000-08-25 02:26:22 +00:00
Mikael Djurfeldt
68d8be66ce * eval.c (scm_eval): Backward incompatible change: Now takes an
environment specifier as second arg.  `eval' hereby becomes R5RS
compatible.
(scm_i_eval_x, scm_i_eval): New functions (replace
scm_eval_3).
(scm_eval2, scm_eval_3): Deprecated.
(scm_top_level_lookup_closure_var): Deprecated.
2000-08-11 08:42:50 +00:00
Marius Vollmer
1bd07992b6 * eval.c (unmemocopy): Don't rely on V being a list of at least
one element.  Thanks to Bill Schottstaedt!
2000-07-17 19:59:57 +00:00
Mikael Djurfeldt
549e6ec69d * eval.c, eval.h (scm_top_level_lookup_closure_var): Added.
#include "libguile/fluids.h".
2000-06-21 02:42:03 +00:00
Mikael Djurfeldt
8878f04033 * eval.c: Updated comment above scm_map. 2000-06-14 22:02:13 +00:00
Mikael Djurfeldt
002f1a5dba * eval.c (scm_badformalsp): New static function.
(SCM_CEVAL): Check arguments for procedure-with-setter closures.
(Thanks to Keisuke Nishida.)
2000-06-04 17:27:27 +00:00
Mikael Djurfeldt
790071cdc8 * eval.c (scm_lookupcar): Test for !SCM_CONSP (SCM_CAR (env))
instead of SCM_TRUE (scm_procedurep (SCM_CAR (env))).
2000-06-04 01:29:54 +00:00
Dirk Herrmann
445f675cf4 * Replace SCM_UNPACK_CAR with SCM_CELL_TYPE or SCM_CELL_WORD_0.
* Only access cons cells via SCM_{SET}?C[AD]R.
* Added documentation for scm_force.
2000-05-23 17:18:37 +00:00
Dirk Herrmann
af45e3b06a * Unified some rest argument checking and handling. 2000-05-18 08:47:52 +00:00
Dirk Herrmann
c8a54c4b87 * __scm.h: Added SCM_DEBUG as default debug option.
* __scm.h: Added debug option SCM_DEBUG_REST_ARGUMENTS.
* eval.c:  Make sure all parameter lists for map and for-each have the
  same length.  Also, removed redundant parameter checks.
2000-05-17 08:35:30 +00:00
Dirk Herrmann
eb42e2f03a More distinguished handling of real and complex values. 2000-05-10 12:34:43 +00:00
Dirk Herrmann
ab66ae47f2 * eval.c: Removed ASRTSYNTAX macro. Removed function 'bodycheck'.
* stacks.c:  Removed unused calculations, minimized variable scopes.
2000-05-08 09:57:29 +00:00
Dirk Herrmann
44d3cb0d1b * eval.c: Eliminated redundant SCM_IMP tests.
* hashtab.c, weaks.c: Fixed critical sections.  Thanks to Keisuke Nishida.
2000-05-05 11:10:57 +00:00
Dirk Herrmann
f8de44c154 * numbers.c (scm_logtest, scm_division): Reordered dispatch sequence.
* removed calls to deprecated scm_makdbl.
2000-05-02 16:41:20 +00:00
Dirk Herrmann
09e4d06400 Made undef_object into a local static variable. 2000-04-25 12:06:51 +00:00