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

560 commits

Author SHA1 Message Date
Han-Wen Nienhuys
6256065013 * readline.c: terminate option list with NULL.
* read.c: idem.

* print.c: idem.

* eval.c: terminate option lists with 0.

* options.c: remove n (for length) from scm_option_X
functions. Detect option list length by looking for NULL name.
2007-01-19 19:26:36 +00:00
Kevin Ryde
23d7256628 merge from 1.8 2007-01-15 23:42:45 +00:00
Kevin Ryde
8ab3d8a068 merge from 1.8 branch 2006-10-09 23:40:48 +00:00
Kevin Ryde
23f2b9a3de merge from 1.8 branch 2006-06-17 23:15:59 +00:00
Kevin Ryde
2b829bbb3d merge from 1.8 branch 2006-04-17 00:05:42 +00:00
Marius Vollmer
cce0e9c875 (scm_eval_body): Lock source_mutex with a dynwind context
so that it gets unlocked in all cases.
(SCM_APPLY, CEVAL): Likewise.
2006-01-29 23:12:01 +00:00
Marius Vollmer
2f263a6a0b * futures.h, futures.c: Wrap whole contents in "#if 0"/"#endif".
* eval.c, init.c: Comment out all 'future' related things.
2006-01-29 19:09:52 +00:00
Marius Vollmer
661ae7ab6b Renamed the "frames" that are related to dynamic-wind to "dynamic
contexts.  Renamed all functions from scm_frame_ to scm_dynwind_.
Updated documentation.
2006-01-29 00:23:28 +00:00
Marius Vollmer
1fe1fc0a92 (scm_m_cond): Recognize SRFI 61 cond syntax.
(CEVAL): Evaluate SRFI 61 cond clauses.
2005-12-06 21:31:26 +00:00
Neil Jerram
7c9c0169b4 * eval.c (sym_instead): New symbol.
(ENTER_APPLY): Remove optional use of a continuation when making
trap call.
(scm_debug_opts): Change doc for 'cheap option to make clear that
it is now obsolete.
(CEVAL, SCM_APPLY): Remove optional use of a continuation when
making trap calls, and implement substitution of eval expressions
and return values using the values that the trap call handlers
return.

* debug.h (SCM_CHEAPTRAPS_P): Removed.
2005-11-04 21:20:24 +00:00
Marius Vollmer
d1138028c9 * null-threads.h, pthread-threads.h
(SCM_I_PTHREAD_RECURSIVE_MUTEX_INITIALIZER): Removed.
(scm_i_pthread_mutexattr_recursive): New.

* threads.c (scm_i_pthread_mutexattr_recursive): Declare.
(scm_i_critical_section_mutex): Do not initialize statically.
(scm_threads_prehistory): Initialize
scm_i_pthread_mutexattr_recursive and scm_i_critical_section_mutex
here.

* eval.c (source_mutex): Do not initialiaze statically.
(scm_init_eval): Do it here, using
scm_i_pthread_mutexattr_recursive.
2005-10-23 20:47:49 +00:00
Neil Jerram
5defc05d45 * eval.c (eval_letrec_inits): New.
(CEVAL): Eval letrec initializer forms using eval_letrec_inits.

