<HTML><BODY><br>I've ported little collection for making CLOS-like generics <a href="https://github.com/Kalimehtar/gls" data-mce-href="https://github.com/Kalimehtar/gls">https://github.com/Kalimehtar/gls</a><br><br>It gives you possibility to make generics over any predicates or racket/class classes:<br><br>Example (impossible in swindle):<br><br>(define (fact x)<br> (defgeneric fact0<br> (method ((n (and? <integer> (<=/c 1))) (acc <integer>))<br> acc)<br> (method ((n <integer>) (acc <integer>))<br> (fact0 (- n 1) (* acc n))))<br> (fact0 x 1))<br><br>You may add methods dynamically:<br>(defgeneric g)<br>(add-method g (method ((x frame%)) (do-something-with-frame x ...)))<br>(add-method g (method ((x button%)) (do-something-with-button x ...)))<br><br>More examples in <a href="https://github.com/Kalimehtar/gls/blob/master/gls/test.rkt" data-mce-href="https://github.com/Kalimehtar/gls/blob/master/gls/test.rkt">https://github.com/Kalimehtar/gls/blob/master/gls/test.rkt</a><br><br>P. S. Can't add it to pkg.racket-lang.org. Press "login" then "Log in", but no email. :-(<br><br>-- <br>Roman Klochkov</BODY></HTML>