Re: role invocant slot in type sig (was: unusual invocants)

2009-10-26 Thread TSa (Thomas Sandlaß)
HaloO, On Thursday, 22. October 2009 20:58:15 I wrote: > The class Dogwood however might be written as > >class Dogwood does Dog[Dogwood:] does Wood[Dogwood:] >{ >method Dog {...} >method Wood {...} >method bark {...} >} On #perl there was the question if any t

Re: unusual invocants

2009-10-26 Thread TSa (Thomas Sandlaß)
HaloO, On Sunday, 25. October 2009 01:38:21 Martin D Kealey wrote: > Sounds like going back to static typing -- which does sometimes have some > advantages. Well, you can also consider it dynamic. The important point is that it is a constraint on allowed types e.g. in the sig of a sub or on a var

Re: unusual invocants

2009-10-24 Thread Martin D Kealey
On Wed, 21 Oct 2009, Ben Morrow wrote: > The most important detail here is that the *class* gets to pick which > imported methods need to be wrapped. [but] > What this doesn't fix is that some other code (outside the class) will be > expecting C::x to have T1::x semantics, and some will be expectin

role invocant slot in type sig (was: unusual invocants)

2009-10-22 Thread TSa (Thomas Sandlaß)
HaloO, On Thursday, 22. October 2009 18:31:16 I wrote: > The invocant slot of the role signature is sort of implied in the spec > already! I also like this because a type in Perl 6 is then always > written as SomeRole[SomeClass:]. Classes without explicit roles are > Any[SomeClass:] and untyped is

Re: unusual invocants

2009-10-22 Thread TSa
HaloO, Ben Morrow wrote: Isn't this just sugar for something like Yes it is. My intent was to lighten the burden. I think we can agree that Ovid's problem can be solved by means of the current spec and some support syntax could be easily added. What this doesn't fix is that some other code

Re: unusual invocants

2009-10-22 Thread Ben Morrow
Quoth tho...@sandlass.de ("TSa (Thomas =?utf-8?q?Sandla=C3=9F?=)"): > > Here is a direct syntax for the freeze feature of the paper: > > class C does T1 does T2 > { > freeze T1::x for foo; > freeze T2::x for bar; > method x {...} # for all other methods > } > > The implem

Re: unusual invocants

2009-10-21 Thread TSa (Thomas Sandlaß)
HaloO, On Wednesday, 21. October 2009 12:40:06 Mark J. Reed wrote: > Rather than disallow the composition, I'd say that any class, role, or > object that does both roles must override the method in question. The problem that Ovid posed needs to be resolved in the dispatch tables seen in certain m

Re: unusual invocants

2009-10-21 Thread Jon Lang
TSa wrote: > Jon Lang wrote: >> >> I have some more thoughts on this; but I'm on a time crunch at the >> moment, and would really like to get some feedback on the above before >> proceeding further: have I missed anything in my reasoning? > > I fully understand what you mean, I hope. But note that

Re: unusual invocants

2009-10-21 Thread TSa
HaloO, Jon Lang wrote: I have some more thoughts on this; but I'm on a time crunch at the moment, and would really like to get some feedback on the above before proceeding further: have I missed anything in my reasoning? I fully understand what you mean, I hope. But note that all instances of

Re: unusual invocants

2009-10-21 Thread Jon Lang
Jonathan Worthington wrote: > Ovid wrote: >> >> I was asking the special case where: >> >> 1. A class consumes two (or more) roles >> 2. Each roles provides a method with an identical signature >> 3. The methods are not equivalent and neither role can rely on the other's >> method >> >>  With that,

Re: unusual invocants

2009-10-21 Thread Jonathan Worthington
Ovid wrote: I was asking the special case where: 1. A class consumes two (or more) roles 2. Each roles provides a method with an identical signature 3. The methods are not equivalent and neither role can rely on the other's method With that, you have roles which cannot be composed. You must

Re: unusual invocants

2009-10-21 Thread Mark J. Reed
On Wed, Oct 21, 2009 at 3:47 AM, Ovid wrote: > I was asking the special case where: > > 1. A class consumes two (or more) roles > 2. Each roles provides a method with an identical signature > 3. The methods are not equivalent and neither role can rely on the other's > method > > > With that, you

Re: unusual invocants

2009-10-21 Thread Ovid
- Original Message > From: TSa (Thomas Sandlaß) > > >> 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

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

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: 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

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: unusual invocants

2009-10-19 Thread Jon Lang
David Green wrote: > Jon Lang wrote: >> In "Aiasing methods in CPAN roles", David Green wrote: >>> >>> I don't want my special log() method to work only for other types that >>> explicitly do NumLog; I want it to work for any type that directly "does >>> Numeric does Logging". >> >> But if Logging

Re: unusual invocants

2009-10-19 Thread David Green
On 2009-Oct-19, at 5:50 pm, Jon Lang wrote: In "Aiasing methods in CPAN roles", David Green wrote: I don't want my special log() method to work only for other types that explicitly do NumLog; I want it to work for any type that directly "does Numeric does Logging". But if Logging doesn't do

unusual invocants

2009-10-19 Thread Jon Lang
In "Aiasing methods in CPAN roles", David Green wrote: > Jon Lang wrote: >> David Green wrote: >>> >>> I would expect that "role Logging { method log(Numeric $x:) {...} }" >>> means the invocant is really of type Numeric & Logging, without Logging >>> having to do Numeric.  On the other hand, I can