Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What's the difference to you for using {} vs <>?


< 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.


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: