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

Changes from arch/CVS synchronization

This commit is contained in:
Ludovic Courtès 2007-07-24 23:17:54 +00:00
parent 7337d56d57
commit e08f3f7a30
6 changed files with 60 additions and 21 deletions

View file

@ -1,3 +1,7 @@
2007-07-25 Ludovic Courtès <ludo@gnu.org>
* NEWS: Mention bug fix for "(set! 'x #f)".
2007-07-22 Ludovic Courtès <ludo@gnu.org>
* configure.in: Check for <strings.h> and `strncasecmp ()'.

4
NEWS
View file

@ -42,6 +42,10 @@ Changes in 1.8.3 (since 1.8.2)
** `(srfi srfi-37)'
* Bugs fixed
** Expressions like "(set! 'x #t)" no longer yield a crash
Changes in 1.8.2 (since 1.8.1):

View file

@ -1,3 +1,9 @@
2007-07-25 Ludovic Courtès <ludo@gnu.org>
* eval.c (macroexp): When `scm_ilength (res) <= 0', return
immediately. This used to produce a circular memoized
expression, e.g., for `(set (quote x) #t)'.
2007-07-22 Ludovic Courtès <ludo@gnu.org>
Overhauled the reader, making it faster.

View file

@ -874,26 +874,29 @@ macroexp (SCM x, SCM env)
SCM_SETCAR (x, orig_sym); /* Undo memoizing effect of lookupcar */
res = scm_call_2 (SCM_MACRO_CODE (proc), x, env);
if (scm_ilength (res) <= 0)
res = scm_list_2 (SCM_IM_BEGIN, res);
/* Result of expansion is not a list. */
return (scm_list_2 (SCM_IM_BEGIN, res));
else
{
/* njrev: Several queries here: (1) I don't see how it can be
correct that the SCM_SETCAR 2 lines below this comment needs
protection, but the SCM_SETCAR 6 lines above does not, so
something here is probably wrong. (2) macroexp() is now only
used in one place - scm_m_generalized_set_x - whereas all other
macro expansion happens through expand_user_macros. Therefore
(2.1) perhaps macroexp() could be eliminated completely now?
(2.2) Does expand_user_macros need any critical section
protection? */
/* njrev: Several queries here: (1) I don't see how it can be
correct that the SCM_SETCAR 2 lines below this comment needs
protection, but the SCM_SETCAR 6 lines above does not, so
something here is probably wrong. (2) macroexp() is now only
used in one place - scm_m_generalized_set_x - whereas all other
macro expansion happens through expand_user_macros. Therefore
(2.1) perhaps macroexp() could be eliminated completely now?
(2.2) Does expand_user_macros need any critical section
protection? */
SCM_CRITICAL_SECTION_START;
SCM_SETCAR (x, SCM_CAR (res));
SCM_SETCDR (x, SCM_CDR (res));
SCM_CRITICAL_SECTION_END;
SCM_CRITICAL_SECTION_START;
SCM_SETCAR (x, SCM_CAR (res));
SCM_SETCDR (x, SCM_CDR (res));
SCM_CRITICAL_SECTION_END;
goto macro_tail;
goto macro_tail;
}
}
/* Start of the memoizers for the standard R5RS builtin macros. */

View file

@ -1,3 +1,10 @@
2007-07-25 Ludovic Courtès <ludo@gnu.org>
* tests/srfi-17.test (%some-variable): New.
(set!)[target uses macro]: New test prefix. The
"(set! (@@ ...) 1)" test is in accordance with Marius Vollmer's
change in `libguile' dated 2003-11-17.
2007-07-22 Ludovic Courtès <ludo@gnu.org>
* tests/reader.test: Added a proper header and `define-module'.
@ -140,7 +147,7 @@
* tests/numbers.test (*): Exercise multiply by exact 0 giving exact 0.
2006-12-12 Ludovic Courtès <ludovic.courtes@laas.fr>
2006-12-12 Ludovic Courtès <ludovic.courtes@laas.fr>
* tests/unif.test (syntax): New test prefix. Check syntax for
negative lower bounds and negative lengths (reported by Gyula
@ -167,7 +174,7 @@
ensure intended exact vs inexact is checked. Reported by Aaron
M. Ucko, Debian bug 396119.
2006-11-29 Ludovic Courtès <ludovic.courtes@laas.fr>
2006-11-29 Ludovic Courtès <ludovic.courtes@laas.fr>
* test-suite/tests/vectors.test: Use `define-module'.
(vector->list): New test prefix. "Shared array" test contributed
@ -187,7 +194,7 @@
* tests/environments.test: Comment out all tests in this file.
2006-10-26 Ludovic Courtès <ludovic.courtes@laas.fr>
2006-10-26 Ludovic Courtès <ludovic.courtes@laas.fr>
* tests/srfi-14.test (Latin-1)[char-set:punctuation]: Fixed a
typo: `thrown' instead of `throw'.

View file

@ -48,6 +48,8 @@
;; set!
;;
(define %some-variable #f)
(with-test-prefix "set!"
(with-test-prefix "target is not procedure with setter"
@ -58,7 +60,20 @@
(pass-if-exception "(set! '#f 1)"
exception:bad-variable
(eval '(set! '#f 1) (interaction-environment)))))
(eval '(set! '#f 1) (interaction-environment))))
(with-test-prefix "target uses macro"
(pass-if "(set! (@@ ...) 1)"
(eval '(set! (@@ (test-suite test-srfi-17) %some-variable) 1)
(interaction-environment))
(equal? %some-variable 1))
;; The `(quote x)' below used to be memoized as an infinite list before
;; Guile 1.8.3.
(pass-if-exception "(set! 'x 1)"
exception:bad-variable
(eval '(set! 'x 1) (interaction-environment)))))
;;
;; setter