Hi,
many things, I surely learned a *lot* from your post!
The downside is that "Set" failed me (or I failed, POV :). I always lost
my "added" information (I tested with simple instance_eval) until I
figured out the following:
- Set uses Hash internall
- Hash.store says the following about Strings:
"a String passed as a key will be duplicated and frozen"
I don't know how to verify 100%, but it seems that's way I'm "loosing"
my data:
$ cat meta.rb
require 'pp'
require 'set'
set = Set.new
set.add('foo')
s = 'bar'
s.instance_eval { @src = 'source' }
set.add(s)
set.each { |e|
pp e.instance_eval { @src }
}
$ ruby meta.rb
nil
nil
The second 'nil' should have been "source".
Seems I need to go for non-String object in my case :(
- Markus