Hacker News new | ask | show | jobs
by thomasfoster96 4098 days ago
I've been playing around with creating a toy language which treats '-' as a name for a function. It means there always needs to be white space around a - (the syntax of the language isn't like LISP), but that increases readability at the cost of two extra key presses.
1 comments

Also, note that, in the same breath practically, you can support true negative integer constants:

   -1234
which are distinguished because there is no whitespace. You can distinguish the unary operator being applied to 1234 from a true -1234 constant.