Discussion:
[Yaml-core] How do interpret sequence of sequences
Pieter Heyvaert
2017-06-07 11:10:10 UTC
Permalink
Hi all,


I'm checking into the YAML spec and I came across 'sequence of sequences'.

I have issues with understanding it completely. From the spec I understand that example 2.5 is the same as example 2.6.

If so, what 'rules' are followed to get to this result?


Kind regards
Pieter Heyvaert
Ghent University - imec
k***@bt.com
2017-06-07 11:24:46 UTC
Permalink
If you are referring to http://www.yaml.org/spec/1.2/spec.html,<http://www.yaml.org/spec/1.2/spec.html> then example 2.5 is not the same as example 2.6.


2.6 is a mapping of mappings, a completely different thing to a sequence of sequences. A mapping has keys; a sequence only has indices.


Keith


________________________________
From: Pieter Heyvaert <***@UGent.be>
Sent: 07 June 2017 12:10
To: Yaml-***@lists.sourceforge.net
Subject: [Yaml-core] How do interpret sequence of sequences


Hi all,


I'm checking into the YAML spec and I came across 'sequence of sequences'.

I have issues with understanding it completely. From the spec I understand that example 2.5 is the same as example 2.6.

If so, what 'rules' are followed to get to this result?


Kind regards
Pieter Heyvaert
Ghent University - imec
Pieter Heyvaert
2017-06-07 11:27:14 UTC
Permalink
Hi Keith,


OK. That's what I thought initially, but the spec gave me the impression that both were equivalent in some way. Thanks for clearing that up.


Kind regards
Pieter Heyvaert
Ghent University - imec
________________________________
From: ***@bt.com <***@bt.com>
Sent: Wednesday, June 7, 2017 1:24 PM
To: Pieter Heyvaert
Cc: Yaml-***@lists.sourceforge.net
Subject: Re: How do interpret sequence of sequences


If you are referring to http://www.yaml.org/spec/1.2/spec.html,<http://www.yaml.org/spec/1.2/spec.html> then example 2.5 is not the same as example 2.6.


2.6 is a mapping of mappings, a completely different thing to a sequence of sequences. A mapping has keys; a sequence only has indices.


Keith


________________________________
From: Pieter Heyvaert <***@UGent.be>
Sent: 07 June 2017 12:10
To: Yaml-***@lists.sourceforge.net
Subject: [Yaml-core] How do interpret sequence of sequences


Hi all,


I'm checking into the YAML spec and I came across 'sequence of sequences'.

I have issues with understanding it completely. From the spec I understand that example 2.5 is the same as example 2.6.

If so, what 'rules' are followed to get to this result?


Kind regards
Pieter Heyvaert
Ghent University - imec
Carsten Bormann
2017-06-07 11:33:51 UTC
Permalink
Post by Pieter Heyvaert
OK. That's what I thought initially, but the spec gave me the impression that both were equivalent in some way.
They show two data models for what appears to be the same information model (a table with an index column “name” and value columns “hr” and “avg”). YAML can serialize instances of both data models. (Example 2.4 shows third way to map the same information model into a data model.). The YAML spec of course is not discussing information models, so this all happens in the reader’s mind.

(The purpose of the examples 2.5 and 2.6 is simply to show flow-style serialization, though.)

Grüße, Carsten

Loading...