Comment

Comment by bad_user

> For that matter, you could un-overload the + operator so that it only works with numbers

No you can't. First of all, you can't implement operator overloading, because Sweet.js is quite limited, as the macros have the form:

   <macro-identifier> <expression...>
Also, because you don't have the types when Sweet.js compiles the code, it means that you can't distinguish between numbers and strings or what have you.
parent bad_user 13 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton