Re: How to port a mixin to clojure

2009-02-11 Thread David Nolen
There are quite a few ways to do what you're describing (and no particular prescribed way). You want to look at multimethods and tag hierarchies. http://clojure.org/multimethods Tags can have multiple parents. I'm working on a project called Spinoza (search the mailing list for that and CLJOS) w

Re: How to port a mixin to clojure

2009-02-11 Thread Chas Emerick
I'm not sure I would call that a mixin -- really, all that's going on is Python is allowing you to call any function, anywhere. In a language like Scala that does have what I'd consider "real" mixins (traits over there), then on_key_down would become a function available in TableWidget's

How to port a mixin to clojure

2009-02-11 Thread Jesse Aldridge
I'm trying to re-implement some python stuff in clojure. Here's how it works: I have a class called ArrowKeySelection. I use this class as a mixin with various gui classes. The class adds some abstract logic for handling keys - the arrow keys move a selector around a matrix and the enter key