mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-29 22:40:34 +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:
parent
e979130b66
commit
0f509ab5e3
2 changed files with 24 additions and 15 deletions
|
@ -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 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)
|
||||
`(catch #t
|
||||
(lambda ()
|
||||
|
|
|
@ -41,7 +41,8 @@
|
|||
@bind
|
||||
error-catching-loop
|
||||
error-catching-repl
|
||||
scm-style-repl)
|
||||
scm-style-repl
|
||||
apply-to-args)
|
||||
|
||||
#: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
|
||||
better yet, use the repl from `(system repl 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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue