5 ms·
< and > are comparison operators for checking if something is less than or greater than something else. This is okay in a static language where there are speci
by eigenspace 6y ago
< and > are comparison operators for checking if something is less than or greater than something else.
This is okay in a static language where there are special slots for a type where only a restricted subset of things can happen. You'd know at the parser level that the < and > are referring to the type meaning or the operator meaning.
In julia, types are values and values can live in types, and arbtrary operations can happen in a type.
E.g. I can write Tuple{1 < 2} which just becomes the type Tuple{true}, i.e. a Tuple Type with paramemter True.
- skohan 6y agoI feel like this is a solvable problem. For instance you could require parens in the case of expressions using < or > characters.
- eigenspace 6y agoOr you could just not use them for type parameters. That's also a solution for what it's worth. I think the curly braces look better as type params anyways imo.