(::) (::) (::) (::) (::) (::) (::)
きゅうり演算子できた
(::) (::) (::) (::) (::) (::) (::)
#!./ruby1.9 ary = [ 5, 4, 8, 1, 3, 2, ] hoge = ary.sort! {|a, b| b (::) a } p hoge #=> [8, 5, 4, 3, 2, 1]
(::) < べんり!
Index: parse.y =================================================================== --- parse.y (リビジョン 25615) +++ parse.y (作業コピー) @@ -7216,8 +7216,25 @@ return '~'; case '(': - if (IS_BEG()) { - c = tLPAREN; + // (::) == <=> + { + unsigned char d; + if ((d = nextc()) == ':') { + unsigned char e; + if ((e = nextc()) == ':') { + unsigned char b; + if ((b = nextc()) == ')') { + return tCMP; + } + pushback(b); + } + pushback(e); + } + pushback(d); + } + /////// + if (IS_BEG()) { + c = tLPAREN; } else if (space_seen) { if (IS_ARG()) {