From: why the lucky stiff Date: 2004-08-21T00:57:58+09:00 Subject: Re: YAML and line numbers Jamis Buck wrote: > Because dynamically adding a line_number attribute to every object > read by the YAML parser would be prohibitively expensive for some > applications, you may even want to make it optional: > > YAML.line_numbers = true > conf = YAML.load(...) > ... > Well, yeah. You'll never need the line number for every object, so here's what I'm thinkin: conf = YAML.load_file( "package.yml" ) YAML.line_number_of( conf['id'] ) Which basically amounts to: parser = YAML::Parser.new conf = parser.load( "package.yml" ) line = parser.line_number_of( conf['id'] ) The lookup table gets stored in the extension. _why