* tests/r5rs_pitfall.test (1.1): Now passes.
2005-08-15 20:43:16 +00:00
Kevin Ryde
c3c97a34e7 (scm_dbg_make_iloc): Should be SCM_IFRAMEMAX and
SCM_IDISTMAX, and cast uints through scm_t_bits to make gcc happy.
Reported by Ken Raeburn.
2005-07-12 00:28:09 +00:00
Marius Vollmer
876099d4ef (scm_eval_options_interface): Use scm_frame_critical_section instead
of SCM_CRITICAL_SECTION_START and SCM_CRITICAL_SECTION_END.
2005-06-06 18:49:55 +00:00
Marius Vollmer
e9ed042cbc Added comment on how to make case 1.1 of r5rs_pitfall.test succeed. 2005-06-05 20:52:23 +00:00
Marius Vollmer
92205699d0 The FSF has a new address. 2005-05-23 19:57:22 +00:00
Neil Jerram
2b0fb0a50e Critical section review. 2005-03-30 18:43:49 +00:00
Marius Vollmer
de527efba5 Define _GNU_SOURCE. 2005-03-04 12:11:10 +00:00
Marius Vollmer
9de87eea47 See ChangeLog from 2005-03-02. 2005-03-02 20:42:01 +00:00
Marius Vollmer
76da80e788 Reverted changed from 2005/01/24 19:14:54, which was a commit to the
wrong branch.  Sorry.
2005-01-24 23:41:14 +00:00
Marius Vollmer
a54a94b397 Threading changes. 2005-01-24 19:14:54 +00:00
Marius Vollmer
65bc1f7a0b * eval.c, debug.h (SCM_WARN_DEPRECATED): New debug option.
* deprecation.c (scm_issue_deprecation_warning,
scm_c_issue_deprecation_warning_fmt): Use it.
(mode): Removed.
(print_summary): New.
(scm_init_deprecation): Initialize SCM_WARN_DEPRECATED instead of
mode.
2005-01-11 17:43:37 +00:00
Marius Vollmer
6be1fab900 (scm_eval): Added example to docstring. Thanks to Issac Trotts! 2005-01-10 20:20:58 +00:00
Marius Vollmer
4057a3e05a Use new vector elements API or simple vector API, as appropriate.
Removed SCM_HAVE_ARRAYS ifdefery.  Replaced all uses of
SCM_HASHTABLE_BUCKETS with SCM_HASHTABLE_BUCKET.
2005-01-02 20:49:04 +00:00
Marius Vollmer
a61f4e0c61 (scm_eval, scm_apply, call_cxr_1): Use scm_i_chase_pairs
instead of explicit code.
2004-09-22 17:38:44 +00:00
Dirk Herrmann
5fa0939ce5 * eval.c (unmemoize_exprs): When dropping internal body markers
from the output during unmemoization, also drop those that are not
	immediately at the beginning of a body.
2004-08-21 07:28:16 +00:00
Marius Vollmer
a03bad878b (scm_lookupcar1): Report "Variable used before given a value" insetad
of an "Unbound" one for variables that are found but still contain
SCM_UNDEFINED.
2004-08-20 13:33:28 +00:00
Marius Vollmer
2d0c133f92 (scm_lookupcar1): Report an "Undefined variable" insetad of an
"Unbound" one for variables that are found but still contain
SCM_UNDEFINED.
2004-08-20 12:26:46 +00:00
Marius Vollmer
cc95e00ac6 * strings.h, strings.c: (scm_i_string_chars, scm_i_string_length,
scm_i_string_writable_chars, scm_i_string_stop_writing): New, to
replace SCM_I_STRING_CHARS and SCM_I_STRING_LENGTH.  Updated all
uses.
(scm_i_make_string, scm_c_make_string): New, to replace
scm_allocate_string.  Updated all uses.
(SCM_STRINGP, SCM_STRING_CHARS, SCM_STRING_UCHARS,
SCM_STRING_LENGTH): Deprecated.
(scm_allocate_string, scm_take_str, scm_take0str, scm_mem2string,
scm_str2string, scm_makfrom0str, scm_makfrom0str_opt):
Discouraged.  Replaced all uses with scm_from_locale_string or
similar, as appropriate.
(scm_c_string_length, scm_c_string_ref, scm_c_string_set_x,
scm_c_substring, scm_c_substring_shared, scm_c_substring_copy,
scm_substring_shared, scm_substring_copy): New.

* symbols.c, symbols.h (SCM_SYMBOLP, SCM_SYMBOL_FUNC,
SCM_SET_SYMBOL_FUNC, SCM_SYMBOL_PROPS, SCM_SET_SYMBOL_PROPS,
SCM_SYMBOL_HASH, SCM_SYMBOL_INTERNED_P, scm_mem2symbol,
scm_str2symbol, scm_mem2uninterned_symbol): Discouraged.
(SCM_SYMBOL_LENGTH, SCM_SYMBOL_CHARS, scm_c_symbol2str):
Deprecated.
(SCM_MAKE_SYMBOL_TAG, SCM_SET_SYMBOL_LENGTH, SCM_SET_SYMBOL_CHARS,
SCM_PROP_SLOTS, SCM_SET_PROP_SLOTS): Removed.
(scm_is_symbol, scm_from_locale_symbol, scm_from_locale_symboln):
New, to replace scm_str2symbol and scm_mem2symbol, respectively.
Updated all uses.
(scm_gensym): Generate only the number suffix in the buffer, just
string-append the prefix.
2004-08-19 17:19:44 +00:00
Marius Vollmer
7f9994d904 * stime.c, socket.c, simpos.c, procs.c, posix.c, ports.c,
net_db.c, fports.c, filesys.c, eval.c, deprecation.c, dynl.c:
Replaced uses of SCM_STRING_CHARS with proper uses of
scm_to_locale_string.  Replaced SCM_STRINGP with scm_is_string.
Replaced scm_mem2string with scm_from_locale_string.

* simpos.c, posix.c (allocate_string_pointers, environ_list_to_c):
Removed, replaced all uses with scm_i_allocate_string_pointers.
2004-08-10 14:08:02 +00:00
Marius Vollmer
d9a67fc441 (scm_make_real, scm_num2dbl, scm_float2num, scm_double2num):
Discouraged by moving to discouraged.h and discouraged.c.
Replaced all uses with scm_from_double.
(scm_num2float, scm_num2double): Discouraged by moving prototype
to discouraged.h and rewriting in terms of scm_to_double.
Replaced all uses with scm_to_double.
2004-08-03 15:06:12 +00:00
Marius Vollmer
385609b992 (SCM_EVALIM, SCM_EVALIM2, SCM_XEVAL, SCM_XEVALCAR): Renamed to SCM_I_*
in order to avoid collisions with the versions defined in
deprecated.h.
2004-08-02 15:48:58 +00:00
Marius Vollmer
bc36d0502b * tags.h, deprecated.h (SCM_EQ_P): Deprecated by moving it into
deprecated.h.  Replaced all uses with scm_is_eq.
2004-07-27 15:41:49 +00:00
Marius Vollmer
e11e83f3d9 * deprecated.h, deprecated.c, numbers.h (SCM_INUMP, SCM_NINUMP,
SCM_INUM): Deprecated by reenaming them to SCM_I_INUMP, SCM_I_NINUMP
and SCM_I_INUM, respectively and adding deprecated versions to
deprecated.h and deprecated.c.  Changed all uses to either use the
SCM_I_ variants or scm_is_*, scm_to_*, or scm_from_*, as appropriate.
2004-07-23 15:43:02 +00:00
Marius Vollmer
a55c2b6809 * validate.h, deprecated.h (SCM_VALIDATE_INUM, SCM_VALIDATE_INUM_COPY,
SCM_VALIDATE_BIGINT, SCM_VALIDATE_INUM_MIN,
SCM_VALIDATE_INUM_MIN_COPY,
SCM_VALIDATE_INUM_MIN_DEF_COPY,SCM_VALIDATE_INUM_DEF,
SCM_VALIDATE_INUM_DEF_COPY, SCM_VALIDATE_INUM_RANGE,
SCM_VALIDATE_INUM_RANGE_COPY): Deprecated because they make the
fixnum/bignum distinction visible.  Changed all uses to scm_to_size_t
or similar.
2004-07-10 14:35:36 +00:00
Marius Vollmer
93ccaef0c6 * numbers.h (SCM_MAKINUM, SCM_I_MAKINUM): Renamed SCM_MAKINUM to
SCM_I_MAKINUM and changed all uses.
2004-07-08 15:58:11 +00:00
Marius Vollmer
7888309be8 * deprecated.h, boolean.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOL,
SCM_NEGATE_BOOL, SCM_BOOLP): Deprecated by moving into "deprecated.h".
Replaced all uses with scm_is_false, scm_is_true, scm_from_bool, and
scm_is_bool, respectively.
2004-07-06 10:59:25 +00:00
Dirk Herrmann
9fcf3cbb81 * backtrace.c (display_expression, display_frame): Call
scm_i_unmemoize_expr for unmemoizing a memoized object holding a
	single memoized expression.

	* debug.c (memoized_print): Don't try to unmemoize the memoized
	object, since we can't know whether it holds a single expression
	or a body.

	(scm_mem_to_proc): Removed check for lambda expression, since it
	was moot anyway.  Whoever uses these functions for debugging
	purposes should know what they do: Creating invalid memoized code
	will cause crashes, independent of whether this check is present
	or not.

	(scm_proc_to_mem): Take the closure's code as it is and don't
	append a SCM_IM_LAMBDA isym.  To allow easier debugging, the
	memoized code should not be modified.

	* debug.[ch] (scm_unmemoize, scm_i_unmemoize_expr): Removed
	scm_unmemoize from public use, but made scm_i_unmemoize_expr
	available as a guile internal function instead.  However,
	scm_i_unmemoize_expr will only work on memoized objects that hold
	a single memoized expression.  It won't work with bodies.

	* debug.c (scm_procedure_source), macros.c (macro_print), print.c
	(scm_iprin1): Call scm_i_unmemocopy_body for unmemoizing a body,
	i. e. a list of expressions.

	* eval.c (unmemoize_exprs): Drop internal body markers from the
	output during unmemoization.

	* eval.[ch] (scm_unmemocopy, scm_i_unmemocopy_expr,
	scm_i_unmemocopy_body): Removed scm_unmemocopy from public use,
	but made scm_i_unmemocopy_expr and scm_i_unmemocopy_body available
	as guile internal functions instead.  scm_i_unmemoize_expr will
	only work on a single memoized expression, while
	scm_i_unmemocopy_body will only work on bodies.
