Basic question about scalar types and libyaml

"Neil N. Carlson" <[email protected]>
Newsgroups gmane.text.yaml.general
Message-ID <[email protected]>
I'm investigating the feasibility of moving the input format
for a large scientific code to some standard XML-like format,
and found YAML/JSON to be very appealing possibilities.  I'm
playing around with libyaml and have a very basic question
about scalar types.  The wikipedia page on YAML (perhaps my
first mistake) describes autodetection of simple types (int,
float, bool, string) as a compelling feature, yet it appears
to me that libyaml returns all data as strings.  I thought
I could work around that by looking at the tag attribute but
that turns out to be null, unless I explicitly give a tag
in the input file.  So it appears that libyaml isn't doing
any autodetection of type at all.  Have I missed something?
It seems that I would need to write things like
[ !!float 1.0, !!float 1.0e3 ] instead of the more natural
[ 1.0, 1.0e3 ].

Thanks for your advice,
  Neil
-- 
Neil Carlson
Computational Physics and Methods (CCS-2)
Los Alamos National Laboratory
PO Box 1663, MS D413 · Los Alamos, NM 87545
505.665.6386 · 505.665.4972 (fax)


------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today.
http://p.sf.net/sfu/quest-sfdev2dev
_______________________________________________
Yaml-core mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/yaml-core
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.