Hi Lee,

On Thu, Sep 16, 2010 at 5:15 AM, Lee Spector <lspec...@hampshire.edu> wrote:

> Also, this would have a smaller impact but I'm curious about it: is there a
> way to treat method names as data and then make calls to them, as one can
> with clojure functions? Then I could pass things like fillRect, or map rect
> to fillRect, etc. This would make things slightly simpler here but be handy
> in other cases... but I don't see how to do it.
>

There's memfn but its usage is discouraged as one should favor #() but in
this case #(.fillRect %1 %2 %3 %4 %5) looks ugly. A macro can ease the pain
though.

About your code, it's nitpicking but you should use keywords instead of
quoted symbols.
You could also define render-shape to be backed by a multi-method to be able
to add new custom shapes but it won't minimize the tool.

hth,

Christophe

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to