changeset: 5414:70b15ac66ee5
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Thu Feb 10 08:46:10 2011 +0000
files: src/ChangeLog src/fns.c tests/ChangeLog tests/automated/lisp-tests.el
description:
Correct a bug with circularity checking in #'mapcar*, #'map, etc.
src/ChangeLog addition:
2011-02-10 Aidan Kehoe <kehoea(a)parhasard.net>
* fns.c (shortest_length_among_sequences):
This was buggy, it always errored if the last argument was
circular, even if other arguments were non-circular. Correct that.
tests/ChangeLog addition:
2011-02-10 Aidan Kehoe <kehoea(a)parhasard.net>
* automated/lisp-tests.el:
* automated/lisp-tests.el (mapcar*):
If multiple SEQUENCE arguments are passed to #'mapcar*, and the
last one is circular while the others aren't, make sure that
#'mapcar* doesn't error.
diff -r 22c4e67a2e69 -r 70b15ac66ee5 src/ChangeLog
--- a/src/ChangeLog Wed Feb 09 20:15:50 2011 +0000
+++ b/src/ChangeLog Thu Feb 10 08:46:10 2011 +0000
@@ -1,3 +1,9 @@
+2011-02-10 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * fns.c (shortest_length_among_sequences):
+ This was buggy, it always errored if the last argument was
+ circular, even if other arguments were non-circular. Correct that.
+
2011-02-09 Aidan Kehoe <kehoea(a)parhasard.net>
* alloc.c (Facons):
diff -r 22c4e67a2e69 -r 70b15ac66ee5 src/fns.c
--- a/src/fns.c Wed Feb 09 20:15:50 2011 +0000
+++ b/src/fns.c Thu Feb 10 08:46:10 2011 +0000
@@ -7145,7 +7145,7 @@
static Elemcount
shortest_length_among_sequences (int nsequences, Lisp_Object *sequences)
{
- Elemcount len = EMACS_INT_MAX;
+ Elemcount len = 1 + EMACS_INT_MAX;
Lisp_Object length = Qnil;
int i;
@@ -7167,7 +7167,7 @@
}
}
- if (NILP (length))
+ if (len == 1 + EMACS_INT_MAX)
{
signal_circular_list_error (sequences[0]);
}
diff -r 22c4e67a2e69 -r 70b15ac66ee5 tests/ChangeLog
--- a/tests/ChangeLog Wed Feb 09 20:15:50 2011 +0000
+++ b/tests/ChangeLog Thu Feb 10 08:46:10 2011 +0000
@@ -1,3 +1,11 @@
+2011-02-10 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * automated/lisp-tests.el:
+ * automated/lisp-tests.el (mapcar*):
+ If multiple SEQUENCE arguments are passed to #'mapcar*, and the
+ last one is circular while the others aren't, make sure that
+ #'mapcar* doesn't error.
+
2011-02-07 Aidan Kehoe <kehoea(a)parhasard.net>
* automated/lisp-tests.el:
diff -r 22c4e67a2e69 -r 70b15ac66ee5 tests/automated/lisp-tests.el
--- a/tests/automated/lisp-tests.el Wed Feb 09 20:15:50 2011 +0000
+++ b/tests/automated/lisp-tests.el Thu Feb 10 08:46:10 2011 +0000
@@ -1045,6 +1045,12 @@
(setcdr (cdr x) 42)) ; drop a brick wall onto the freeway
(car y))
x)))
+
+(Assert
+ (equal
+ (let ((list (list pi))) (mapcar* #'cons [1 2 3 4] (nconc list list)))
+ `((1 . ,pi) (2 . ,pi) (3 . ,pi) (4 . ,pi)))
+ "checking mapcar* behaves correctly when only one arg is circular")
(Assert (eql
(length (multiple-value-list
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches