Why is :1 === 1?

julia> :1 === 1
true

I don’t know what else it would be, but why that?

1 Like

People sometimes think of : as the symbol operator as in :abc, but it’s actually the quote operator, and integers are literals. See e.g. CSE341 Lecture Notes 14: Scheme: Quote, Quasiquote, and Metaprogramming for more information on quotes.

10 Likes

Related:
https://github.com/JuliaLang/julia/issues/43054

1 Like