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

89 commits

Author SHA1 Message Date
Kevin Ryde
6e7d5622ee merge from 1.8 branch 2006-04-16 23:37:40 +00:00
Marius Vollmer
92205699d0 The FSF has a new address. 2005-05-23 19:57:22 +00:00
Kevin Ryde
2ebe323a15 (while): Tests running in empty environment are
now "unresolved" do to workaround in while implementation.
2005-01-27 21:23:09 +00:00
Dirk Herrmann
c454c4e624 * tests/syntax.test: Added tests for unmemoization. 2004-10-03 06:15:22 +00:00
Marius Vollmer
0ac467456b * lib.scm (exception:used-before-define): New.
* tests/syntax.test ("letrec"): Use it.
2004-08-23 10:48:51 +00:00
Dirk Herrmann
aa498d0c1b * tests/syntax.test: Added various tests to check that
unmemoization works correctly.
2004-05-31 15:31:04 +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
a264c013fd * tests/syntax.test: Added test for unmemoizing internal defines. 2004-01-23 14:24:37 +00:00
Marius Vollmer
96dfea7d7e It's "#\\space", not "#\space". 2003-11-30 00:58:25 +00:00
Dirk Herrmann
c86c440b17 * libguile/eval.c (s_mixed_body_forms): New static identifier.
(canonicalize_define, scm_m_define): The check for a bad
	expression is performed in canonicalize_define now.

	(try_macro_lookup, expand_user_macros, is_system_macro_p): New
	static helper functions for m_expand_body.

	(m_expand_body): Use ASSERT_SYNTAX to signal syntax errors.  Only
	expand user defined macros.  Fixed handling of the definition/
	expression boundary.  Fixed handling of definitions grouped with
	'begin.  Use canonicalize_define to expand definitions.

	* test-suite/tests/syntax.test: Tests that check for the correct
	handling of internal defines with begin work now.
2003-11-15 12:27:54 +00:00
Dirk Herrmann
c3d948015a * tests/syntax.test: Fixed test that checks for the correct
handling of macros in the context of internal defines.
2003-11-15 11:51:17 +00:00
Dirk Herrmann
560434b369 * tests/optargs.test: Wrap tests in module (test-suite
test-<file-name without .test>).  Rewrite test to be R5RS
	conforming.

	* tests/syntax.test: Added test to check correct handling of
	internal defines.
2003-11-09 19:07:41 +00:00
Dirk Herrmann
ced8edb0f9 * libguile/eval.c (s_missing_body_expression): New static identifier.
(s_body): Removed.

	(scm_m_expand_body): Fixed core dump when passing a body with
	defines, but without expressions (see additions to syntax.test).
	Use ASSERT_SYNTAX to signal syntax errors.

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

	Renamed section 'define' to 'top-level define' and added a new
	section 'internal define' with some tests.
2003-11-08 08:11:14 +00:00
Dirk Herrmann
89bff2fc10 * libguile/eval.c (s_expression): Added comment.
(s_empty_combination, error_unbound_variable): New static
	identifiers.

	(SCM_VALIDATE_NON_EMPTY_COMBINATION, SCM_EVALIM2, scm_lookupcar1):
	Use ASSERT_SYNTAX, syntax_error or error_unbound_variable to
	signal syntax errors.

	(SCM_CEVAL): Separated handling of evaluator bytecodes and other
	scheme objects.

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

	(exception:illegal-empty-combination): New.

	(exception:missing/extra-expr): Unified capitalization.

	Adapted test for '()' to the new way of error reporting.
2003-11-01 07:26:44 +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
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
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
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
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
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
Dirk Herrmann
8aa28a916c * guile-test: Wrapped in module (test-suite guile-test).
(main data-file-name test-file-name): Exported.

	((guile-user)::main): New function, wrapper for function
	(test-suite guile-test)::main.

	* tests/load.test: Wrapped in module (test-suite test-load).

	* tests/ports.test: Wrapped in module (test-suite test-ports).

	* tests/r4rs.test: Wrapped in module (test-suite test-r4rs).
	Added comments about the required structure of the file itself,
	since it is subject to some tests.  Removed some now unnecessary
	undefine operations.

	* tests/syntax.test: Wrapped in module (test-suite test-syntax)
2003-09-22 19:00:41 +00:00
Kevin Ryde
cc08aafdaf (while): Exercise break and continue from
recursive nested loops.
2003-08-17 00:40:33 +00:00
Kevin Ryde
9f977dd883 Add a copyright year. 2003-08-12 21:39:56 +00:00
Kevin Ryde
2798ba71cd (while): New tests. 2003-08-12 21:39:30 +00:00
Dirk Herrmann
4dce3c9645 * tests/syntax.test: Modified some tests to use eval when
providing bad syntax.  Otherwise, the memoizer will report an
	error immediately after reading the form, without even the chance
	to get the pass-if-exception mechanism started.
2003-04-23 19:04:00 +00:00
Dirk Herrmann
7171f1ab47 * tests/syntax.test: Added some tests, updated some others with
respect to recent changes in eval.c.  Further, extracted test
cases for guile's extended set! functionality to srfi-17.test.

* tests/srfi-17.test:  New file.
2001-11-17 11:44:06 +00:00
Dirk Herrmann
b461abe73f * tests/syntax.test: Added test cases for 'cond =>' syntax with
else clause.  Changed some tests and comments related to the
'case' form to reflect recent changes in the implementation.
2001-10-18 21:59:29 +00:00
Dirk Herrmann
ea6c2147b7 * tests/syntax.test: Added test cases for 'lambda' syntax. 2001-10-13 23:59:27 +00:00
Dirk Herrmann
27a226665e * tests/syntax.test: Added test cases for 'case' syntax. 2001-10-13 17:02:01 +00:00
Dirk Herrmann
e1a7b2cea7 * Added a new test case plus minor improvements. 2001-03-11 23:31:58 +00:00
Martin Grabmüller
880c285882 * tests/syntax.test ("let*"): Changed the `duplicate bindings'
test, dups are allowed in `let*' and are now expected to pass.
2001-03-09 09:44:26 +00:00
Marius Vollmer
c0ed1605f1 * tests/syntax.test ("let,duplicate bindings", "let*,duplicate
bindings", "letrec,duplicate bindings"): Expect to pass, bug has
been fixed.
2001-03-03 23:54:42 +00:00
Marius Vollmer
1c54a87cb2 * tests/syntax.test ("duplicate formals"): New category, move
appropriate tests here.  Expect them to pass.
("empty parentheses"): Expect to pass, bug has been fixed.
2001-03-03 17:29:09 +00:00
Dirk Herrmann
08c608e10a * extracted the tests from exceptions.test into eval.test and syntax.test.
* added a few test cases.
2001-03-02 01:38:01 +00:00