4 ms·
> The hyphens make the notation ambiguous with substraction In Lisp they wouldn’t, and in statically typed languages it probably wouldn’t be a problem either,
by layer8 5y ago
> The hyphens make the notation ambiguous with substraction
In Lisp they wouldn’t, and in statically typed languages it probably wouldn’t be a problem either, as the compiler would tell you that you can’t use a date as a number.
On the other hand, the need for date literals in program code is rare enough that it likely doesn’t warrant introducing a dedicated syntactic form.
- kelseyfrog 5y agoThis is why I notate using s-exprs.
- dctoedt 5y agoExample please? (Non-programmer here; I'm sorta familiar with s-exprs but can't quite picture what you have in mind.)
- 7thaccount 5y agoIn Lisp, operators and function calls are all prefix, so this would be subtraction: (- 10 5) I think (it's been awhile lol). A hyphen anywhere else wouldn't be confused with subtraction. This is just a guess though.
- kelseyfrog 5y ago(joke my-comment)