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

I think a language should either have operators, or it should not.

There's a decent case for not having operators at all. Lisp being a fine example of this. Everything is a function, end of story.

But once you have operators, what's the rationale for restricting them to built-in types? This, to me, fundamentally makes no more sense than, say, banning user-created types altogether.

Clearly nothing needs operator overloading, but if you have operators at all, why should "a + b" be valid if and only if a and b are certain language primitives? If you think + should only be used for numeric addition, I'd totally agree, but numeric types don't have to be restricted to built-in ones.



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

Search: