From: Devin Mullins Date: 2006-12-12T23:20:40+09:00 Subject: Re: Non-useless mode for YAML::Syck::Map.children_with_index? Phlip wrote: > Rubistas: Ooh! I approve. Err... you might wanna ask _why directly, or hop into the source. I got lost at the :seq part -- isn't that a Mapping, not a Sequence? And FWIW, I got a, i from me_key.value when I ran it. So... order bad. I think if you care about order -- now's too late in the game. irb(main):021:0* y.instance_variables.map {|f| [f, y.instance_variable_get(f)] } => [["@style", nil], ["@value", {#=>#, #=>#}], ["@type_id", nil], ["@kind", :seq]] Nothing about order there. (If you have control over the YAML, don't use a mapping - the spec says order doesn't matter for mappings. A technique I use a lot is a list of singleton mappings: - Foo: bar - Fish: bileff ...) Devin > Here's a complete working sample illustrating the issue in YAML::Syck, or > its documentation: > > require 'yaml' > > y = YAML.parse("i: b\na: sequence") > p y.kind # <-- :seq > ...