Christian Neukirchen wrote:
> While I can see your intention, please don't do that.  Often,
> people want to compare Symbols and Symbols (they are
> perfect for that).  It is already very confusing that String
> !=== String (what is the most elegant way to case
> compare classes against classes, btw?).

The correct operator to use for comparison is ==, not ===. Despite the
similarity of names, === is for pattern-matching, not comparison. For
simple classes, pattern-matching and comparison are the same thing, but
when the receiver is a Regexp, or a Reg, things are different.

Btw,
  :sym==:sym and Class==Class
work just fine.


> case obj.quack
>   when :first
>   when :fetch
>   ...
> end
>
> would be nice to have, though.

hmmm... I haven't tried this, but....

require 'reg'

class Object
  def quack
    RegOr.new *methods
  end
end

ought to do it