Subject: Re: [Boost-bugs] [Boost C++ Libraries] #4786: custom property_tree
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-03-21 13:40:45
#4786: custom property_tree
-------------------------------+--------------------------------------------
Reporter: anonymous | Owner: cornedbee
Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: property_tree
Version: Boost 1.44.0 | Severity: Problem
Resolution: | Keywords: property_tree
-------------------------------+--------------------------------------------
Comment (by saleyn):
Replying to [comment:8 cornedbee]:
> I can see the point in making the JSON parser variant-tree-aware. JSON
is already typed, after all, and the current parser throws away
information.
>
> But all this talk about how to shoehorn INFO into a typed tree doesn't
make sense to me. INFO is not any official format. It was invented by the
original PTree author specifically for string ptrees. If you want types,
then why not just adjust the format to allow type annotations?
IMHO, INFO is a very succinct and convenient format. It's conceptually
very similar to Erlang term encoding format, which is quite popular. In
fact most of dynamically typed languages use standard implicit rules to
parse 1234 as integers, 234.5 or 2.345e2 as floats, "1234" as strings, and
true or false as booleans (just like JSON protocol does, except that it
doesn't distinguish integers from floats and treats them as "number").
So, adapting that idea to the INFO parser so that it can use a custom
translator to allow a user to take advantage of that extra metadata
wouldn't be that bad.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/4786#comment:10> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:09 UTC