Re: class and case

2017-05-13 Thread Timothy Baldridge
Using a protocol is probably the optimal choice, since it also opens up the dispatch allowing for extension without modifying exiting code. Downstream users of your library can add extensions to your code without having to create a patch. On Sat, May 13, 2017 at 7:43 AM, Alex Miller wrote: > O

Re: class and case

2017-05-13 Thread Alex Miller
Or case on (.getName the-class). -- 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 fro

Re: class and case

2017-05-12 Thread John Mastro
Kevin Kleinfelter wrote: > Can someone help me get un-stuck with a problem of using class in a case? > > This returns true, as I expect: > (= (type "x") java.lang.String) > > This returns an error, and I'd hoped it would print STRING: > (case (type "x") > class java.lang.String (println "STRING")