1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-03 21:30:29 +02:00
Commit graph

8264 commits

Author SHA1 Message Date
Dirk Herrmann
70c1c10864 * eval.c (s_defun): New static identifier.
(scm_m_nil_cond, scm_m_atfop, scm_m_undefine): Add comments.  Use
	ASSERT_SYNTAX to signal syntax errors.  Avoid unnecessary consing
	when creating the memoized code.
2003-10-22 20:16:41 +00:00
Kevin Ryde
0ee39677b9 *** empty log message *** 2003-10-19 00:49:36 +00:00
Kevin Ryde
3bf6ee15c0 *** empty log message *** 2003-10-19 00:36:26 +00:00
Kevin Ryde
a1fb3b1c11 Use define-module to hide helper defines.
(dbl-mant-dig, ash-flo): New helpers.
(exact->inexact): New tests.
2003-10-19 00:34:39 +00:00
Kevin Ryde
089c9a5909 (scm_i_big2dbl): Rewrite, carefully rounding to "closest"
in accordance with R5RS, which just mpz_get_d doesn't really give.
2003-10-19 00:32:25 +00:00
Kevin Ryde
32f19569bc (scm_ash): Revise docstring as per recent update to manual. 2003-10-19 00:27:00 +00:00
Dirk Herrmann
9a848baf55 * eval.c (s_bad_slot_number): New static identifier.
(scm_m_atslot_ref, scm_m_atslot_set_x): Use ASSERT_SYNTAX to
	signal syntax errors.  Avoid unnecessary consing when creating the
	memoized code.
2003-10-18 19:03:24 +00:00
Dirk Herrmann
da48db629c * libguile/eval.c (scm_m_cont, scm_m_at_call_with_values,
scm_m_generalized_set_x): Use ASSERT_SYNTAX to signal syntax
	errors.  Avoid unnecessary consing when creating the memoized
	code.

	(scm_m_generalized_set_x): Let scm_m_set_x handle the R5RS
	standard case.  Make sure line and file information are copied to
	every created expression.

	* test-suite/tests/syntax.test (exception:bad-var): Removed.

	Adapted tests for 'set!' to the new way of error reporting.
2003-10-18 18:26:43 +00:00
Dirk Herrmann
82b3e2c612 * libguile/eval.c (scm_m_set_x, scm_m_apply, scm_m_atbind): Use
ASSERT_SYNTAX to signal syntax errors.  Avoid unnecessary consing
	when creating the memoized code.

	(scm_m_atbind): Reversed the order, in which the init expressions
	are stored and executed.  The order of execution is now equal to
	the order in which the initializers of the let-forms are executed.
	Use check_bindings and transform_bindings.

	(SCM_CEVAL): Eliminated SCM_NIMP in favor of more appropriate
	!SCM_NULLP.  Added some comments.

	* test-suite/tests/dynamic-scope.test (exception:missing-expr):
	Introduced temporarily until all memoizers use the new way of error
	reporting.
2003-10-18 17:24:09 +00:00
Dirk Herrmann
216286857b * libguile/eval.c: Sorted include files alphabetically.
(scm_m_begin): Added comment.

	(scm_m_or): Use ASSERT_SYNTAX to signal syntax errors.  Avoid
	unnecessary consing when creating the memoized code.

	(iqq, scm_m_quasiquote, scm_m_quote): Use ASSERT_SYNTAX to signal
	syntax errors.  Be more specific about the kind of error that was
	detected.

	(scm_m_quote, unmemocopy): As an optimization, vector constants
	are now inserted unquoted into the memoized code.  During
	unmemoization the quotes are added again to provide syntactically
	correct code.

	* test-suite/tests/syntax.test (exception:missing/extra-expr,
	exception:missing/extra-expr-misc): Renamed
	exception:missing/extra-expr to exception:missing/extra-expr-misc.

	(exception:missing/extra-expr-syntax,
	exception:missing/extra-expr): Renamed
	exception:missing/extra-expr-syntax to
	exception:missing/extra-expr.
2003-10-18 14:49:55 +00:00
Dirk Herrmann
d6754c2398 * libguile/eval.c (scm_m_let, scm_m_letstar, scm_m_letrec,
scm_m_expand_body, check_bindings): Extracted syntax checking of
	bindings to new static function check_bindings.

	(scm_m_let, memoize_named_let): Extracted handling of named let to
	new static function memoize_named_let.

	(transform_bindings, scm_m_let, scm_m_letstar, scm_m_letrec): Use
	ASSERT_SYNTAX to signal syntax errors.  Be more specific about the
	kind of error that was detected.  Avoid use of SCM_CDRLOC.  Avoid
	unnecessary consing when creating the memoized code.

	* test-suite/lib.scm (exception:bad-variable): New.

	* test-suite/tests/syntax.test (exception:bad-binding,
	exception:duplicate-binding): New.

	(exception:duplicate-bindings): Removed.

	Adapted tests for 'let', 'let*' and 'letrec' to the new way of
	error reporting.
2003-10-18 12:07:39 +00:00
Kevin Ryde
2ec8656041 *** empty log message *** 2003-10-18 01:51:48 +00:00
Kevin Ryde
e05b02b6b4 (Defining new Scheme procedures in C): Don't use
@strong{Note:}, latest makeinfo will complain it looks like a cross
reference.
2003-10-18 01:51:24 +00:00
Kevin Ryde
7395c9cbd0 (Calling Scheme procedures from C, scm transition summary):
Refer to scm_list_n, not the old name scm_listify.
(scm transition summary): For gh_apply, recommend scm_apply_0, which
is now documented.
2003-10-18 01:49:18 +00:00
Kevin Ryde
158fab2b80 * posix.texi (Time): Correction to strftime glibc cross reference
node, now "Formatting Calendar Time".
2003-10-18 01:43:55 +00:00
Kevin Ryde
3e73b6f9df (SRFI-1 Searching): In break, note conflict with
binding established by `while'.
2003-10-18 00:49:08 +00:00
Neil Jerram
9f1af5d96e Work on debugger frontend code. 2003-10-16 11:53:58 +00:00
Dirk Herrmann
03a3e94134 * libguile/eval.c (s_bad_formals, s_bad_formal, s_duplicate_formal):
New static identifiers.

	(s_clauses, s_formals, s_duplicate_formals): Removed.

	(scm_m_lambda): Use ASSERT_SYNTAX to signal syntax errors.  Be more
	specific about the kind of error that was detected.  Prepare for
	easier integration of changes for separated memoization.

	* test-suite/tests/syntax.test (define exception:bad-formal, define
	exception:duplicate-formal): New.

	(exception:duplicate-formals): Removed.

	(exception:bad-formals): Adapted to the new way of error
	reporting.

	Adapted tests for 'lambda' to the new way of error reporting.
2003-10-12 20:47:32 +00:00
Marius Vollmer
e2de682cf8 *** empty log message *** 2003-10-12 16:53:24 +00:00
Marius Vollmer
eb041507a2 (directory-files): Close dir-stream when done. Thanks to Paul Jarc! 2003-10-12 16:52:12 +00:00
Marius Vollmer
da14f3fbf8 Added Paul Jarc. 2003-10-12 16:51:38 +00:00
Dirk Herrmann
4faa1ea021 * tests/syntax.test (exception:missing/extra-expr-syntax): Fixed
to be unaware of whether line number information is given or not.
2003-10-12 13:38:58 +00:00
Dirk Herrmann
4610b011a7 * libguile/eval.c (s_duplicate_binding): New static identifier.
(scm_m_case): Call scm_c_memq instead of implementing it inline.

	(scm_m_define): Added comment about how we check for duplicate
	formals.

	(scm_m_do): Added check for duplicate bindings.

	(scm_m_if): Use ASSERT_SYNTAX to signal syntax errors.  Avoid
	unnecessary consing when creating the memoized code.

	(scm_c_improper_memq, c_improper_memq, scm_m_lambda): Renamed
	scm_c_improper_memq to c_improper_memq, since it is not exported.

	(transform_bindings): Call scm_c_memq rather than
	scm_c_improper_memq.

	(SCM_CEVAL): Simplified handling of SCM_IM_IF forms.

	* test-suite/tests/syntax.test (exception:missing/extra-expr-syntax):
        New, introduced temporarily until all memoizers use the new way of
	error reporting.

	Adapted tests for 'if' to the new way of error reporting.
2003-10-12 12:58:51 +00:00
Dirk Herrmann
a954ce1d25 * eval.c (s_bad_bindings, s_bad_binding, s_bad_exit_clause): New
static identifiers.

	(scm_m_do): Use ASSERT_SYNTAX to signal syntax errors.  Be more
	specific about the kind of error that was detected.  Avoid use of
	SCM_CDRLOC.  Avoid unnecessary consing when creating the memoized
	code, this way also making sure that file name, line number
	information etc. remain available.
2003-10-12 09:22:52 +00:00
Dirk Herrmann
8ae95199fd * eval.c (memoize_as_thunk_prototype): New static function.
(scm_m_delay, scm_m_future): Use memoize_as_thunk_prototype.
	Avoid unnecessary consing when creating the memoized code.
2003-10-12 07:13:46 +00:00
Kevin Ryde
9b9a35b601 *** empty log message *** 2003-10-11 22:25:28 +00:00
Kevin Ryde
4c13270f34 (scm_append): Track argument number and use in error. 2003-10-11 22:24:34 +00:00
Dirk Herrmann
cc56ba8062 * libguile/eval.c (s_missing_expression, s_bad_variable): New static
identifiers.

	(scm_m_define): Use ASSERT_SYNTAX to signal syntax errors.  Prefer
	R5RS terminology for the naming of variables.  Be more specific
	about the kind of error that was detected.  Make sure file name,
	line number etc. are added to all freshly created expressions.
	Avoid unnecessary consing when creating the memoized code.

	* test-suite/tests/syntax.test (exception:missing-expr,
	exception:extra-expr): New.

	Adapted tests for 'begin' to the new way of error
	reporting.
2003-10-11 16:03:29 +00:00
Dirk Herrmann
609a8b86ae * libguile/eval.c (s_extra_expression, s_misplaced_else_clause,
s_bad_cond_clause, s_missing_recipient): New static identifiers.

	(s_extra_case_clause): Removed.

	(scm_m_case, scm_m_cond): If a clause appears after an else
	clause, report a misplaced else clause.

	(scm_m_cond): Use ASSERT_SYNTAX to signal syntax errors.  Be more
	specific about the kind of error that was detected.  Handle bound
	'else and '=>.  Avoid unnecessary consing when creating the
	memoized code.

	(scm_m_cond, unmemocopy, SCM_CEVAL): Use SCM_IM_ELSE to memoize
	the syntactic keyword 'else and SCM_IM_ARROW to memoize the
	syntactic keyword '=>.

	* test-suite/tests/syntax.test (exception:misplaced-else-clause,
	exception:bad-cond-clause): New.

	(exception:bad/missing-clauses, exception:extra-case-clause):
	Removed.

	Adapted tests for 'case' and 'cond' to the new way of error
	reporting.

	The tests that check if cond is hygienic pass now.
2003-10-11 10:40:19 +00:00
Dirk Herrmann
58a2510b07 * libguile/eval.c (scm_m_case): Allow empty lists of case labels.
* test-suite/tests/syntax.test: Fixed and activated test of empty case
        label support.
2003-10-11 01:52:25 +00:00
Dirk Herrmann
2a6f7afe04 * libguile/tags.h (SCM_IM_ELSE, SCM_IM_ARROW): New memoizer codes.
* libguile/print.c (scm_isymnames): Add names for the new memoizer
        codes.

	* libguile/eval.c (s_missing_clauses, s_bad_case_clause,
	s_extra_case_clause, s_bad_case_labels, s_duplicate_case_label,
	literal_p): New static identifiers.

	(scm_m_case): Use ASSERT_SYNTAX to signal syntax errors.  Be more
	specific about the kind of error that was detected.  Check for
	duplicate case labels.  Handle bound 'else.  Avoid unnecessary
	consing when creating the memoized code.

	(scm_m_case, unmemocopy, SCM_CEVAL): Use SCM_IM_ELSE to memoize
	the syntactic keyword 'else.

	* test-suite/tests/syntax.test (exception:bad-expression,
	exception:missing-clauses, exception:bad-case-clause,
	exception:extra-case-clause, exception:bad-case-labels): New.

	Added some tests and adapted tests for 'case' to the new way of
	error reporting.
2003-10-11 00:57:25 +00:00
Dirk Herrmann
e6729603c0 * libguile/eval.c (s_bad_expression, syntax_error_key, syntax_error,
ASSERT_SYNTAX, ASSERT_SYNTAX_2): New static identifiers.

	(scm_m_and): Use ASSERT_SYNTAX to signal syntax errors.  Avoid
	unnecessary consing when creating the memoized code.

	* test-suite/lib.scm (run-test-exception): Handle syntax errors.
2003-10-10 21:49:27 +00:00
Marius Vollmer
7b0f1f2ae1 *** empty log message *** 2003-10-10 14:32:19 +00:00
Marius Vollmer
a409f865f0 (inexact->exact): Use corrent argument order for pass-if-exception.
Use "+inf.0" instead of "+.inf", etc.
2003-10-10 14:32:11 +00:00
Kevin Ryde
9ddeb77696 *** empty log message *** 2003-10-09 00:41:46 +00:00
Kevin Ryde
1259cb26f7 (inexact->exact): New tests. 2003-10-09 00:41:15 +00:00
Kevin Ryde
2be24db4d7 (scm_inexact_to_exact): Don't depend on what double->long
cast gives for values bigger than a long, or for nan or inf.
2003-10-09 00:38:51 +00:00
Kevin Ryde
f09fe63732 *** empty log message *** 2003-10-09 00:17:12 +00:00
Kevin Ryde
ea2b9c2f6b (Hash Table Reference): Decribe rehashing, note
no hashx-remove!, describe make-hash-table size parameter.
2003-10-09 00:14:38 +00:00
Kevin Ryde
b7be48bc39 *** empty log message *** 2003-10-08 23:06:05 +00:00
Kevin Ryde
c42605e954 * tests/poe.test: New file.
* Makefile.am: Add it.
2003-10-08 23:05:12 +00:00
Kevin Ryde
f33f103c95 New file. 2003-10-08 23:03:29 +00:00
Kevin Ryde
ff6ea7b951 *** empty log message *** 2003-10-08 23:00:37 +00:00
Kevin Ryde
d6532dd1cf (funcq-assoc): Rewrite, don't assume '() is false, and
actually traverse the given alist.
2003-10-08 22:57:52 +00:00
Dirk Herrmann
df5af69a91 * smob.h (scm_make_smob_type): Made the declaration match the
definition.
2003-10-07 22:03:26 +00:00
Dirk Herrmann
d6e04e7c4a * lib.scm (exception:missing-expression): New.
* tests/dynamic-scope.test, tests/eval.test,
	tests/r5rs_pitfall.test, tests/srfi-17.test, tests/syncase.test:
	Wrap tests in module (test-suite test-<file-name without .test>),
	following a practice that was used on a couple of files already.

	* tests/dynamic-scope.test (exception:duplicate-binding,
	exception:bad-binding): New.

	* tests/dynamic-scope.test, tests/srfi-17.test, tests/syntax.test:
	Execute syntactically wrong tests using eval.  With the upcoming
	new memoizer this is necessary in order to postpone the syntax
	check to the actual evaluation of the syntactically wrong form.

	* tests/syntax.test: Added some test cases and modified one test
	case.
2003-10-07 22:00:05 +00:00
Marius Vollmer
da0e6c2baf Make type names char const * instead of char *. Thanks to Paul Jarc! 2003-10-07 15:58:19 +00:00
Neil Jerram
41a80feb8a UI frontend work: eval support. 2003-10-06 20:33:02 +00:00
Marius Vollmer
6b5dc4ee33 *** empty log message *** 2003-10-06 19:25:05 +00:00
Marius Vollmer
3446b6ef07 * scheme-memory.texi: Added a short explanation of the GC and the
conservative stack scanning.
(scm_gc_protect_object, scm_gc_unprotect_object,
scm_permanent_object): New.

* data-rep.texi, scheme-memory.texi (scm_remember_upto_here_1,
scm_remember_upto_here_2): Moved from data-rep.texi to
scheme-memory.texi.
2003-10-06 19:24:15 +00:00