2004-06-27 12:34:54 +00:00
Dirk Herrmann
90df793f67 * eval.c (unmemoize_exprs): Handle semi-memoized code.
(scm_cons_source, scm_primitive_eval): Prefer higher level
	predicate SCM_FALSEP over SCM_IMP.
2004-06-21 20:40:36 +00:00
Han-Wen Nienhuys
d93294d451 (unmemoize_exprs): use SCM_CONSP for the loop condition. 2004-06-12 22:22:56 +00:00
Dirk Herrmann
212e58ede8 * list.[ch] (scm_i_finite_list_copy): New internal function to
copy lists that are known to be finite (though not necessarily
	proper).

	* debug.c (scm_procedure_source): Don't have scm_unmemocopy treat
	a closure's argument list like an expression of a body.

	* eval.c (unmemoize_expression, unmemoize_exprs, unmemoize_and,
	unmemoize_begin, unmemoize_case, unmemoize_cond, unmemoize_delay,
	unmemoize_do, unmemoize_if, unmemoize_lambda, unmemoize_let,
	unmemoize_letrec, unmemoize_letstar, unmemoize_or,
	unmemoize_set_x, unmemoize_apply, unmemoize_atcall_cc,
	unmemoize_at_call_with_values, unmemoize_future, sym_atslot_ref,
	unmemoize_atslot_ref, sym_atslot_set_x, unmemoize_atslot_set_x,
	unmemoize_builtin_macro): New static functions and symbols.

	(scm_unmemocopy): Rewritten in terms of the above.  scm_unmemocopy
	now has a slightly different meaning: The memoized form that is
	receives as its argument is now interpreted as a sequence of
	expressions from a body.

	(unmemocar, scm_unmemocar): Since the whole functionality of
	unmemocar and scm_unmemocar is not needed any more, scm_unmemocar
	has its old content back and is deprecated, while unmemocar has
	been removed.

	(SCM_BIT7): Removed.

	(CEVAL): For unmemoizing a single expression, call
	unmemoize_expression instead of scm_unmemocopy, which now expects
	a sequence of body expressions.  Eliminated unnecessary empty
	environment frame when executing let* forms.  Eliminated
	unmemoization step from evaluator.
2004-06-06 07:46:18 +00:00
Marius Vollmer
2b189e65c4 (scm_macroexp, macroexp): Renamed scm_macroexp to
macroexp and made static.  Added new version of scm_macroexp that
emits a deprecation warning and then calls macroexp.
(scm_m_undefine): Issue deprecation warning.
2004-06-02 09:37:48 +00:00
Dirk Herrmann
57d23e259a * eval.c (lookup_global_symbol, literal_p, try_macro_lookup):
Modified to make set! work on symbols that represent syntactic
	keywords.
