Fix: If both AT BEGINNING and RESULT-TYPE are specified, RESULT-TYPE was ignored.
Wed May 9 15:54:35 PDT 2012 attila.lendvai@gmail.com
* Fix: If both AT BEGINNING and RESULT-TYPE are specified, RESULT-TYPE was ignored.
Patched by Ilya Perminov
diff -rN -u old-iterate/iterate.lisp new-iterate/iterate.lisp
--- old-iterate/iterate.lisp 2014-07-25 04:20:24.000000000 -0700
+++ new-iterate/iterate.lisp 2014-07-25 04:20:24.000000000 -0700
@@ -3174,7 +3174,10 @@
expr
(make-application end-operation collect-var expr)))))
(if (eq place 'start)
- (return-code :body `((setq ,collect-var ,op-expr)))
+ (return-code :body `((setq ,collect-var ,op-expr))
+ :final (unless (eq result-type 'list)
+ `((setq ,collect-var
+ (coerce ,collect-var ',result-type)))))
(with-temporary temp-var
;; In the update code, must test if collect-var is null to allow
;; for other clauses to collect into same var. This code