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

Why are people so insistent on having unary minus? In my experience, "0-whatever" is just as good as "-whatever" except in a single case where you're trying to write an INT_MIN but then again, unary minus doesn't help you in this case either — unless you, as e.g. SML does, make the unary minus the lexical part of the number itself. However, SML has to actually use the tilde "~" instead of the minus for the negation because otherwise "1 -2" would be ambiguous.

IIRC Elm didn't have unary minus for quite some time just fine unless its author decided he really would like to have specifically unary minues but, weirdly, not any other unary operator. So, what's the deal with unary minus, why do people want it so much?



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

Search: