Remove mred/private/kw.rkt

This handled init argument inheritance for class100, but
all uses of it have now been removed.
This commit is contained in:
Asumu Takikawa 2012-05-26 10:29:35 -04:00
parent cfe1711494
commit 05394aff7e
9 changed files with 0 additions and 73 deletions

View File

@ -1,65 +0,0 @@
(module kw mzscheme
(require mzlib/class100)
(provide (protect define-keywords
class100*/kw))
;; ---------------- Keyword propagation macros -------------------
;; Since we use class100 to construct the classes that users see,
;; keywords are not propagated by position automatically. So we use
;; the class100*/kw macro for every class exported to the user; it
;; explicitly includes all keywords supported through superclasses.
;; To avoid writing the same keyword sets over and over, we have
;; a define-keywords form.
;; Arguably, this is making a problem (using `class100' instead of
;; `class') worse as much as it solves the problem. Or maybe the
;; problem is trying to hard to make by-position and by-name
;; initialization work.
(define-syntax (define-keywords stx)
(syntax-case stx ()
[(_ name kw ...)
(with-syntax ([(kw2 ...)
(apply
append
(map (lambda (kw)
(if (identifier? kw)
(syntax-local-value kw)
(list kw)))
(syntax->list #'(kw ...))))])
#'(define-syntax name '(kw2 ...)))]))
(define-syntax (class100*/kw stx)
(syntax-case stx ()
[(_ base (intf ...) ((base-init ...) keywords post-init ...) . rest)
(let ([kws (syntax-local-value #'keywords)])
(with-syntax ([super-init (datum->syntax-object
stx
'super-init
stx)]
[(new-keyword ...) (map car kws)]
[(new-init ...) (datum->syntax-object
stx
kws)])
#'(let-syntax ([super-init
(lambda (sstx)
(syntax-case sstx ()
[(_ arg (... ...))
(with-syntax ([super-instantiate
(datum->syntax-object
sstx
'super-instantiate
sstx)]
[(new-kw (... ...))
(map (lambda (x)
(datum->syntax-object
sstx
x))
'(new-keyword ...))])
#'(super-instantiate (arg (... ...))
[new-kw new-kw] (... ...)))]))])
(class100*
base (intf ...) (base-init ... new-init ... post-init ...)
. rest))))])))

View File

@ -5,7 +5,6 @@
(prefix-in wx: "kernel.rkt")
"lock.rkt"
"const.rkt"
"kw.rkt"
"helper.rkt"
"check.rkt"
"wx.rkt"

View File

@ -7,7 +7,6 @@
"helper.rkt"
"const.rkt"
"wx.rkt"
"kw.rkt"
"check.rkt"
"wxcontainer.rkt"
"mrwindow.rkt")

View File

@ -5,7 +5,6 @@
(prefix-in wx: "kernel.rkt")
"lock.rkt"
"const.rkt"
"kw.rkt"
"gdi.rkt"
"check.rkt"
"helper.rkt"

View File

@ -7,7 +7,6 @@
"check.rkt"
"helper.rkt"
"wx.rkt"
"kw.rkt"
"wxpanel.rkt"
"mrwindow.rkt"
"mrcontainer.rkt")

View File

@ -7,7 +7,6 @@
"check.rkt"
"helper.rkt"
"wx.rkt"
"kw.rkt"
"wxtextfield.rkt"
"mrcontainer.rkt"
"mritem.rkt"

View File

@ -6,7 +6,6 @@
"lock.rkt"
"helper.rkt"
"const.rkt"
"kw.rkt"
"check.rkt"
"wx.rkt"
"wxtop.rkt"

View File

@ -6,7 +6,6 @@
"const.rkt"
"check.rkt"
"wx.rkt"
"kw.rkt"
"wxwindow.rkt"
"mrpopup.rkt")

View File

@ -7,7 +7,6 @@
"lock.rkt"
"helper.rkt"
"const.rkt"
"kw.rkt"
"check.rkt"
"wx.rkt"
"wxwindow.rkt"