At 16:14 28/04/2004 +0900, you wrote: >il Wed, 28 Apr 2004 13:35:09 +0900, Jean-Hugues ROBERT ><jean_hugues_robert / yahoo.com> ha scritto:: > > > > > >Rather than allowing x, y == 1, 2, I would prefer a more > >general x, y =~= 1, 2 whose semantic is richer due to the > >fact that it may end up assigning either x, y or both if > >they don't exist already (or if they were unbound/freed). > > > >oh, please no more obscure operators. >I think little people here would like this route when in the future we >found ourself using perl6-ish stuff like "@a >>=:=<< @b" :) Well... once you have =~= you can get rid of both = and ==, =~= does both (under certain circumstances). So I guess I am actually proposing to have less operators ! kidding. I agree with you. If something related to Unification is to be introduced, say the pattern matching, I would rather have a "match()" builtin than a rather contrived =~= binary operator. Example: somewhere in a parser. # Get next token. If expecting a specific one, please specify it. # Returns next token or nil if it is not the expected one. def next_tok( tok = free ) tok if match tok, $lex.next_tok() end def next_tok( tok = nil ) ntok = $lex.next_tok() ntok unless tok and ntok != tok end x = next_tok() ... syntax_err( "expected 'end'") unless next_tok( Tk::End) Both methods serve the same purpose, but the first one's body is 50% slimmer. It should be faster too. I believe this is a significant increase in the expressiveness of Ruby, for a rather low cost. I will provide a user level prototypal implementation in Ruby soon. Yours, Jean-Hugues ------------------------------------------------------------------------- Web: http://hdl.handle.net/1030.37/1.1 Phone: +33 (0) 4 92 27 74 17