Re: Support for timedelta (duration)

Peter Murphy <[email protected]> Fri, 4 Dec 2015 17:04:03 +1000
Newsgroups gmane.text.yaml.general
Message-ID <CANZ_uBj_yXbobZKJw2ikcZpuqxQHvC3HGkLpE8M7+fFgCg7Ekw@mail.gmail.com>
On Fri, Dec 4, 2015 at 4:49 PM, Zenaan Harkness <[email protected]> wrote:
> On 12/3/15, Thomas Güttler <[email protected]> wrote:
>> I would like to see timedelta support in yaml:
>

[...]
>
> In principle, any new data type could have 'standardized' storage/
> serialization format - complex numbers, matrices, all sorts of units
> of measurement (not just time deltas) - YAML is designed to be enough
> to represent any 'higher level' data type, without unnecessarily
> burdening the YAML standard and therefore each implementation - better
> that YAML be just simple enough to get the job done so it is easy to
> implement, smallish, and relatively efficient.
>
> Basically you are proposing a mini parser for a specific custom data
> type. That's fine and good and perhaps your proposed implementation
> will be useful to that community, but it's not something that would be
> added to the YAML standard.

I disagree. There is one core standard (the YAML 1.2 spec), but this
is augmented by a lot of "Language Independent Types":

http://yaml.org/type/

For example, there is the specification for timestamp:

http://yaml.org/type/timestamp.html

What Thomas is asking for is a duration (timedelta) specification, one
which can be supported by parsers. I certainly don't see much
difficulty in someone putting together a specification following the
ISO8601 "P[n]Y[n]M[n]DT[n]H[n]M[n]S" standard:

---
{name: "Peter", age: !!timedelta P43Y}
...

Best regards,
Peter


-- 
Email: [email protected]
WWW: http://www.pkmurphy.com.au/

------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
_______________________________________________
Yaml-core mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/yaml-core