.
original commit: d7007424cc76e178b180319027077d53a885aa86
This commit is contained in:
parent
3d243cf37c
commit
85ebc45526
|
@ -11,9 +11,9 @@
|
|||
|
||||
(define (xl) 1)
|
||||
(define (xu) (unit (import) (export)))
|
||||
(define (xc) (class '() ()))
|
||||
(define (xc) (class object% () (sequence (super-init))))
|
||||
|
||||
(begin
|
||||
(init
|
||||
(define-struct test (value constructor-sexp
|
||||
whole/frac-constructor-sexp
|
||||
shared-constructor-sexp
|
||||
|
|
|
@ -380,25 +380,29 @@
|
|||
|
||||
; Units and objects combined:
|
||||
|
||||
(define u@
|
||||
(define u@
|
||||
(unit (import x) (export)
|
||||
(class* () () () (public (y x)))))
|
||||
(class* object% () ()
|
||||
(public (y x))
|
||||
(sequence (super-init)))))
|
||||
(define v (invoke-unit u@ car))
|
||||
(test #t class? v)
|
||||
(define w (make-object v))
|
||||
(test car 'ivar (ivar w y))
|
||||
|
||||
(define c%
|
||||
(class* () () (x)
|
||||
(public (z (unit (import) (export) x)))))
|
||||
(define c%
|
||||
(class* object% () (x)
|
||||
(public (z (unit (import) (export) x)))
|
||||
(sequence (super-init))))
|
||||
(define u (ivar (make-object c% car) z))
|
||||
(test #t unit? u)
|
||||
(test car 'invoke (invoke-unit u))
|
||||
|
||||
|
||||
(define c%
|
||||
(class* () () (x) (public (y x))
|
||||
(public (z (unit (import) (export) y)))))
|
||||
(define c%
|
||||
(class* object% () (x) (public (y x))
|
||||
(public (z (unit (import) (export) y)))
|
||||
(sequence (super-init))))
|
||||
(define u (make-object c% 3))
|
||||
(define u2 (ivar u z))
|
||||
(test #t unit? u2)
|
||||
|
|
Loading…
Reference in New Issue
Block a user