> 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.
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:
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.