G
Gavin Sinclair
It should, shouldn't it? It's meant to combine the fast lookup of
Hash with the convenience of Array, yet the most important method Hash
and Array have in common, Set lacks!
$ irb
irb(main):001:0> require 'set'
=> true
irb(main):002:0> s = Set[1,2,3]
=> #<Set: {1, 2, 3}>
irb(main):003:0> s.include? 1
=> true
irb(main):004:0> s[1]
NoMethodError: undefined method `[]' for #<Set: {1, 2, 3}>
from (irb):4
from :0
This would be a good thing to fix before 1.8 is released.
Gavin
Hash with the convenience of Array, yet the most important method Hash
and Array have in common, Set lacks!
$ irb
irb(main):001:0> require 'set'
=> true
irb(main):002:0> s = Set[1,2,3]
=> #<Set: {1, 2, 3}>
irb(main):003:0> s.include? 1
=> true
irb(main):004:0> s[1]
NoMethodError: undefined method `[]' for #<Set: {1, 2, 3}>
from (irb):4
from :0
This would be a good thing to fix before 1.8 is released.
Gavin