To do it with case, you'd need to wrap case in a macro that expanded to `(case ~thingy ~(eval case1) ...) or something along those lines, with the evals snapping lookups like FetcherEvent/EVENT_TYPE_FEED_POLLED to the associated constants. This will have the effect of classloading the class with the constants at macroexpansion time, but that's likely happening anyway if you're importing that class.
On Mon, Dec 30, 2013 at 9:07 AM, Paul Butcher <p...@paulbutcher.com> wrote: > On 30 Dec 2013, at 13:57, Nicola Mometto <brobro...@gmail.com> wrote: > > The test clauses of case expressions are not evaluated, so that case is > trying to "match" the symbol 'FetcherEvent/EVENT_TYPE_FEED_POLLED, not > the value of FetcherEvent/EVENT_TYPE_FEED_POLLED. > > > Ah - I was aware of the requirement for the constants to be compile-time > literals, but assumed that give that they were final static Strings, that > would work. Obviously not. > > Is there any way to achieve the effect I'm after with case? Or do I need > to switch to condp? > > -- > paul.butcher->msgCount++ > > Silverstone, Brands Hatch, Donington Park... > Who says I have a one track mind? > > http://www.paulbutcher.com/ > LinkedIn: http://www.linkedin.com/in/paulbutcher > Skype: paulrabutcher > > -- > -- > 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 > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > -- -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.