Re:Swift for TensorFlow Shuts Down
by skohan on Friday February 12, 2021 @08:34PM
(#26120657)
What's the difference to you for using {} vs <>?
[ Parent
| on HN ]
Re:Swift for TensorFlow Shuts Down
by eigenspace on Friday February 12, 2021 @09:01PM
(#26120784)
< 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.
I feel like this is a solvable problem. For instance you could require parens in the case of expressions using < or > characters.
Re:Swift for TensorFlow Shuts Down
by eigenspace on Saturday February 13, 2021 @12:13PM
(#26124846)
Or 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.