* module/ice-9/boot-9.scm:
* module/ice-9/deprecated.scm (collect): Deprecate, and fix to ensure
sequential collection.
\f
-;;; {collect}
-;;;
-;;; Similar to `begin' but returns a list of the results of all constituent
-;;; forms instead of the result of the last form.
-;;; (The definition relies on the current left-to-right
-;;; order of evaluation of operands in applications.)
-;;;
-
-(defmacro collect forms
- (cons 'list forms))
-
-\f
-
;;; {While}
;;;
;;; with `continue' and `break'.
get-option
for-next-option
display-usage-report
- transform-usage-lambda)
+ transform-usage-lambda
+ collect)
#:replace (module-ref-submodule module-define-submodule!))
(lambda (%opt %arg %new-argv)
(case %opt
,@ transmogrified-cases))))))))
+
+\f
+
+;;; {collect}
+;;;
+;;; Similar to `begin' but returns a list of the results of all constituent
+;;; forms instead of the result of the last form.
+;;;
+
+(define-syntax collect
+ (lambda (x)
+ (issue-deprecation-warning
+ "`collect' is deprecated. Define it yourself.")
+ (syntax-case x ()
+ ((_) #''())
+ ((_ x x* ...)
+ #''(let ((val x))
+ (cons val (collect x* ...)))))))