Re: Messing with the type heirarchy

2005-07-31 Thread Luke Palmer
On 7/27/05, Larry Wall [EMAIL PROTECTED] wrote: On Wed, Jul 27, 2005 at 11:00:20AM +, Luke Palmer wrote: Everything that is a Num is a Complex right? Not according to Liskov. Num is behaving more like a constrained subtype of Complex as soon as you admit that isa is about both

Re: Messing with the type heirarchy

2005-07-31 Thread Dave Whipp
Luke Palmer wrote: Everything that is a Num is a Complex right? Not according to Liskov But this is one of the standard OO paradoxes, and we're hoping roles are the way out of it. Well, everything that is a Num is a Complex in a value-typed world, which Num and Complex are in. I

Re: Messing with the type heirarchy

2005-07-28 Thread Michele Dondi
On Wed, 27 Jul 2005, [ISO-8859-1] TSa (Thomas Sandla?) wrote: value to carry on a useless imaginary part. And Complex should consistently return undef when compared to other Nums or Complexes. And the Compare role My 0.02+0.01i: in mathematics it is commonly used to write e.g. z3 to mean z

Re: Messing with the type heirarchy

2005-07-28 Thread TSa (Thomas Sandlaß)
HaloO Michele, you wrote: On Wed, 27 Jul 2005, [ISO-8859-1] TSa wrote: value to carry on a useless imaginary part. And Complex should consistently return undef when compared to other Nums or Complexes. And the Compare role My 0.02+0.01i: in mathematics it is commonly used to write e.g. z3

Messing with the type heirarchy

2005-07-27 Thread Luke Palmer
http://repetae.net/john/recent/out/supertyping.html This was a passing proposal to allow supertype declarations in Haskell. I'm referencing it here because it's something that I've had in the back of my mind for a while for Perl 6. I'm glad somebody else has thought of it. Something that is

Re: Messing with the type heirarchy

2005-07-27 Thread Aankhen
[sorry Luke, I hit Send too soon] On 7/27/05, Luke Palmer [EMAIL PROTECTED] wrote: There is probably a better word than contains. I was thinking set theory when I came up with that one. What about derives? Aankhen

Re: Messing with the type heirarchy

2005-07-27 Thread Ingo Blechschmidt
Hi, Luke Palmer wrote: http://repetae.net/john/recent/out/supertyping.html This was a passing proposal to allow supertype declarations in Haskell. I'm referencing it here because it's something that I've had in the back of my mind for a while for Perl 6. I'm glad somebody else has

Re: Messing with the type heirarchy

2005-07-27 Thread Luke Palmer
On 7/27/05, Ingo Blechschmidt [EMAIL PROTECTED] wrote: Luke Palmer wrote: role Complex does Object contains Num {...} I've probably misunderstood you, but...: role Complex does Object {...} Num does Complex; # That should work and DWYM, right?

Re: Messing with the type heirarchy

2005-07-27 Thread TSa (Thomas Sandlaß)
HaloO, Ingo Blechschmidt wrote: I've probably misunderstood you, but...: role Complex does Object {...} Num does Complex; # That should work and DWYM, right? My 0.02: Complex should provide e.g. a + that, when called with two Nums, doesn't bother the return value to carry on a

Re: Messing with the type heirarchy

2005-07-27 Thread Larry Wall
On Wed, Jul 27, 2005 at 11:00:20AM +, Luke Palmer wrote: : Let's say that Perl 6 does not provide a complex number class by : default. How would you go about writing one? Well, let's do the : standard Perl practice of making words that your users are supposed to : say in their code roles. :