[racket] CLOS-like multiple dispatch over types

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Mon Feb 3 10:54:06 EST 2014

Hi Roman,

Regarding the package site... I can't find a log entry for your
account creation attempt. Is it possible you can send me the output of
the Javascript console? Maybe you didn't type in the same password
twice or something and the request never left your browser?

Jay

On Mon, Feb 3, 2014 at 8:23 AM, Roman Klochkov <kalimehtar at mail.ru> wrote:
>
> I've ported little collection for making CLOS-like generics
> https://github.com/Kalimehtar/gls
>
> It gives you possibility to make generics over any predicates or
> racket/class classes:
>
> Example (impossible in swindle):
>
> (define (fact x)
>   (defgeneric fact0
>     (method ((n (and? <integer> (<=/c 1))) (acc <integer>))
>             acc)
>     (method ((n <integer>) (acc <integer>))
>             (fact0 (- n 1) (* acc n))))
>   (fact0 x 1))
>
> You may add methods dynamically:
> (defgeneric g)
> (add-method g (method ((x frame%)) (do-something-with-frame x ...)))
> (add-method g (method ((x button%)) (do-something-with-button x ...)))
>
> More examples in https://github.com/Kalimehtar/gls/blob/master/gls/test.rkt
>
> P. S. Can't add it to pkg.racket-lang.org. Press "login" then "Log in", but
> no email. :-(
>
> --
> Roman Klochkov
>
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users
>



-- 
Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University
http://faculty.cs.byu.edu/~jay

"The glory of God is Intelligence" - D&C 93

Posted on the users mailing list.