I agree that this behavior diverges from Clojure's and that we probably
should have thought it through a bit more 2 years ago. But at this point
it's probably water under the bridge. Anybody that's actually relying on
this behavior is likely inlining named numeric constants to make jump
tables. The only semantic fuzzy area is if you want to match a symbol and
you have defined a constant with the exact same symbol or referred such a
constant in your namespace. But I suspect this requirement is esoteric
enough that nobody has reported such a problem in actual code in the last 2
years.

I believe I accidentally let it slip through since I don't think I'd ever
used `case` to match symbols myself and at the time I had not internalized
that symbols need not be quoted in this case (yes I know it says so in the
`case` docstring).

It's a strange historical quirk, but I also don't think the situation is
interesting or common enough to be very worked up about :)

David

On Sun, Jun 18, 2017 at 1:26 PM, Herwig Hochleitner <hhochleit...@gmail.com>
wrote:

> I was pretty horrified, when this crossed my timeline. Thanks, Phil, for
> starting this thread, because I'd already forgotten about it.
>
> First thing that seems strange, is, that the blog post is from 2015.
> Nevertheless, I just tried it on a nashorn repl:
>
> cljs.user> *clojurescript-version*
> "1.9.562"
> cljs.user> (case 2
>              x :X
>              :no-match)
> :no-match
> cljs.user> (case 'x
>              x :X
>              :no-match)
> :X
> cljs.user> (def ^:const x 2)
> #'cljs.user/x
> cljs.user> (case 2
>              x :X
>              :no-match)
> :X
> cljs.user> (case 'x
>              x :X
>              :no-match)
> :no-match
>
> 2017-06-18 16:37 GMT+02:00 Alex Miller <a...@puredanger.com>:
>
>> ... that seems wrong.
>>
>
> Yes, yes it does.
>
> --
> 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/d/optout.
>

-- 
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/d/optout.

Reply via email to