[racket] Best practices for classes

From: Matthew Butterick (mb at mbtype.com)
Date: Thu Oct 2 18:21:49 EDT 2014

What's the best approach to:

+ defining a class whose instances can be used as procedures?

(define ci (new proc-class%))
(ci arg arg2 ... )

+ ... whose instances can be used as lists (or at least support direct iteration?)

(define li (new listish-class%))
(for-each displayln li)
(map ci li)

My intuition is "implement a generic interface..." But then it gets hazy. 





Posted on the users mailing list.