[Q] removing array duplicates where a subset is unique

David A. Black wrote:

The ||= idiom should work
fine

..until it doesn't (I think you know what I'm refering to).

The hash default thing? I don't think that comes into play here, does
it?

No, but whenever I see ||= now, I get scared. :frowning:

···

--
Posted via http://www.ruby-forum.com/\.

7stud -- wrote:

No, but whenever I see ||= now, I get scared. :frowning:

I do to! It looks like a very angry gnome.

···

--
       vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

Hi --

···

On Mon, 20 Jul 2009, Joel VanderWerf wrote:

7stud -- wrote:

No, but whenever I see ||= now, I get scared. :frowning:

I do to! It looks like a very angry gnome.

I'm still waiting to see a use-case for &&=. I've come close to
thinking I had one once or twice, but it always turns out I didn't.

David

--
David A. Black / Ruby Power and Light, LLC
Ruby/Rails consulting & training: http://www.rubypal.com
Now available: The Well-Grounded Rubyist (http://manning.com/black2\)
Training! Intro to Ruby, with Black & Kastner, September 14-17
(More info: http://rubyurl.com/vmzN\)

David A. Black wrote:

I'm still waiting to see a use-case for &&=. I've come close to
thinking I had one once or twice, but it always turns out I didn't.

Not terribly useful, but...

   line = sock.gets
   line &&= line.chomp
   log.debug "line is #{line.inspect}"

···

--
       vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407