summaryrefslogtreecommitdiff
path: root/module/ice-9/deprecated.scm
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2010-06-11 13:24:14 +0200
committerAndy Wingo <wingo@pobox.com>2010-06-11 16:58:31 +0200
commit5c0450b2499f95410e844a6912fc40ffe949803a (patch)
tree518773fcf99e9e277e11ee14549f5983c9bd9b07 /module/ice-9/deprecated.scm
parent122f296ddc5cb879b10a97cd0775ee84bbdcb0d6 (diff)
downloadguile-5c0450b2499f95410e844a6912fc40ffe949803a.tar.gz
deprecate `collect'
* module/ice-9/boot-9.scm: * module/ice-9/deprecated.scm (collect): Deprecate, and fix to ensure sequential collection.
Diffstat (limited to 'module/ice-9/deprecated.scm')
-rw-r--r--module/ice-9/deprecated.scm21
1 files changed, 20 insertions, 1 deletions
diff --git a/module/ice-9/deprecated.scm b/module/ice-9/deprecated.scm
index 138f20ae7..7aeda3424 100644
--- a/module/ice-9/deprecated.scm
+++ b/module/ice-9/deprecated.scm
@@ -49,7 +49,8 @@
get-option
for-next-option
display-usage-report
- transform-usage-lambda)
+ transform-usage-lambda
+ collect)
#:replace (module-ref-submodule module-define-submodule!))
@@ -548,3 +549,21 @@ better yet, use the repl from `(system repl repl)'.")
(lambda (%opt %arg %new-argv)
(case %opt
,@ transmogrified-cases))))))))
+
+
+
+;;; {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* ...)))))))