2004-05-30 07:01:27 +00:00
Dirk Herrmann
26ecfa393d * eval.c (s_macro_keyword, scm_m_set_x): Remove checking for
misplaced syntactic keywords.  This will not work unless guile's
	defmacro feature is deprecated.

	(scm_m_case): Fixed a bug that caused the list of labels to grow
	with every case form.
2004-05-22 06:51:36 +00:00
Dirk Herrmann
e7313a9d7e * eval.c (unmemoize_quote): New static function.
(scm_m_quote, scm_m_atslot_ref, SCM_CEVAL): Changed the byte code
	representation of 'quote' and '@slot-ref' to an improper list.
	This reduces execution time, the number of cells used to hold the
	memoized code, and thus also reduces garbage collection time.

	(scm_unmemocopy): Use unmemoize_quote for quote expressions.

	(SCM_CEVAL): Changed macro handling to also work with macros that
	return improper lists.  Added an assertion, that the code returned
	by a macro transformer will not lead to cycles in the memoized
	code.
2004-05-16 06:38:51 +00:00
Dirk Herrmann
e51565673c No functional change, just rearrangements of functions within the
file.

	* eval.c (scm_ilookup, scm_unbound_variable_key,
	error_unbound_variable, scm_lookupcar1, scm_lookupcar): Moved to
	the definitions used for execution, since that's where they will
	belong to later.
2004-05-15 16:45:27 +00:00
Kevin Ryde
0a9ea92c90 (scm_macroexp): Add prototype, since it's not in eval.h under
--disable-deprecated.  Reported by Andreas Vögele.
2004-05-01 21:49:44 +00:00
Dirk Herrmann
36245b66c2 * libguile/eval.c (s_macro_keyword): New static identifier.
(scm_m_define): Change order to first create binding and
	evaluating the expression afterwards.

	(scm_m_set_x): Memoize complete set! expression.  Only leave
	symbols if no binding exists at memoization time.  Throw error if
	assigning to a syntactic keyword.

	(lazy_memoize_variable): New function.

	(CEVAL): When execution set!, perform lazy memoization if
	unmemoized symbol is detected.

	* libguile/modules.c (module_variable): Return variables with
	unbound value.

	* libguile/tags.h: Fix comment.

	* test-suite/tests/syntax.test: Add test case to check the correct
	handling of define expressions.
2004-04-26 19:59:03 +00:00
Dirk Herrmann
7e6e6b37ba Hide the implementation of ilocs and isyms in eval.c.
* deprecated.h (SCM_IFRINC, SCM_ICDR, SCM_IFRAME, SCM_IDIST,
	SCM_ICDRP), eval.c (SCM_IFRINC, SCM_ICDR, SCM_IFRAME, SCM_IDIST,
	SCM_ICDRP), eval.h (SCM_ICDR, SCM_IFRINC, SCM_IFRAME, SCM_IDIST,
	SCM_ICDRP): Deprecated and added to deprecated.h.  Moved from
	eval.h to eval.c.

	* deprecated.c (scm_isymnames), deprecated.h (scm_isymnames,
	SCM_ISYMNUM, SCM_ISYMCHARS), eval.c (SCM_ISYMNUM, isymnames,
	scm_unmemocopy, CEVAL), print.c (scm_isymnames), tags.h
	(SCM_ISYMNUM, scm_isymnames, SCM_ISYMCHARS): Deprecated
	scm_isymnames, SCM_ISYMNUM and SCM_ISYMCHARS and added to
	deprecated.[hc].  Moved scm_isymnames from print.c to eval.c and
	renamed to isymnames.  Moved SCM_ISYMNUM from tags.h to eval.c and
	renamed to ISYMNUM.

	* eval.c (scm_i_print_iloc, scm_i_print_isym), eval.h
	(scm_i_print_iloc, scm_i_print_isym), print.c (scm_iprin1):
	Extracted printing of ilocs and isyms to guile internal functions
	scm_i_print_iloc, scm_i_print_isym of eval.c.
2004-04-22 19:19:17 +00:00
Dirk Herrmann
b1cb24ff0a * eval.c (scm_unmemocopy): Fixed unmemoization of let*.
(deval_args, CEVAL): Minor improvements: Reduced variable scopes,
	added const qualifiers, cast intentionally unused expressions to
	void for emphasis, improved comment.
2004-04-19 16:49:56 +00:00