all forms must work

This commit is contained in:
2025-07-03 16:58:41 +02:00
parent 11dd6e8ce3
commit a565f0a6a0
2 changed files with 17 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
#lang info #lang info
(define pkg-authors '(hnmdijkema)) (define pkg-authors '(hnmdijkema))
(define version "0.3") (define version "0.4")
(define license 'Apache-2.0) (define license 'Apache-2.0)
(define collection "roos") (define collection "roos")
(define pkg-desc "An OO Framework for Racket") (define pkg-desc "An OO Framework for Racket")

View File

@@ -153,13 +153,27 @@
'@is-a-roos-class '@is-a-roos-class
(if (eq? (car arg) '@roos-classname@) (if (eq? (car arg) '@roos-classname@)
(@roos-classname at ...) (@roos-classname at ...)
(apply (@roos-caller at ...) arg)))))))) (apply (@roos-caller at ...) arg))))))
((_ (a . bb) (at ... . atb) self (supers ...) b ...)
(define (a . arg)
(roos1 (at ... . atb) self (supers ...) b ...)
(if (null? arg)
(a)
(if (eq? (car arg) '@roos-class?)
'@is-a-roos-class
(if (eq? (car arg) '@roos-classname@)
(@roos-classname at ... . atb)
(apply (@roos-caller at ... . atb) arg))))))
))
(define-syntax roos (define-syntax roos
(syntax-rules () (syntax-rules ()
((_ (a ...) self (supers ...) b ...) ((_ (a ...) self (supers ...) b ...)
(@roos-top (a ...) (a ...) self (supers ...) b ...)))) (@roos-top (a ...) (a ...) self (supers ...) b ...))
((_ (a ... . b) self (supers ...) c ...)
(@roos-top (a ... . b) (a ... . b) self (supers ...) c ...))
))
(define (roos-class? cl) (define (roos-class? cl)