On 30/10/02 08:36 +1100, Damian Conway wrote:
> Brian Ingerson wrote:
> > Speaking of persistence, I just realized I'll need to start thinking about
> > YAML serializations of superpositions. My first cut at it would be:
> > ---
> > letters: !super [0, 1, 2]
> > digits: !super
> > - 0
> > - 1
> > - 2
> > ...
> Not quite. You also need to discriminate the *type* of the superposition:
Oh right. I was thinking that C<any> and friends were operations, not types.
YAML type-URIs are made up of a type-family with an optional format:
is shorthand for:
So I'm wondering if any|all|one|none can be formats of !super? And if so,
should there be a default format?
> letters: !any [0, 1, 2]
> digits: !all
> - 0
> - 1
> - 2
> names: !one ["Brian", "Ingy", "Mr Inline"]
> sane: !none
> - "Larry"
> - "Damian"
> - "Brian"
Here are some options:
letters: !any [a, b, c]
# !perl.yaml.org/one (Perl specific types)
names: !perl/one [Brian, Ingy, Mr
Inline] # (Yes, this dwims :)
# !perl.yaml.org/super-none (longer type name, no format)
It might be more forward thinking to allow any|all|one|none into the
yaml.org type repository.
!perl/glob is staying right where it is, thank you ;)