Now mixins also show up as being bound appropriately. I also removed the

old honu:type function that has no use now that I'm doing things the
"right" way.

svn: r342
This commit is contained in:
Stevie Strickland 2005-07-05 01:54:21 +00:00
parent 2feaff9d19
commit 73b1b12558
4 changed files with 11 additions and 12 deletions

View File

@ -9,13 +9,6 @@
(error "Attempt to access member of null")
(send obj msg arg ...))]))
;; We just use this so that Check Syntax correctly matches up
;; types that don't appear otherwise. Yes, this is a hack.
;; For obvious reasons, this can't just be a macro that ignores
;; its arguments, but must instead be a _function_ that ignores them.
(define (honu:type . types)
(void))
(define null%
(class object%
(inspect #f)

View File

@ -50,8 +50,10 @@
(map (lambda (e)
(translate-type-for-syntax (honu:export-type e)))
exports))]
[(struct honu:subclass (_ _ _ _))
'()]))
[(struct honu:subclass (_ _ _ mixin))
;; okay, this isn't a type, but we still want to see it as a use
;; until we can translate mixins correctly.
(list (translate-mixin-name mixin))]))
(define (build-unwanted-type-syntax-member-decl member)
(match member

View File

@ -63,7 +63,7 @@
value)])
,(cons 'values (grab-indices names)))))
(provide translate-iface-name translate-class-name translate-method-name
(provide translate-iface-name translate-class-name translate-mixin-name translate-method-name
translate-field-getter-name translate-field-setter-name)
(define (translate-iface-name type)
(let ([name (if (honu:type-iface-top? type)
@ -73,6 +73,8 @@
(define (translate-class-name class)
(at class (string->symbol (string-append (symbol->string (syntax-e class)) "%"))))
(define (translate-mixin-name mixin)
(at mixin (string->symbol (string-append (symbol->string (syntax-e mixin)) "-mixin"))))
(define (translate-method-name type name)
(at name (string->symbol (string-append (symbol->string (syntax-e (translate-iface-name type)))

View File

@ -26,8 +26,6 @@
[(null? defns-to-go)
(cons (build-unwanted-type-syntax defns)
(reverse syntaxes))]
[(honu:mixin? (car defns-to-go))
(loop (cdr defns-to-go) syntaxes)]
[(honu:subclass? (car defns-to-go))
(let ([mixin (find (lambda (d)
(and (honu:mixin? d)
@ -77,6 +75,10 @@
,(translate-impl-method impls)
,(translate-formatter name members)
(super-new))))]
[(struct honu:mixin (stx name _ _ _ _ _ _ _ _ _ _))
;; just a dummy definition to get the bindings set up correctly
(at stx `(define ,(translate-mixin-name name)
'()))]
[else (raise-read-error-with-stx
"Haven't translated that type of definition yet."
(honu:ast-stx defn))]))