Jon Lang wrote:
Darren Duncan wrote:
On another tangent, since I'm not sure that Blob literals have been defined
in Perl 6 yet, I suggest something that combines aspects of numeric and
character string literals, meaning a radix prefix plus string quotes; for
example:
0b'1100100101'
0o'57013'
0x'DEADBEEF'
:2'1100100101'
:8'57013'
:16'DEADBEEF'
So what about custom delimiters?
q:2<1100100101>
q:8[57013]
q:16~DEADBEEF~
Well, sure, if its useful; the idea is to amalgam numeric and Str syntax.
However, because a Blob literal presumably just has 0..9,A-Z,_ characters in its
payload, one of the main uses of custom delimiter flexibility, which is avoiding
conflicts with payload elements, isn't necessary.
-As with C<Hash> types, C<Pair> and C<Mapping> are mutable in their
+As with C<Hash> types, C<Pair> and C<PairSet> are mutable in their
values but not in their keys. (A key can be a reference to a mutable
object, but cannot change its C<.WHICH> identity. In contrast,
the value may be rebound to a different object, just as a hash
element may.)
So given that PairSet is mutable as a whole (while PairValSet is immutable),
can you please clarify the difference between PairSet and Hash, both of
which have immutable keys and mutable values?
Back when it was Mapping, I was under the impression that the
difference involved whether or not the component Pairs were ordered -
that is, a Mapping was Positional as well as Associative. I could be
wrong.
I was never under the assumption that Mapping was Positional; it was an
immutable Hash essentially, and both were associative not ordered. So Mapping
was renamed to PairValSet, and PairSet was added as a mutable alternative, hence
how the latter differs from Hash is the question. I think only Capture et al
are both associative and ordered. If you want an ordered list of Pair, I don't
think that has its own type otherwise, but you can parameterize one from
Seq/Array/etc.
-- Darren Duncan