mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-06 07:30:28 +02:00
* boot-9.scm (call-with-deprecation): New procedure.
(identity): New procedure. (id): Deprecated.
This commit is contained in:
parent
8add1522ae
commit
6b08d75b56
2 changed files with 26 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2001-04-15 Keisuke Nishida <kxn30@po.cwru.edu>
|
||||||
|
|
||||||
|
* boot-9.scm (call-with-deprecation): New procedure.
|
||||||
|
(identity): New procedure.
|
||||||
|
(id): Deprecated.
|
||||||
|
|
||||||
2001-04-15 Keisuke Nishida <kxn30@po.cwru.edu>
|
2001-04-15 Keisuke Nishida <kxn30@po.cwru.edu>
|
||||||
|
|
||||||
* boot-9.scm (defmacro, define-macro, define-syntax-macro):
|
* boot-9.scm (defmacro, define-macro, define-syntax-macro):
|
||||||
|
|
|
@ -87,7 +87,7 @@
|
||||||
;;; {Trivial Functions}
|
;;; {Trivial Functions}
|
||||||
;;;
|
;;;
|
||||||
|
|
||||||
(define (id x) x)
|
(define (identity x) x)
|
||||||
(define (1+ n) (+ n 1))
|
(define (1+ n) (+ n 1))
|
||||||
(define (-1+ n) (+ n -1))
|
(define (-1+ n) (+ n -1))
|
||||||
(define 1- -1+)
|
(define 1- -1+)
|
||||||
|
@ -109,6 +109,25 @@
|
||||||
|
|
||||||
(define (apply-to-args args fn) (apply fn args))
|
(define (apply-to-args args fn) (apply fn args))
|
||||||
|
|
||||||
|
|
||||||
|
;;; {Deprecation}
|
||||||
|
;;;
|
||||||
|
|
||||||
|
(define call-with-deprecation
|
||||||
|
(let ((issued-warnings (make-hash-table 13)))
|
||||||
|
(lambda (msg thunk)
|
||||||
|
(cond ((not (hashv-ref issued-warnings msg #f))
|
||||||
|
(display ";;; " (current-error-port))
|
||||||
|
(display msg (current-error-port))
|
||||||
|
(newline (current-error-port))
|
||||||
|
(hashv-set! issued-warnings msg #t)))
|
||||||
|
(thunk))))
|
||||||
|
|
||||||
|
(define (id x)
|
||||||
|
(call-with-deprecation "`id' is deprecated. Use `identity' instead."
|
||||||
|
(lambda ()
|
||||||
|
(identity x))))
|
||||||
|
|
||||||
|
|
||||||
;;; {Integer Math}
|
;;; {Integer Math}
|
||||||
;;;
|
;;;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue