Re: unusual invocants

2009-10-20 Thread Matthew Walton
On Tue, Oct 20, 2009 at 5:35 PM, David Green wrote: > I would expect "$foo where {$_ ~~ X}" and "X $foo" simply to be different > ways of writing the same thing, but whatever works! Yes, but the where clause lets you test against multiple types at once. They don't participate in multiple dispatch

r28865 - docs/Perl6/Spec

2009-10-20 Thread pugs-commits
Author: moritz Date: 2009-10-21 00:15:32 +0200 (Wed, 21 Oct 2009) New Revision: 28865 Modified: docs/Perl6/Spec/S06-routines.pod Log: [S06] extend uniq name constraint to named parameters too Modified: docs/Perl6/Spec/S06-routines.pod ===

r28864 - docs/Perl6/Spec

2009-10-20 Thread pugs-commits
Author: masak Date: 2009-10-21 00:03:48 +0200 (Wed, 21 Oct 2009) New Revision: 28864 Modified: docs/Perl6/Spec/S06-routines.pod Log: [S06] same-named non-anon positionals are a compile error Modified: docs/Perl6/Spec/S06-routines.pod

Re: unusual invocants

2009-10-20 Thread TSa (Thomas Sandlaß)
HaloO, On Tuesday, 20. October 2009 18:35:36 David Green wrote: > >> So what the OP wants to do is declare a method that is available on > >> all those invocants - and only those invocatnts - which do all of > >> roles X, Y, and Z. Granted, you can declare a new role XandYandZ > >> that does X, Y

Re: lvalue methods

2009-10-20 Thread David Green
On 2009-Oct-20, at 8:04 am, Jon Lang wrote: The above example is of course trivial. A more serious example might be one based off of a coordinate system: role point { has Num $x, Num $y; method angle() is rw( { $.x = .r * cos($_); $.y = .r * sin($_) } ) { return atn($.y/$.x

Re: unusual invocants

2009-10-20 Thread David Green
On 2009-Oct-20, at 7:55 am, Matthew Walton wrote: On Tue, Oct 20, 2009 at 2:32 PM, Mark J. Reed wrote: On Mon, Oct 19, 2009 at 11:47 PM, Jon Lang wrote: Because a method is part of a role, and ought to abide by the same terms by which the role abides. If Logging doesn't do Numeric, it shou

lvalue methods

2009-10-20 Thread Jon Lang
I recently attempted to write a sample mutable role that made use of a number of lvalue methods, and I had a bear of a time getting it to work. Could we arrange for a more intuitive option to be available? For example, allow the programmer to pass a writer code block in through the rw trait, and a

Re: unusual invocants

2009-10-20 Thread Matthew Walton
On Tue, Oct 20, 2009 at 2:32 PM, Mark J. Reed wrote: > On Mon, Oct 19, 2009 at 11:47 PM, Jon Lang wrote: >> Because a method is part of a role, and ought to abide by the same >> terms by which the role abides.  If Logging doesn't do Numeric, it >> shouldn't have any methods in it that won't work

Re: unusual invocants

2009-10-20 Thread Mark J. Reed
On Mon, Oct 19, 2009 at 11:47 PM, Jon Lang wrote: > Because a method is part of a role, and ought to abide by the same > terms by which the role abides.  If Logging doesn't do Numeric, it > shouldn't have any methods in it that won't work unless it does. 100% agreed. So what the OP wants to do i

Re: Aliasing methods in CPAN roles

2009-10-20 Thread Raphael Descamps
Am Montag, den 19.10.2009, 16:43 -0700 schrieb Jon Lang: > Raphael Descamps wrote: > > I personally don't understand why we don't have a exclude and alias > > operator in Perl 6 but I have not read all the synopses and don't have > > an overview. > > I don't think that it's explicitly spelled out