The following quote is an excerpt from the latest version of the manual:
(Equivalently, one could define function norm{T<:Real}(p::Point{T})
or function norm(p::Point{T} where T<:Real)
; see UnionAll Types.)
Notice how the where
clause lies inside the parentheses specifying the function arguments in this example. Elsewhere in the manual, the where
clause always seems to be after the parentheses. Is this a typo in the manual, or is the where-clause allowed inside? Is there a distinction in meaning for inside versus outside? I tried to put the where-clause inside the parentheses (next to the parameterized argument) in my own code. I didn’t get a syntax error, but I did get an error at run-time about an undefined type.