From: Joel VanderWerf Date: 2004-03-15T10:10:10+09:00 Subject: Re: yaml and ruby symbols why the lucky stiff wrote: > Joel VanderWerf wrote: > >> >> foo = YAML.load(foo_yaml) >> p foo >> # ==> >> # :foo >> # >> # Still good. >> > > the above works because loading of colon-prefixed strings as Symbols was > added to Syck about two months ago. so the only part of your > proposition that needs to be completed is the emission of symbols > implicitly. > > i don't see any reason we can't move forward with it. you mention > portability... > > no, python will not load symbols the same way. nor will php or java or > c. but this is true of many yaml constructs. the map, for instance, > will be loaded in php as an ordered hash. we can't solve that problem. > > i would recommend section 3.3 ('Completeness') of the yaml spec to > anyone who wants to know how portability between languages works with > yaml. basically, as long as the documents round-trip properly, the > native representation isn't (and can't be) perfect. > > yeah, so the patch is checked into syck cvs. weaving into ruby cvs later. That's great. Thanks! How will we switch between emitting "!ruby/sym foo" and ":foo"? Will it be an option to to_yaml?