G
gabriele renzi
hi gurus and nubys,
I just noticed this:
from (irb):8:in `[]'
from (irb):8
It seem that []= uses to_s while [] uses to_str:
from (irb):16:in `to_str'
from (irb):21:in `[]'
from (irb):21
is this an expected behaviour? I believe wheter SDBM uses the one or
the other it should be consistent in hi choice
Anyway:
ruby 1.8.1 (2003-12-25) [i386-mswin32]
Can't say what version sdbm is, given that VERSION refers to 1.8.1 and
SDBM::constants == []
I just noticed this:
TypeError: cannot convert Symbol into Stringdb=SDBM.new 'foo', 0666=> # said:db[:foo]=10 => 10
db.keys => ["foo"]
db[:foo]
from (irb):8:in `[]'
from (irb):8
It seem that []= uses to_s while [] uses to_str:
RuntimeError: fuku fukissimo fukuclass C
def to_s
'miao'
end
def to_str
raise 'fuku fukissimo fuku'
end
end => nil
db[C.new]=30 => 30
db.keys => ["foo", "miao"]
db[C.new]
from (irb):16:in `to_str'
from (irb):21:in `[]'
from (irb):21
is this an expected behaviour? I believe wheter SDBM uses the one or
the other it should be consistent in hi choice
Anyway:
ruby 1.8.1 (2003-12-25) [i386-mswin32]
Can't say what version sdbm is, given that VERSION refers to 1.8.1 and
SDBM::constants == []