gkz / LiveScript

LiveScript is a language which compiles to JavaScript. It has a straightforward mapping to JavaScript and allows you to write expressive code devoid of repetitive boilerplate. While LiveScript adds many features to assist in functional style programming, it also has many improvements for object oriented and imperative programming.
http://livescript.net
MIT License
2.31k stars 155 forks source link

Livescript needs to rediclare "+", "-", "*", "/" #984

Open askucher opened 6 years ago

askucher commented 6 years ago

Try to

console.log( 823456789123456.3 );    // 823456789123456.2

And this is just one example. Javascript has a lot of problems and we forced to use bignumber.js or big.js

So, it will be good to have something like

operator (+) = (arg1, arg2)-> bignumber.plus(arg1, arg2).to-number!
operator (-) = (arg1, arg2)-> bignumber.minus(arg1, arg2).to-number!
operator (*) = (arg1, arg2)-> bignumber.mul(arg1, arg2).to-number!
operator (/) = (arg1, arg2)-> bignumber.div(arg1, arg2).to-number!
rhendric commented 6 years ago
plus = (arg1, arg2) -> bignumber.plus(arg1, arg2).to-number!
a `plus` b

Works today.

askucher commented 6 years ago

yeah! it really helps.

but strange thing that we cannot use native operators at all. too much issues with them