On Sat, Aug 4, 2012 at 11:56 PM, Sean Corfield <seancorfi...@gmail.com>wrote:
> On Sat, Aug 4, 2012 at 11:45 PM, Mark Engelberg > <mark.engelb...@gmail.com> wrote: > > In any case, Clojure is already able to detect when x and y are equal in > > something like #{x y} and report it as an error. > > So do you think #{1 1} should not be an error? And {:a 1 :a 2}? These > seem like "obvious" programmer errors that I'd want the compiler to > catch. > > I can see the argument for the compiler flagging {:a 1 :a 2} as a likely programmer error and reporting a warning. But IMO such a thing shouldn't cause a program crash at runtime. Runtime crashes are bad. If such a thing were to occur as the result of some sort of dynamic runtime behavior, it is perfectly reasonable to assume that the standard map semantics should hold where the right-most occurrence of a key takes precedence. My opinion is that #{1 1} should not be an error. In math notation, with hundreds of years of precedence, {1, 1} = {1}. Nevertheless, the same argument as above about warning versus error could hold here as well. What do you feel is gained by making it a fatal error? In my view, in the case where you stick to only using constants in your set and map notation, the benefit is roughly the same either way -- such use is likely to be flagged on your first run of the code and can be fixed quickly and easily regardless of whether it is a warning or error. But when your set and map notation depends on some variable, a warning is much better than an error. -- 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