mirror of
https://github.com/leafo/moonscript.git
synced 2024-11-22 02:44:23 +00:00
document new bitwise update assignment operators (#291)
This commit is contained in:
parent
b8244cb093
commit
2a9f16377b
@ -55,9 +55,9 @@ variable, or shadow an existing one.
|
||||
|
||||
## Update Assignment
|
||||
|
||||
`+=`, `-=`, `/=`, `*=`, `%=`, `..=`, `or=`, `and=` operators have been added
|
||||
for updating and assigning at the same time. They are aliases for their
|
||||
expanded equivalents.
|
||||
`+=`, `-=`, `/=`, `*=`, `%=`, `..=`, `or=`, `and=`, `&=`, `|=`, `>>=`, and
|
||||
`<<=` operators have been added for updating and assigning at the same time.
|
||||
They are aliases for their expanded equivalents.
|
||||
|
||||
```moon
|
||||
x = 0
|
||||
@ -68,6 +68,12 @@ s ..= "world"
|
||||
|
||||
b = false
|
||||
b and= true or false
|
||||
|
||||
p = 50
|
||||
p &= 5
|
||||
p |= 3
|
||||
p >>= 3
|
||||
p <<= 3
|
||||
```
|
||||
|
||||
## Comments
|
||||
|
Loading…
Reference in New Issue
Block a user