From: Tom Sawyer Date: 2003-01-23T13:38:01+09:00 Subject: Re: Hash#+ ? On Wednesday 22 January 2003 08:49 pm, Yukihiro Matsumoto wrote: > Hi, > > In message "Re: Hash#+ ?" > > on 03/01/23, Tom Sawyer writes: > |> I like the idea of Hash#| or Hash#or. It is simply an 'or' function. > |> Whichever comes first has precedence: > |> > |> hash1 | hash2 # -> "key1" => "foo" > |> hash2 | hash1 # -> "key1" => "baz" > | > |i posted this RCR on Ruby Garden but i expect the second hash to have > |precedence. i.e. | is defined as a non in-place #update. > > So you guys are OK for value losing "or" or "|" methods? > > matz. yes. a number of times in my experience a non in-place version of update would have been handy. -- tom sawyer, aka transami transami@transami.net .''. .''. . *''* :_\/_: . :_\/_: _\(/_ .:.*_\/_* : /\ : .'.:.'. .''.: /\ : ./)\ ':'* /\ * : '..'. -=:o:=- :_\/_:'.:::. | ' *''* * '.\'/.' _\(/_'.':'.' : /\ : ::::: = *_\/_* -= o =- /)\ ' * '..' ':::' === * /\ * .'/.\'. '._____ * | *..* : |. |' .---"| * | _ .--'| || | _| | * | .-'| __ | | | || | .-----. | |' | || | | | | | || | ___' ' /"\ | '-."". '-' '-.' '` |_. ------------------------------------------------------------