Implicit typing & the principal of least surprise

Burt Harris <[email protected]>
Newsgroups gmane.text.yaml.general
Message-ID <4367B3F0BD5AA84DBE0A9DA5AAF7B7B9408FB40494@NA-EXMSG-C103.redmond.corp.microsoft.com>
I very much like the idea of restricting the set of implicit type conversions
to those needed for JSON compatibility.   I'll suggest that the complete set
of implicit type regex's actually belongs in section 3.3.2 of the core spec,
rather than distributed through the type repository.   This section should
say triggering condition for implicit typing is a non-specific tag of '?', rather
than plain scalar, helping to make clear that it's a composing, rather than
parsing function.

I'm not so sure that << belongs in the set.   While I think I understand the
concept, it seems like a stretch to consider it a type operation, and the
terse notation and complex semantics seem surprising to me.   One thought
that crossed my mind would be to replace use of << with the !!merge tag,
which looks as surprising as it is, and give a clue as to semantics.  I guess that
would  require that a lone tag, with no content, to be a valid node.  I believe
this syntax could have other uses (e.g. {date of birth: !unknown})

The other implicit typing ambiguity introduced by reading the type repository
is the option that an untagged sequence of single-key mappings might be
interpreted as an !!omap implicitly.  Given my level of YAML understanding,
the no duplicate keys implication would be surprising.   I recognize this is
optional, but suggest it may be worth removing all implications of implicit
typing from the type repository given Oren's explanation of the intent.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
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.