COMMIT ||= and &&= may not make an assignment at all. http://github.com/rubyspec/rubyspec/commit/145bb603a5c146634ad085ccb1ab3e957cc72113 COMMIT Separate ||= and &&= from other operators http://github.com/rubyspec/rubyspec/commit/a2278176e24a596fd85e3f332f5410d7dd3eb5cf =================================================================== +++ 20100325T075514 @@ 12 @@ URL: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1 リポジトリのルート: http://svn.ruby-lang.org/repos/ruby リポジトリ UUID: b2dd03c8-39d4-4d8f-98ff-823fe69b080e +リビジョン: 27038 ノード種別: ディレクトリ 準備中の処理: 特になし 最終変更者: yugui @@ 19946 @@ /home/chkbuild/tmp/build/ruby-1.9.1//ruby/ext/socket/extconf.rb:: warning: ambiguous first argument; put parentheses or even spaces /home/chkbuild/tmp/build/ruby-1.9.1//ruby/ext/json/lib/json/editor.rb:: warning: shadowing outer local variable - item s: . +TestSystem#test_system: /home/chkbuild/tmp/build/ruby-1.9.1//tmp/ruby_script_tmp20100325-16882-14djsbm/ruby_script_tmp.16882:: warning: global variable `$zzz' not initialized s: . TestTCPSocket#test_encoding: s: . TestTCPSocket#test_recvfrom: s: . @@ 57997 @@ - assigns the lhs if previously unassigned - checks for class variable definition before fetching its value +Unconditional operator assignment 'var op= expr' - is equivalent to 'var = var op expr' +Conditional operator assignment 'var op= expr' +- assigns the lhs if its truthiness is false for ||, true for && +- may not assign at all, depending on the truthiness of lhs +- uses short-circuit arg evaluation +Unconditional operator assignment 'obj.meth op= expr' - is equivalent to 'obj.meth = obj.meth op expr' +Conditional operator assignment 'obj.meth op= expr' +- is equivalent to 'obj.meth op obj.meth = expr' +- may not assign at all, depending on the truthiness of lhs +- uses short-circuit arg evaluation Operator assignment 'obj.meth op= expr' - evaluates lhs one time +Unconditional operator assignment 'obj[idx] op= expr' - is equivalent to 'obj[idx] = obj[idx] op expr' +Conditional operator assignment 'obj[idx] op= expr' +- is equivalent to 'obj[idx] op obj[idx] = expr' +- may not assign at all, depending on the truthiness of lhs +- uses short-circuit arg evaluation Operator assignment 'obj[idx] op= expr' - handles complex index (idx) arguments @@ 58066 @@ Finished in seconds +1 file, 70 examples, 494 expectations, 0 failures, 0 errors == rubyspec/language/while_spec.rb #