yaml sequence

A

Ara.T.Howard

i noticed this today:

irb(main):014:0> s = 'seq: [4,2]'
"seq: [4,2]"

irb(main):015:0> YAML.load s
{"seq"=>[42]}
^
^
^
ONE entry

irb(main):016:0> s = 'seq: [4,2,forty,two]'
"seq: [4,2,forty,two]"

irb(main):017:0> YAML.load s
{"seq"=>["4,2,forty,two"]}

it works if you do

irb(main):018:0> s = 'seq: [4, 2]'
"seq: [4, 2]"
^
^
^
SPACE included

irb(main):019:0> YAML.load s
{"seq"=>[4, 2]}

for all i know, it may already be fixed...

now the question, any idea how to EMIT

"seq: [4, 2]"

does seem to be an options key to 'flatten' array output...

-a



====================================
| Ara Howard
| NOAA Forecast Systems Laboratory
| Information and Technology Services
| Data Systems Group
| R/FST 325 Broadway
| Boulder, CO 80305-3328
| Email: (e-mail address removed)
| Phone: 303-497-7238
| Fax: 303-497-7259
| The difference between art and science is that science is what we understand
| well enough to explain to a computer. Art is everything else.
| -- Donald Knuth, "Discover"
| ~ > /bin/sh -c 'for lang in ruby perl; do $lang -e "print \"\x3a\x2d\x29\x0a\""; done'
====================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
474,137
Messages
2,570,797
Members
47,342
Latest member
eixataze

Latest Threads

Top