Nitpick my Perl6 - parametric roles

2006-09-25 Thread Sam Vilain
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); };

Re: Nitpick my Perl6 - parametric roles

2006-09-25 Thread TSa
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

Re: Nitpick my Perl6 - parametric roles

2006-09-25 Thread TSa
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

Mutability vs Laziness

2006-09-25 Thread Aaron Sherman
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

Re: Mutability vs Laziness

2006-09-25 Thread Dave Whipp
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

Re: Nitpick my Perl6 - parametric roles

2006-09-25 Thread Sam Vilain
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

Re: Mutability vs Laziness

2006-09-25 Thread Sam Vilain
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

Common Serialization Interface

2006-09-25 Thread Brad Bowman
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

Re: Common Serialization Interface

2006-09-25 Thread Mark Stosberg
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

Re: Common Serialization Interface

2006-09-25 Thread Larry Wall
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

Re: Nitpick my Perl6 - parametric roles

2006-09-25 Thread Ashley Winters
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

Re: Nitpick my Perl6 - parametric roles

2006-09-25 Thread Darren Duncan
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

[svn:perl6-synopsis] r12417 - doc/trunk/design/syn

2006-09-25 Thread audreyt
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