Mar*_*off 33
这是Ruby运算符的表.
方法和可重载的是:
[ ] [ ]= Element reference, element set
** Exponentiation
! ~ + - Not, complement, unary plus and minus (method names for the last two are +@ and -@)
* / % Multiply, divide, and modulo
+ - Plus and minus
>> << Right and left shift
& Bitwise `and'
^ | Bitwise exclusive `or' and regular `or'
<= < > >= Comparison operators
<=> == === != =~ !~ Equality and pattern match operators (!= and !~ may not be defined as methods)
Run Code Online (Sandbox Code Playgroud)
该表来自2001年的Pickaxe书,但这与Ruby 1.9 Pickaxe书中的表相同 - 没有理由相信这组中缀运算符将会改变.
| 归档时间: |
|
| 查看次数: |
6833 次 |
| 最近记录: |