4 ms·
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 s
by thomasfoster96 12y 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.
- kazinator 12y agoAlso, 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.