On Thu, Nov 08, 2001 at 11:15:41AM +0200, Oren Ben-Kiki wrote:
| I think I missed the point of the latest ideas.
I believe Brian's need for a new top level separator
construct is that he has two different "types" of
sequences: lists and arrays; or as you call them
vector and array. Rather than introducing a brand-new
top level syntax for vectors (which would only apply
at the top level). I was proposing that he use typing
rather than introducing a new syntax.
| I've no problem with renaming "list" to "sequence",
| though I think that:
| empty: !sequence
| Is a bit too much. Would using 'seq' be acceptable?
| As a part-time Perl programmer I've never noticed the
| difference between list and array, and I *did* read the
| Camel book cover-to-cover. For example, how does one
| declare a list variable?
From Brian's examples, the "list" type seems to be
introduced during function calls and returns; my
father calls these fellas "transfer vector" as this
was standard IBM 360 word used to describe the
variables put on and retrieved from the stack
during a function call.
| Python tuples vs. lists can be neatly covered by an
| explicit type (as would Perl arrays vs. lists if there
| is such a thing). If you feel that we should
| define two additional core/common types, 'list'
| and 'tuple', in addition to 'seq', so be it - as long
| as you can come up with a good language-independent
| definition of seq, list and tuple which would make
| sense to, say, a Java or a C++ programmer :-)
| About attaching descriptors to the top-level. That's
| covered in today's spec:
| - top-level list
ok. One question. If I have two of these buggers
and then I concatinate them I get...
- top level list
- top level list
Is this valid? This is the reason why I chose the
| top-level : map
I'm confused with this one. Is the top-level
key typed, or is the map? Another good reason
why the comment syntax works.
| !typed \
| top-level scalar
This is a good example of why I don't like top-level
scalars. One could just as easily add a "-" in front,
and then we don't have to have special production
rules... this works especially well if the type of
the top level list is a "transfer vector".
| !typed top-level map key : with value
Kinda subtle hunh?
!typed "top level
map key" : with value?
| No need for magical comments.
if you don't like the magical comments, that's
ok. But how do we do concatination of docs
in this case?
| Also, adding descriptors to the top-level prevents
| concatenation (unless you allow for separators), be
| it using the above current syntax or using magical
| type comments (Ugh!). Speaking of which, I *strongly*
| feel that placing *any* standard YAML semantics in
| '#...' comments is a serious mistake.
Ok. Then let's burn a "special" indicator to
mark version and give discriptos to top level
constructs. Let's use, for example the ?
?YAML v1.0 !vector
The advantage of this is that we don't need
another sequential construct. We add a single
"roadsign" (later road signs must be identical
or it is an error), remove top level scalars,
and we are done.