From: Logan Capaldo Date: 2006-06-08T02:52:32+09:00 Subject: Re: Possible YAML bug with quoted symbols? On Jun 7, 2006, at 1:21 PM, ara.t.howard@noaa.gov wrote: > On Wed, 7 Jun 2006, Dave Baldwin wrote: > >> If I have a quoted symbol, i.e. :'some symbol' then when I dump >> the YAML for >> it and then load the results I don't get back the symbol I put in, >> but get an >> extra set of escaped quotes. The following irb session shows this: > > i don't see the problem: > > > harp:~ > ruby -r yaml -e' qs = YAML.load(YAML.dump(:"foo bar")); > p qs; p qs.class; p VERSION ' > :"foo bar" > Symbol > "1.8.4" > > > you are just confusing yourself with irb/inspect > >> irb(main):014:0> YAML.dump(:'some symbol') >> => "--- :\"some symbol\"\n" > ^^^^^^^^^^^^^^^^^^^^^^^^ > this is the output of String.inspect - not the literal string > > > try > > harp:~ > irb -r yaml > irb(main):001:0> dumped = YAML.dump(:'some symbol') > => "--- :\"some symbol\"\n" > irb(main):002:0> YAML.load dumped > => :"some symbol" > irb(main):003:0> YAML.load(dumped).class > => Symbol > > > regards. > > -a > -- > suffering increases your inner strength. also, the wishing for > suffering > makes the suffering disappear. > - h.h. the 14th dali lama > ara, try this: % irb irb(main):001:0> require 'yaml' => true irb(main):002:0> sym = :"a symbol" => :"a symbol" irb(main):003:0> sym == sym => true irb(main):004:0> sym == YAML.load(YAML.dump(sym)) => false irb(main):005:0> sym => :"a symbol" irb(main):006:0> YAML.load(YAML.dump(sym)) => :"\"a symbol\"" irb(main):007:0> VERSION => "1.8.4" Looks like a bug to me.