Re: Nitpick my Perl6 - parametric roles

2006-09-26 Thread Sam Vilain
Darren Duncan wrote: >> Perhaps, but then Junctions might not assume elements have equality or >> identity operations defined. >> > As I recall, every type in Perl 6 has an equality and identity > operation defined because the Object superclass provides one. If > nothing else, the type's eq

Re: Nitpick my Perl6 - parametric roles

2006-09-26 Thread Darren Duncan
At 8:13 PM +1200 9/26/06, Sam Vilain wrote: Darren Duncan wrote: > Within a system that already has an underlying set-like type, the Junction in this case, a test for uniqueness is (pardon any spelling): all(@items).elements.size === @items.size The all() will strip any duplicates, so

Re: Nitpick my Perl6 - parametric roles

2006-09-26 Thread Sam Vilain
TSa wrote: > HaloO, > > Sam Vilain wrote: > >> perl -MPerl6::Junction=one,all -le '@foo=qw(1 2 3 4); print "yes" if >> (all(@foo) eq one(@foo))' >> yes >> > > But does it fail for duplicates? I guess not because junctions > eliminate duplicates and you end up testing unique values as > abov

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

2006-09-26 Thread Aaron Crane
TSa writes: > I'm very glad, too. Even though I would like the new operator > spelled / for aesthetic reason. I think there'd be problems making that work. It's a prefix operator, so it has to appear in term position, and we already have terms that begin with C, in the form of regexes. Forcing r

Re: Nitpick my Perl6 - parametric roles

2006-09-26 Thread TSa
HaloO, Sam Vilain wrote: Ah, yes, a notable omission. I understood a Seq as a list with individual types for each element, which are applied positionally. I can understand that the type-checker can produce this type for immutable sequences. The superclass for things like Pair. Hmm, have

Re: class interface of roles

2006-09-26 Thread TSa
HaloO, is this subject not of interest? I just wanted to start a discussion about the class composition process and how a role designer can require the class to provide an equal method and then augment it to achieve the correct behavior. Contrast that with the need to do the same in every class t

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

2006-09-26 Thread audreyt
Author: audreyt Date: Tue Sep 26 03:07:20 2006 New Revision: 12432 Modified: doc/trunk/design/syn/S03.pod Log: * S03: Document that chained comparisons short-circuit, and never evaluates its arguments more than once. Modified: doc/trunk/design/syn/S03.pod ==

Re: Nitpick my Perl6 - parametric roles

2006-09-26 Thread Sam Vilain
Darren Duncan wrote: > Unless I'm mistaken, you may be going about this the wrong way. > > Within a system that already has an underlying > set-like type, the Junction in this case, a test > for uniqueness is (pardon any spelling): > >all(@items).elements.size === @items.size > > The all() wi

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

2006-09-26 Thread TSa
HaloO, Luke Palmer wrote: Woohoo! I was about to complain about this whole "capture sigil" nonsense, but I'm guessing somebody else already did. I also like the new [,] :-) I'm very glad, too. Even though I would like the new operator spelled / for aesthetic reason. Regards, --

Re: Nitpick my Perl6 - parametric roles

2006-09-26 Thread Sam Vilain
Miroslav Silovic 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

Re: Nitpick my Perl6 - parametric roles

2006-09-26 Thread TSa
HaloO, Sam Vilain wrote: perl -MPerl6::Junction=one,all -le '@foo=qw(1 2 3 4); print "yes" if (all(@foo) eq one(@foo))' yes But does it fail for duplicates? I guess not because junctions eliminate duplicates and you end up testing unique values as above. E.g. all(1,1,2) == one(1,1,2) might act

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

2006-09-26 Thread Luke Palmer
On 9/25/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Log: Slaughter of special [,], now is just listop form of [...] To support |func() syntax, | is the new * (desigilized) Woohoo! I was about to complain about this whole "capture sigil" nonsense, but I'm guessing somebody else already di