[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: identity
From: |
Marius Vollmer |
Subject: |
Re: identity |
Date: |
15 Apr 2001 18:27:27 +0200 |
User-agent: |
Gnus/5.0803 (Gnus v5.8.3) Emacs/20.7 |
Keisuke Nishida <address@hidden> writes:
> We could write a macro `define-duplicate' or something that
> produces the above code. Should we do that?
Yes, why not. As you say, `define-duplicate' is too specific, what
about
(define deprecate
(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-macro (with-deprecation msg . body)
`(deprecate ,msg (lambda () ,@body)))
It would be used like
(define (id x)
(with-deprecation
"`id' is deprecated. Use `identity' instead."
(identity x)))
- identity, Keisuke Nishida, 2001/04/12
- Re: identity, Marius Vollmer, 2001/04/13
- Re: identity, Keisuke Nishida, 2001/04/13
- Re: identity, Marius Vollmer, 2001/04/13
- Re: identity, Keisuke Nishida, 2001/04/13
- Re: identity, Marius Vollmer, 2001/04/14
- Re: identity, Keisuke Nishida, 2001/04/14
- Re: identity, Keisuke Nishida, 2001/04/14
- Re: identity,
Marius Vollmer <=
- Re: identity, Keisuke Nishida, 2001/04/15
- Re: identity, Marius Vollmer, 2001/04/15