mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-11 06:20:23 +02:00
deprecate `collect'
* module/ice-9/boot-9.scm: * module/ice-9/deprecated.scm (collect): Deprecate, and fix to ensure sequential collection.
This commit is contained in:
parent
122f296ddc
commit
5c0450b249
2 changed files with 20 additions and 14 deletions
|
@ -2837,19 +2837,6 @@ module '(ice-9 q) '(make-q q-length))}."
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;;; {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))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;;; {While}
|
;;; {While}
|
||||||
;;;
|
;;;
|
||||||
;;; with `continue' and `break'.
|
;;; with `continue' and `break'.
|
||||||
|
|
|
@ -49,7 +49,8 @@
|
||||||
get-option
|
get-option
|
||||||
for-next-option
|
for-next-option
|
||||||
display-usage-report
|
display-usage-report
|
||||||
transform-usage-lambda)
|
transform-usage-lambda
|
||||||
|
collect)
|
||||||
|
|
||||||
#:replace (module-ref-submodule module-define-submodule!))
|
#: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)
|
(lambda (%opt %arg %new-argv)
|
||||||
(case %opt
|
(case %opt
|
||||||
,@ transmogrified-cases))))))))
|
,@ 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* ...)))))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue