Re: How are types related to classes and roles?

2005-03-07 Thread Thomas Sandlaß
HaloO, another self-reply :) I've added a little hack that classifies strings into these areas 0 to 3 to illustrate my idea of a type lattice on which composes the background of the Perl 6 Type System. Pattern matching and type systems are related but the question for Perl 6 is: how exactly? The

Re: How are types related to classes and roles?

2005-03-04 Thread Thomas Sandlaß
HaloO Larry, you wrote: One can view the auto-coercion as a form of MMD if you allow the autogeneration of any necessary coercion methods. However, it's not exactly a coercion to Str or Int--it's more like promotion to a Scalar that is able to pretend it is either Str or Int. Or you can view it

Re: How are types related to classes and roles?

2005-03-04 Thread chromatic
On Fri, 2005-03-04 at 21:12 +0100, Thomas Sandlaß wrote: The roles themself beeing the least member of these classes---uninstanciable pure behaviour. The intersection type/role AB is multiple inheritance (or is that roling?): I don't understand the question (I don't recognize the words lubs

Re: How are types related to classes and roles?

2005-03-04 Thread Thomas Sandlaß
HaloO chromatic, you wrote: I don't understand the question (I don't recognize the words lubs or glbs, for example), but I don't think this has anything at all to do with multiple inheritance. Sorry, that was given only in the picture: lub = least upper bound (also known as supremum) glb =

Re: How are types related to classes and roles?

2005-03-04 Thread Thomas Sandlaß
I wrote: A|B lub (lowest upper bound) / \ / \ A 0 B / \ / \ / \ / \ / AB \ glb (greatest lower bound) / 1 / \ 2 \ / / 3 \ \ I was a bit

Re: How are types related to classes and roles?

2005-02-28 Thread Thomas Sandlaß
HaloO Aaron, you wrote: Is there any reason at all that 6.0 should have return MMD? I mean, it's way-the-heck cool and all, but it became a thing when Parrot produced this capability as a by-product of the way MMD was implemented in conjunction with return continuations that doesn't mean we

Re: How are types related to classes and roles?

2005-02-28 Thread Aaron Sherman
On Mon, 2005-02-28 at 10:34, Thomas Sandla wrote: Am I missing something, but the only thing I've figured out so far is that Parrot uses ternary MMD for its builtin binary ops like ADD, MUL, OR, etc. They are ternary to prevent a final copy or conversion of the result to the target register.

Re: How are types related to classes and roles?

2005-02-28 Thread Thomas Sandlaß
HaloO Aaron, you wrote: Um... I think you're thinking of operator overloading, which in Parrot actually does use the MMD facility under the hood, but MMD is nominally a separate facility. You should glance at the PDDs, as they have far more detail than I'm aware of. You mean the ones in the

Re: How are types related to classes and roles?

2005-02-28 Thread Aaron Sherman
On Mon, 2005-02-28 at 12:45, Thomas Sandla wrote: Sorry, if this is the wrong list for discussing these Parrot details. Yeah, you really want to be in p6i, not p6l. These guys think a Parrot's just a bird that says funny things and sits on a pirate's shoulder ;-) PS:

Re: How are types related to classes and roles?

2005-02-28 Thread Leopold Toetsch
Thomas Sandlaß [EMAIL PROTECTED] wrote: Am I missing something, but the only thing I've figured out so far is that Parrot uses ternary MMD for its builtin binary ops like ADD, MUL, OR, etc. actually binary, dispatch is based on (left, right) operands. They are ternary to prevent a final copy

Re: How are types related to classes and roles?

2005-02-28 Thread Leopold Toetsch
Thomas Sandlaß [EMAIL PROTECTED] wrote: The opcodes for 'callmethod_MMD_3_sig func' and 'callmethod_MMD_n func, n' are simply not there yet, right? No. The problem is that at function call time there is no indication that a MMD subroutine should be called. So Parrot will just do a full MMD

Re: How are types related to classes and roles?

2005-02-27 Thread Thomas Sandlaß
HaloO, Larry Wall wrote: On Fri, Feb 25, 2005 at 12:45:45AM +0800, Autrijus Tang wrote: : So, I think late binding is a sensible (and practical) default, but : do you think it may be a good thing to have a type inference mode that : assign static contexts to expressions, and prebind as much as

Re: How are types related to classes and roles?

2005-02-24 Thread Nicholas Clark
On Fri, Feb 25, 2005 at 12:45:45AM +0800, Autrijus Tang wrote: On Wed, Feb 23, 2005 at 12:17:19PM -0800, Larry Wall wrote: : And how does all this combine with the notion of context? Lazily, for the most part. In some cases we can determine context at compile time, but often not.

Re: How are types related to classes and roles?

2005-02-24 Thread Larry Wall
On Thu, Feb 24, 2005 at 05:17:50PM +, Nicholas Clark wrote: : On Fri, Feb 25, 2005 at 12:45:45AM +0800, Autrijus Tang wrote: : On Wed, Feb 23, 2005 at 12:17:19PM -0800, Larry Wall wrote: : : And how does all this combine with the notion of context? : : Lazily, for the most part. In

Re: How are types related to classes and roles?

2005-02-24 Thread Larry Wall
On Fri, Feb 25, 2005 at 12:45:45AM +0800, Autrijus Tang wrote: : On Wed, Feb 23, 2005 at 12:17:19PM -0800, Larry Wall wrote: : : And how does all this combine with the notion of context? : : Lazily, for the most part. In some cases we can determine context at : compile time, but often not.

Re: How are types related to classes and roles?

2005-02-24 Thread Stéphane Payrard
On Thu, Feb 24, 2005 at 09:42:30AM -0800, Larry Wall wrote: Anyway, I don't profess to have thought deeply about type inferencing. But I do know that I don't want to turn Perl 6 into ML just yet... Larry Speaking of ML, it appears to me that Perl6 rules are a mechanism that can act very

How are types related to classes and roles?

2005-02-23 Thread Thomas Sandlaß
HaloO, I'm very puzzled about what is meant by type and class in Perl6. In the sort ruling http://groups-beta.google.com/group/perl.perl6.language/msg/1eb1ed4608f5604d we saw a system of types that allow to nicely dispatch into different version of sort. OTOH every class or role name can serve the

Re: How are types related to classes and roles?

2005-02-23 Thread Larry Wall
On Wed, Feb 23, 2005 at 06:21:02PM +0100, Thomas Sandlaß wrote: : HaloO, : : I'm very puzzled about what is meant by type and class in Perl6. : In the sort ruling : http://groups-beta.google.com/group/perl.perl6.language/msg/1eb1ed4608f5604d : we saw a system of types that allow to nicely