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 156 forks source link

Bitwise "xor" is ditched #1100

Closed punund closed 4 years ago

punund commented 4 years ago

The JavaScript operator ^ has got another, unrelated meaning.

JavaScript:

0x10 ^ 0x1A // 10

LiveScript:

0x10 ^ 0x1A // 2.028240960365167e+31

I have three problems with this.

  1. Obviously, this is quite confusing.
  2. ^ is an alias for another operator (**) and is not necessary (and there is Math.pow() too).
  3. We are left without bitwise xor.
gkz commented 4 years ago

Lookup "Bitwise and shift operators" under http://livescript.net/#operators

0x10 .^. 0x1A