Re: Quick question: '1.28' * '2.56'

2005-05-17 Thread Sam Vilain
Larry Wall wrote: : pugs> '1.28' * '2.56' : 3.2768 : What is (or should be) going on here here? : [1] role NumRole { : method infix:<*> returns Num (NumRole $x, NumRole $y: ) { ... } : } : Str.does(NumRole); : [3] multi sub prefix:<+> (Str $x) returns Num { ... } : multi s

Re: Quick question: '1.28' * '2.56'

2005-05-17 Thread Sam Vilain
Rob Kinyon wrote: If that's the case, then if I change a variable that isa Str (that isa Num), does it change what it inherits from? Please don't use "inherits" when talking about these core types. Classical inheritance just doesn't work with the varied sets of numbers. All those stories you were

Re: Quick question: '1.28' * '2.56'

2005-05-17 Thread Larry Wall
On Tue, May 17, 2005 at 09:04:19PM +0800, Autrijus Tang wrote: : Imagine: : : pugs> '1.28' * '2.56' : 3.2768 : : What is (or should be) going on here here? : : [1] role NumRole { : method infix:<*> returns Num (NumRole $x, NumRole $y: ) { ... } : } : Str.does(NumRole); : :

Re: Quick question: '1.28' * '2.56'

2005-05-17 Thread TSa (Thomas Sandlaß)
Autrijus Tang wrote: Imagine: pugs> '1.28' * '2.56' 3.2768 What is (or should be) going on here here? My personal favorite is [5] none of the above -- that should be a type error. ;) But only if MMD doesn't find a unique handler. That is I would favor 'type error' =:= 'no handler || ambiguo

Re: Quick question: '1.28' * '2.56'

2005-05-17 Thread Luke Palmer
On 5/17/05, Rob Kinyon <[EMAIL PROTECTED]> wrote: > > Maybe s/Num/NumLike/ or something? Anyway, that's how I think of it > > at least: not that a Str is converted into a Num, but rather that > > certain Strs are Nums. > > If that's the case, then if I change a variable that isa Str (that isa > N

Re: Quick question: '1.28' * '2.56'

2005-05-17 Thread Rob Kinyon
> Maybe s/Num/NumLike/ or something? Anyway, that's how I think of it > at least: not that a Str is converted into a Num, but rather that > certain Strs are Nums. If that's the case, then if I change a variable that isa Str (that isa Num), does it change what it inherits from? Rob

Re: Quick question: '1.28' * '2.56'

2005-05-17 Thread Luke Palmer
On 5/17/05, Autrijus Tang <[EMAIL PROTECTED]> wrote: > Imagine: > > pugs> '1.28' * '2.56' > 3.2768 > > What is (or should be) going on here here? > ... > [6] something else? I still don't quite have a handle on the object system. Maybe: subtype Num of Str where /^ $/; ? Maybe s/