From: ts Date: 2001-08-01T13:45:57+09:00 Subject: [ruby-talk:18933] Re: notes from a Ruby newbie >>>>> "N" == Ned Konz writes: N> a = 0 N> a ||= 3 N> doesn't work but doesn't complain. Even though: No, it work. Like you have seen 0 is not false. N> a.respond_to?('||=') returns false. Why doesn't it complain? ||= is not a method, and || is an operator N> Surprise! 0 isn't false, but the ||= operator doesn't complain about the N> non-Boolean receiver like it would in Smalltalk. N> --------- N> p = Proc.new { |a| a } N> p.call(1, 2) # => [1,2] N> Surprise! The list turned into an Array! Try a = 1, 2 p a N> I would have either expected a warning or the second parameter to be ignored. N> If you call a method with the wrong number of arguments, you get an error N> message. But not a Proc. a Proc is not a Method N> p = Proc.new { |a,*b| a } N> p.call(1,2) # => 1 a, *b = 1, 2 p a p.s.: try to forget perl ... Guy Decoux