Anyone care to pick holes in this little expression of some Perl 6 core
types as collections? I mean, other than missing methods ;)
role Collection[\$types] {
has Seq[$types] @.members;
}
role Set[::T = Item] does Collection[T] where {
all(.members) =:= one(.members);
};
HaloO,
Sam Vilain wrote:
Anyone care to pick holes in this little expression of some Perl 6 core
types as collections? I mean, other than missing methods ;)
My comments follow.
role Collection[\$types] {
has Seq[$types] @.members;
}
This is a little wrapper that ensures that
HaloO,
Miroslav Silovic wrote:
TSa wrote:
Nice usage of junctions!
But buggy - one means *exactly* one. So for an array of more than 1
element, all(@array) never equals one(@array) - if they're all the same,
it's more than 1, otherwise it's 0.
Doesn't all(1,2,3) == one(1,2,3) expand the
Carried over form IRC to placeholder the conversation as I saw it:
We define the following in S06 as immutable types:
ListLazy Perl list (composed of Seq and Range parts)
Seq Completely evaluated (hence immutable) sequence
Range Incrementally generated (hence
Aaron Sherman wrote:
It seems to me that there are three core attributes, each of which has
two states:
Mutability: true, false
Laziness: true, false
Ordered: true, false
I think there's a 4th: exclusivity: whether or not duplicate elements
are permitted/exposed (i.e. the
TSa wrote:
role Collection[\$types] {
has Seq[$types] @.members;
}
This is a little wrapper that ensures that collections have got
a @.members sequence of arbitrary type. This immediately raises
the question how Seq is defined.
[...and later...]
Are you sure that the underlying
Aaron Sherman wrote:
Carried over form IRC to placeholder the conversation as I saw it:
We define the following in S06 as immutable types:
ListLazy Perl list (composed of Seq and Range parts)
Seq Completely evaluated (hence immutable) sequence
Range
Both Data::Dumper and Storable provide hooks to customize serialization
($Data::Dumper::Freezer|Toaster, STORABLE_freeze|_thaw).
Other modules like YAML and Clone could also possibly reuse a
common state marshalling interface.
Is there some common element to this process which can be gathered
Brad Bowman wrote:
Both Data::Dumper and Storable provide hooks to customize serialization
($Data::Dumper::Freezer|Toaster, STORABLE_freeze|_thaw).
Other modules like YAML and Clone could also possibly reuse a
common state marshalling interface.
Is there some common element to this
On Mon, Sep 25, 2006 at 09:02:56PM -0500, Mark Stosberg wrote:
: Brad Bowman wrote:
:
: Both Data::Dumper and Storable provide hooks to customize serialization
: ($Data::Dumper::Freezer|Toaster, STORABLE_freeze|_thaw).
: Other modules like YAML and Clone could also possibly reuse a
: common
On 9/25/06, Miroslav Silovic [EMAIL PROTECTED] wrote:
TSa wrote:
role Set[::T = Item] does Collection[T] where {
all(.members) =:= one(.members);
};
Nice usage of junctions!
But buggy - one means *exactly* one. So for an array of more than 1
element, all(@array) never equals
At 7:28 PM -0700 9/25/06, Ashley Winters wrote:
On 9/25/06, Miroslav Silovic [EMAIL PROTECTED] wrote:
TSa wrote:
role Set[::T = Item] does Collection[T] where {
all(.members) =:= one(.members);
};
Nice usage of junctions!
But buggy - one means *exactly* one. So for an
Author: audreyt
Date: Mon Sep 25 20:49:59 2006
New Revision: 12417
Modified:
doc/trunk/design/syn/S02.pod
doc/trunk/design/syn/S04.pod
Log:
* S02: Introduce the :$$x form in adverbial pair parsing.
* S02/S04: Canonicalize item as the unary context enforcer,
so that the name Scalar can
13 matches
Mail list logo