Hello !
[english is not my native language. So if you don’t understand, tell me, I’ll try to say otherwise]
First, thanks to all Julia’s developpers. I discovered this language yesterday, and I find it really nice !
Second, I’m reading the doc, and have beginner questions,
Is there a difference between same_type(x::T,y::T) where T = true and same_type(x::T,y::T) where {T} = true ? I tried both and it seems to me that they work same.
Does there exist in Julia user-defined infix operators ?
With just one type var, the two are identical. The curly braces are a convenient shorthand when you have more than one variable — it’s just where {T,S} instead of where S where T.
It also makes it a bit easier for me to read where {T} = ... since otherwise my brain wants to make it seem like you’re assigning the function body to just T.
Oh and as to your second question, there’s a limited number of names that can be used as infix operators, but all of them can be used for your own purposes. See Mathematical Operations and Elementary Functions · The Julia Language (and the link to parser.scm) for the list and precedences.
You can’t invent your own symbols entirely, but you can choose from a long list of existing unicode symbols — check the parser.scm link. Most of these have no existing operator meaning.