From: murphy Date: 2007-12-12T09:23:49+09:00 Subject: Re: redefineable not operator This is a multi-part message in MIME format. --------------040409090103020604070609 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Yukihiro Matsumoto wrote: > Why don't you speak Japanese? ;-) I want to, but unformtunately, it's harder to learn than Ruby :) > User.select {|m| m.name != 'macgyver'} or !(m.name == 'macgyver') or m.address !~ 'Osaka'. I see, thank you! while testing, I also realized that you can redefine unary ! and ~ methods without @ now: class Feeling def ~ :drunk end def ! :alert end def -@ # still needed :bad end def +@ # here too :good end end I wonder if all those little changes are documented somewhere... Pickaxe 3, anyone? oh, and here's a little doc correction/clarification for !~ (attached). [murphy] --------------040409090103020604070609 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="rb_obj_not_match_doc_fix.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="rb_obj_not_match_doc_fix.diff" Index: object.c =================================================================== --- object.c (revision 14196) +++ object.c (working copy) @@ -1025,9 +1025,10 @@ /* * call-seq: - * obj !~ other => nil + * obj !~ other => true or false * - * Returns true if two objects does not match, using =~ method. + * Returns true if two objects do not match (using the =~ + * method), otherwise false. */ static VALUE --------------040409090103020604070609--