diff options
| author | Noam Postavsky | 2020-04-30 07:54:49 -0400 |
|---|---|---|
| committer | Noam Postavsky | 2020-05-07 08:23:56 -0400 |
| commit | de7158598fcd5440c0180ff6f83052c29e490bcd (patch) | |
| tree | 8e0c7b89a7c0e6b738228a9b4cba3708bd9d8afe /test | |
| parent | 2c905fb8a1d95a72e4b8a9b138458c86b099ced1 (diff) | |
| download | emacs-de7158598fcd5440c0180ff6f83052c29e490bcd.tar.gz emacs-de7158598fcd5440c0180ff6f83052c29e490bcd.zip | |
Revert "cl-loop: Calculate the array length just once"
It fails when using 'and' (parallel bindings) for arrays (Bug#40727).
* lisp/emacs-lisp/cl-macs.el (cl--parse-loop-clause): Revert to
recomputing array length.
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs-loop-and-arrays): New
test.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/emacs-lisp/cl-macs-tests.el | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/cl-macs-tests.el b/test/lisp/emacs-lisp/cl-macs-tests.el index 9ca84f156a0..77609a42a99 100644 --- a/test/lisp/emacs-lisp/cl-macs-tests.el +++ b/test/lisp/emacs-lisp/cl-macs-tests.el | |||
| @@ -39,6 +39,12 @@ | |||
| 39 | collect (list c b a)) | 39 | collect (list c b a)) |
| 40 | '((4.0 2 1) (8.3 6 5) (10.4 9 8))))) | 40 | '((4.0 2 1) (8.3 6 5) (10.4 9 8))))) |
| 41 | 41 | ||
| 42 | (ert-deftest cl-macs-loop-and-arrays () | ||
| 43 | "Bug#40727" | ||
| 44 | (should (equal (cl-loop for y = (- (or x 0)) and x across [1 2] | ||
| 45 | collect (cons x y)) | ||
| 46 | '((1 . 0) (2 . -1))))) | ||
| 47 | |||
| 42 | (ert-deftest cl-macs-loop-destructure () | 48 | (ert-deftest cl-macs-loop-destructure () |
| 43 | (should (equal (cl-loop for (a b c) in '((1 2 4.0) (5 6 8.3) (8 9 10.4)) | 49 | (should (equal (cl-loop for (a b c) in '((1 2 4.0) (5 6 8.3) (8 9 10.4)) |
| 44 | collect (list c b a)) | 50 | collect (list c b a)) |