1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-30 15:00:21 +02:00

deprecate apply-to-args

* module/ice-9/boot-9.scm:
* module/ice-9/deprecated.scm (apply-to-args): Deprecate.
This commit is contained in:
Andy Wingo 2010-06-10 23:55:35 +02:00
parent e979130b66
commit 0f509ab5e3
2 changed files with 24 additions and 15 deletions

View file

@ -524,20 +524,6 @@ If there is no handler at all, Guile prints an error and then exits."
(define (and=> value procedure) (and value (procedure value))) (define (and=> value procedure) (and value (procedure value)))
(define call/cc call-with-current-continuation) (define call/cc call-with-current-continuation)
;;; apply-to-args is functionally redundant with apply and, worse,
;;; is less general than apply since it only takes two arguments.
;;;
;;; On the other hand, apply-to-args is a syntacticly convenient way to
;;; perform binding in many circumstances when the "let" family of
;;; of forms don't cut it. E.g.:
;;;
;;; (apply-to-args (return-3d-mouse-coords)
;;; (lambda (x y z)
;;; ...))
;;;
(define (apply-to-args args fn) (apply fn args))
(defmacro false-if-exception (expr) (defmacro false-if-exception (expr)
`(catch #t `(catch #t
(lambda () (lambda ()

View file

@ -41,7 +41,8 @@
@bind @bind
error-catching-loop error-catching-loop
error-catching-repl error-catching-repl
scm-style-repl) scm-style-repl
apply-to-args)
#:replace (module-ref-submodule module-define-submodule!)) #:replace (module-ref-submodule module-define-submodule!))
@ -372,3 +373,25 @@ Find it in the `(ice-9 scm-style-repl)' module instead.")
Find it in the `(ice-9 scm-style-repl)' module instead, or Find it in the `(ice-9 scm-style-repl)' module instead, or
better yet, use the repl from `(system repl repl)'.") better yet, use the repl from `(system repl repl)'.")
((@ (ice-9 scm-style-repl) scm-style-repl))) ((@ (ice-9 scm-style-repl) scm-style-repl)))
;;; Apply-to-args had the following comment attached to it in boot-9, but it's
;;; wrong-headed: in the mentioned case, a point should either be a record or
;;; multiple values.
;;;
;;; apply-to-args is functionally redundant with apply and, worse,
;;; is less general than apply since it only takes two arguments.
;;;
;;; On the other hand, apply-to-args is a syntacticly convenient way to
;;; perform binding in many circumstances when the "let" family of
;;; of forms don't cut it. E.g.:
;;;
;;; (apply-to-args (return-3d-mouse-coords)
;;; (lambda (x y z)
;;; ...))
;;;
(define (apply-to-args args fn)
(issue-deprecation-warning
"`apply-to-args' is deprecated. Include a local copy in your program.")
(apply fn args))