Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread chromatic
On Thursday 01 May 2008 06:35:12 John M. Dlugosz wrote: chromatic chromatic-at-wgz.org |Perl 6| wrote: This is why roles-as-types is so important: type inferencers can't infer allomorphism because allomorphism relies on explicitly-marked semantic meanings. What is your nomenclature

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread TSa
HaloO, chromatic wrote: What are marked semantic meanings? Types. That is, in the context of Dog, bark means emit a sound. In the context of Tree, bark means the outer skin. Note that the only things that carry meaning in your other example my $result = $thingie.bark; are the

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread Ovid
--- chromatic [EMAIL PROTECTED] wrote: Given: my $result = $thingie.bark; ... where $thingie may be a Dog or $thingie may be a Tree, is bark a noun or a verb? Sure, it's a lousy example, but remember the immutable law of OO didactics: all examples must be terrible. As a

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread Ovid
--- John M. Dlugosz [EMAIL PROTECTED] wrote: chromatic chromatic-at-wgz.org |Perl 6| wrote: This is why roles-as-types is so important: type inferencers can't infer allomorphism because allomorphism relies on explicitly-marked semantic meanings. What is your nomenclature here?

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread TSa
HaloO, Ovid wrote: However, the CGI/CGI::Simple example I posted earlier doesn't fulfill this. CGI::Simple offers a subset of CGI.pm's functionality and it's guaranteed to be identical Then, since classes are open, the programmer can easily say CGI does CGI::Simple; and let go CGI

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread John M. Dlugosz
Ovid publiustemp-perl6language2-at-yahoo.com |Perl 6| wrote: However, the CGI/CGI::Simple example I posted earlier doesn't fulfill this. CGI::Simple offers a subset of CGI.pm's functionality and it's guaranteed to be identical (it doesn't have HTML generation functionality and the procedural/OO

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread John M. Dlugosz
chromatic chromatic-at-wgz.org |Perl 6| wrote: If I tell the type system that Foo and Bar are equivalent, then they're equivalent even if they have different internal structures and no other relationship in an inheritance sense. I agree. If typing is turned on, you want errors if you

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread Daniel Ruoso
Sex, 2008-05-02 às 14:38 +0200, TSa escreveu: Ovid wrote: However, the CGI/CGI::Simple example I posted earlier doesn't fulfill this. CGI::Simple offers a subset of CGI.pm's functionality and it's guaranteed to be identical Then, since classes are open, the programmer can easily say

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread TSa
HaloO, Daniel Ruoso wrote: Not really... 'does' will try to compose the CGI::Simple methods to the CGI class (although I think your example was supposed to be CGI::Simple does CGI, but anyway). Hardly. Ovid said that CGI has more functionality than CGI::Simple. So the hope for

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread John M. Dlugosz
TSa Thomas.Sandlass-at-barco.com |Perl 6| wrote: sub graph ( func where {.does: Continuous}, Num $from, Num $to ) {...} sub square ( Num $x -- Num ) does Continuous { return $x * $x } graph( square, -10.0, 10.0 ); # type correct The odd thing to me is that graph cannot be defined as

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread John M. Dlugosz
Ovid publiustemp-perl6language2-at-yahoo.com |Perl 6| wrote: Implemented as: method read ( -- Boolean ) { ... } (How do I specify no args and a Boolean return type?) Take your pick: our Bool method read () { ... } method read (--Bool) { ... } method read () of Bool { ... }

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread John M. Dlugosz
TSa Thomas.Sandlass-at-barco.com |Perl 6| wrote: Then, since classes are open, the programmer can easily say CGI does CGI::Simple; That would be class CGI is also { does CGI::Simple } and means that CGI::Simple is a role, meant to serve as an interface specification. It's not, it is a

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread Larry Wall
On Fri, May 02, 2008 at 08:30:25AM -0500, John M. Dlugosz wrote: I agree. If typing is turned on, you want errors if you pass the wrong type. You have to explicitly declare that Bar is an acceptable substitute for Foo. Maybe we already have this--see emulates in S11. Larry

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread Larry Wall
On Fri, May 02, 2008 at 08:47:28AM -0500, John M. Dlugosz wrote: In Perl 6, within a signature sub foo ( f:(Int--Int) ) sub foo ( Continuous f ) The latter says that f is of type Continuous, not that the return type is Continuous. That is what you want, right? The latter would be

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread John M. Dlugosz
Daniel Ruoso daniel-at-ruoso.com |Perl 6| wrote: Sex, 2008-05-02 às 09:08 -0500, John M. Dlugosz escreveu: A syntax is needed for this express concept: accept B as a substitute for A, without changing A. Which I'm advocating as class CGI::Simple realises CGI { ... } or

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread John M. Dlugosz
Larry Wall larry-at-wall.org |Perl 6| wrote: On Fri, May 02, 2008 at 08:30:25AM -0500, John M. Dlugosz wrote: I agree. If typing is turned on, you want errors if you pass the wrong type. You have to explicitly declare that Bar is an acceptable substitute for Foo. Maybe we already

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread TSa
HaloO, I wrote: I'm actually not sure that you can have 'CGI does CGI::Simple', since CGI::Simple is not a role... An intermediate, anonymous class is a mere implementation detail ;) Sorry I meant an anonymous role created from the definition of CGI::simple. Assuming compatibility of CGI

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread Larry Wall
On Fri, May 02, 2008 at 11:34:33AM +0200, TSa wrote: My idea is that foo:( Foo f ) should mean the same as foo:( Foo $x ), that is the variables have to contain a value that does Foo. No, I think f should be treated more like @f and %f as a composite object with a normal return type for the

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread mark . a . biggar
-- Original message -- From: TSa [EMAIL PROTECTED] HaloO, John M. Dlugosz wrote: Maybe we already have this--see emulates in S11. Works for me. For me, too. But note that we should keep does the ultimate type checker that first checks the declared

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread chromatic
On Friday 02 May 2008 07:08:21 John M. Dlugosz wrote: TSa Thomas.Sandlass-at-barco.com |Perl 6| wrote: Then, since classes are open, the programmer can easily say CGI does CGI::Simple; That would be class CGI is also { does CGI::Simple } and means that CGI::Simple is a role,

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread John M. Dlugosz
mark.a.biggar-at-comcast.net |Perl 6| wrote: For me, too. But note that we should keep does the ultimate type checker that first checks the declared presence of a role, then falls back to a declared class inheritance and then falls back to a declared emulation. What else should be in this check

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread Larry Wall
On Fri, May 02, 2008 at 11:15:34AM -0700, chromatic wrote: : On Friday 02 May 2008 07:08:21 John M. Dlugosz wrote: : : TSa Thomas.Sandlass-at-barco.com |Perl 6| wrote: : : Then, since classes are open, the programmer can easily say : : CGI does CGI::Simple; : : That would be : :

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread TSa
HaloO, Larry Wall wrote: I don't think most people want to think of functions as types--it just clutters up the type namespace. Which contradicts their first-class status. They can already say: sub mysubuser ( f where mysub.sig ) {...} or some such to do explicit smartmatching

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread chromatic
On Friday 02 May 2008 11:55:54 Larry Wall wrote: On Fri, May 02, 2008 at 11:15:34AM -0700, chromatic wrote: : All classes imply the existence of a role of the same name. If a role is derived from a class, it must of necessity be a snapshot of the class, because roles are immutable, while

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread TSa
HaloO, Daniel Ruoso wrote: You're taking it backwards, it's not the type checker that is aware of that, but each object's metamodel. The metamodel protocol is just the do you 'Dog'? thing. Backwards in the sequence of checks? That is we check emulation first, then class inheritance and then

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread Larry Wall
On Fri, May 02, 2008 at 12:21:27PM -0700, chromatic wrote: : On Friday 02 May 2008 11:55:54 Larry Wall wrote: : The only interesting question in my mind is whether you can take : another snapshot and override the previous one somehow, or whether : such derived roles should version themselves so

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread TSa
HaloO, Daniel Ruoso wrote: In fact, it simply means that it's up to that object's metaobject to answer that, and not to a supra-meta-model to be able to answer to all of the possible metamodel implementations. Since all three forms are derived from a programmer's declaration involving names

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread chromatic
On Friday 02 May 2008 12:48:43 Larry Wall wrote: On Fri, May 02, 2008 at 12:21:27PM -0700, chromatic wrote: : I'm not sure which is best. Snapshotting at the time of first : composition (or the first time someone says Hey, I provide that other : class's role!) seems right though. Or maybe

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread Daniel Ruoso
Sex, 2008-05-02 às 18:55 +0200, TSa escreveu: For me, too. But note that we should keep does the ultimate type checker that first checks the declared presence of a role, then falls back to a declared class inheritance and then falls back to a declared emulation. What else should be in this

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread Daniel Ruoso
Sex, 2008-05-02 às 21:49 +0200, TSa escreveu: Daniel Ruoso wrote: In fact, it simply means that it's up to that object's metaobject to answer that, and not to a supra-meta-model to be able to answer to all of the possible metamodel implementations. Since all three forms are derived from a

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread John M. Dlugosz
Andy_Bach-at-wiwb.uscourts.gov |Perl 6| wrote: in. Er, so would: my CGI::Simple $x .= new; my $y = CGI::Simple.new; mean that: $x whatever the compare class operater is $y is not true? Or would there be a way to tell them apart, on a class (?) level. The actual dynamic type at run

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread Daniel Ruoso
Sex, 2008-05-02 às 09:08 -0500, John M. Dlugosz escreveu: A syntax is needed for this express concept: accept B as a substitute for A, without changing A. Which I'm advocating as class CGI::Simple realises CGI { ... } or CGI::Simple is also { realises CGI } or even...

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread Daniel Ruoso
Sex, 2008-05-02 às 21:22 +0200, TSa escreveu: Or do you mean backwards in the sense that the priority is with the object somehow? In fact, it simply means that it's up to that object's metaobject to answer that, and not to a supra-meta-model to be able to answer to all of the possible

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread Jonathan Worthington
John M. Dlugosz wrote: Andy_Bach-at-wiwb.uscourts.gov |Perl 6| wrote: in. Er, so would: my CGI::Simple $x .= new; my $y = CGI::Simple.new; mean that: $x whatever the compare class operater is $y is not true? Or would there be a way to tell them apart, on a class (?) level. The actual

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread John M. Dlugosz
Larry Wall larry-at-wall.org |Perl 6| wrote: If a role is derived from a class, According to S12: A role may not inherit from a class... it must of necessity be a snapshot of the class, because roles are immutable, while classes are not. The only interesting question in my mind is whether

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread John M. Dlugosz
TSa Thomas.Sandlass-at-barco.com |Perl 6| wrote: Would you be so kind to enlighten me what the type system is, if not a type calculation overlaid over a value calculation? Regards, TSa. The other day I put it for those not following the scholarly stuff: The questions of “can this substitute

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread John M. Dlugosz
chromatic chromatic-at-wgz.org |Perl 6| wrote: Do we face a similar rug-yanking situation with delegatee classes being modified after delegate instantiation? I know there are some types of auto-handling, but are they all automatic? -- c In the sense that the more detailed formal

Re: First look: Advanced Polymorphism whitepaper

2008-05-02 Thread John M. Dlugosz
Jonathan Worthington jonathan-at-jnthn.net |Perl 6| wrote: $x.nosuchmethod; will give a compile-time error if nosuchmethod is not declared as part of CGI::Simple. Is this spec'd somewhere? I don't think we can statically know what methods CGI::Simple will have at compile time. What if I do a

Re: First look: Advanced Polymorphism whitepaper

2008-05-01 Thread chromatic
On Wednesday 30 April 2008 21:58:50 Brandon S. Allbery KF8NH wrote: On May 1, 2008, at 0:53 , chromatic wrote: correctness sense. Sadly, both trees and dogs bark.) Hm, no. One's a noun, the other's a verb. Given the linguistic orientation of [Perl 6], it seems a bit strange that the

Re: First look: Advanced Polymorphism whitepaper

2008-05-01 Thread John M. Dlugosz
Jon Lang dataweaver-at-gmail.com |Perl 6| wrote: On Wed, Apr 30, 2008 at 9:58 PM, Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote: On May 1, 2008, at 0:53 , chromatic wrote: correctness sense. Sadly, both trees and dogs bark.) Hm, no. One's a noun, the other's a verb.

Re: First look: Advanced Polymorphism whitepaper

2008-05-01 Thread John M. Dlugosz
chromatic chromatic-at-wgz.org |Perl 6| wrote: This is why roles-as-types is so important: type inferencers can't infer allomorphism because allomorphism relies on explicitly-marked semantic meanings. What is your nomenclature here? vary in sound without changing its meaning? What are

Re: First look: Advanced Polymorphism whitepaper

2008-05-01 Thread mark . a . biggar
-- Original message -- From: John M. Dlugosz [EMAIL PROTECTED] Jon Lang dataweaver-at-gmail.com |Perl 6| wrote: On Wed, Apr 30, 2008 at 9:58 PM, Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote: On May 1, 2008, at 0:53 , chromatic wrote:

Re: First look: Advanced Polymorphism whitepaper

2008-05-01 Thread Dave Whipp
Brandon S. Allbery KF8NH wrote: But there *is* some commonality there, to the extent that both are motion. This is the kind of thing that spawned this discussion, in fact: if what matters is motion, there is no reason *not* to substitute one for the other. { draw $gun }: makes a big

Re: First look: Advanced Polymorphism whitepaper

2008-05-01 Thread Larry Wall
On Thu, May 01, 2008 at 10:02:27AM -0700, Dave Whipp wrote: Brandon S. Allbery KF8NH wrote: But there *is* some commonality there, to the extent that both are motion. This is the kind of thing that spawned this discussion, in fact: if what matters is motion, there is no reason *not* to

Re: Polymorphism and Representations (Was: Re: First look: Advanced Polymorphism whitepaper)

2008-04-30 Thread TSa
HaloO, Daniel Ruoso wrote: [ I'm using this message to reply, because I didn't receive your reply... I'm taking it from the list history... There really seems to be something wrong with this list... ] I see all your messages arrive twice. This is not specced apparently to leave room for

Re: Polymorphism and Representations (Was: Re: First look: Advanced Polymorphism whitepaper)

2008-04-30 Thread TSa
HaloO, John M. Dlugosz wrote: TSa Thomas.Sandlass-at-barco.com |Perl 6| wrote: multi infix:= (Any $lhs, A $rhs) { $lhs.STORE($rhs.clone); # or .cow if that's not automatic } $lhs.VAR.STORE. I guess I also forgot the is rw to get a binding to the caller's container not

Re: First look: Advanced Polymorphism whitepaper

2008-04-30 Thread Ovid
--- chromatic [EMAIL PROTECTED] wrote: $p1 must be like a Point, but it needn't actually be a Point. Both $p2 and the return value must be the same type of thing that $p1 is. That was always my goal for roles in the first place. I'll be a little sad if Perl 6 requires an explicit

Re: First look: Advanced Polymorphism whitepaper

2008-04-30 Thread Daniel Ruoso
Qua, 2008-04-30 às 08:56 -0700, Ovid escreveu: I had initially thought this, but think about the case where someone wants to rewrite something to be compliant to another interface. If I pass a CGI::Simple object to a method expecting a CGI object, there's an excellent chance that it will

Re: First look: Advanced Polymorphism whitepaper

2008-04-30 Thread John M. Dlugosz
Daniel Ruoso daniel-at-ruoso.com |Perl 6| wrote: Qua, 2008-04-30 às 08:56 -0700, Ovid escreveu: I had initially thought this, but think about the case where someone wants to rewrite something to be compliant to another interface. If I pass a CGI::Simple object to a method expecting a CGI

Re: First look: Advanced Polymorphism whitepaper

2008-04-30 Thread chromatic
On Wednesday 30 April 2008 08:56:24 Ovid wrote: That was always my goal for roles in the first place. I'll be a little sad if Perl 6 requires an explicit notation to behave correctly here -- that is, if the default check is for subtyping, not polymorphic equivalence. I had initially

Re: First look: Advanced Polymorphism whitepaper

2008-04-30 Thread Brandon S. Allbery KF8NH
On May 1, 2008, at 0:53 , chromatic wrote: correctness sense. Sadly, both trees and dogs bark.) Hm, no. One's a noun, the other's a verb. Given the linguistic orientation of Perl6, it seems a bit strange that the syntax for both is the same: while accessors and mutators are

Re: First look: Advanced Polymorphism whitepaper

2008-04-30 Thread Jon Lang
On Wed, Apr 30, 2008 at 9:58 PM, Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote: On May 1, 2008, at 0:53 , chromatic wrote: correctness sense. Sadly, both trees and dogs bark.) Hm, no. One's a noun, the other's a verb. Given the linguistic orientation of Perl6, it seems a bit

Re: First look: Advanced Polymorphism whitepaper

2008-04-30 Thread Brandon S. Allbery KF8NH
On May 1, 2008, at 1:30 , Jon Lang wrote: On Wed, Apr 30, 2008 at 9:58 PM, Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote: On May 1, 2008, at 0:53 , chromatic wrote: correctness sense. Sadly, both trees and dogs bark.) Hm, no. One's a noun, the other's a verb. Given the

Re: First look: Advanced Polymorphism whitepaper

2008-04-30 Thread Larry Wall
On Thu, May 01, 2008 at 01:34:45AM -0400, Brandon S. Allbery KF8NH wrote: On May 1, 2008, at 1:30 , Jon Lang wrote: In defense of chromatic's point, both people and syrup run. But there *is* some commonality there, to the extent that both are motion. This is the kind of thing that spawned

Re: First look: Advanced Polymorphism whitepaper

2008-04-30 Thread Brandon S. Allbery KF8NH
On May 1, 2008, at 1:46 , Larry Wall wrote: On Thu, May 01, 2008 at 01:34:45AM -0400, Brandon S. Allbery KF8NH wrote: On May 1, 2008, at 1:30 , Jon Lang wrote: In defense of chromatic's point, both people and syrup run. But there *is* some commonality there, to the extent that both are

Re: Polymorphism and Representations (Was: Re: First look: Advanced Polymorphism whitepaper)

2008-04-29 Thread TSa
HaloO, Daniel Ruoso wrote: hrmm... I might just be overlooking something... but... sub foo (Point $p) {...} means... $signature ~~ $capture means... Point $p := $capture[0] means... $capture[0] ~~ Point means... $capture[0].^does(Point) The thing is the .^does traverses the meta

Re: First look: Advanced Polymorphism whitepaper

2008-04-29 Thread TSa
HaloO chromatic, you wrote: That was always my goal for roles in the first place. I'll be a little sad if Perl 6 requires an explicit notation to behave correctly here -- that is, if the default check is for subtyping, not polymorphic equivalence. What is polymorphic equivalence to you? I

Re: First look: Advanced Polymorphism whitepaper

2008-04-29 Thread TSa
HaloO, Jon Lang wrote: What, if anything, is the significance of the fact that pointlike (in John's example; 'Point' in TSa's counterexample) is generic? Note that I didn't give a counterexample. I just used different syntax. Here values and types behave very similar. On the value level you

Re: Polymorphism and Representations (Was: Re: First look: Advanced Polymorphism whitepaper)

2008-04-29 Thread TSa
HaloO, Daniel Ruoso wrote: .^does *might* traverse the information as well as simply return true if the object says so. Let's not regard the problem of meta level interoperation for now. That is we have *one* meta level. The spec says that .^does asks this meta system. Now the meta system

Re: Polymorphism and Representations (Was: Re: First look: Advanced Polymorphism whitepaper)

2008-04-29 Thread Daniel Ruoso
Ter, 2008-04-29 às 09:28 +0200, TSa escreveu: The thing is the .^does traverses the meta information to find the *named* concept Point. The FoxPoint in John's example doesn't have that and thus nominally fails the Point test. The idea is now to also have .^does *might* traverse the

Re: Polymorphism and Representations (Was: Re: First look: Advanced Polymorphism whitepaper)

2008-04-29 Thread Daniel Ruoso
Ter, 2008-04-29 às 11:54 +0200, TSa escreveu: If we are to define an operator to declare that some arbitrary object conforms to some API, I would think the following as saner... sub foo(Point $p) {...}; FoxPoint $fp = ...; $fp realises Point; foo($fp); Here the spec is quite clear

Re: Polymorphism and Representations (Was: Re: First look: Advanced Polymorphism whitepaper)

2008-04-29 Thread TSa
HaloO, Daniel Ruoso wrote: Not really... 'does' is a composition operation, 'realises' would be just a type annotation that doesn't change the actual composition. OK, but that is not in the spec yet. To me that is like the proposed 'like' operator but with the programmer taking full

Re: Polymorphism and Representations (Was: Re: First look: Advanced Polymorphism whitepaper)

2008-04-29 Thread TSa
HaloO, Daniel Ruoso wrote: So... class A { has $.a; method inc { $.a++ } }; $a = A.new( a = 0); $b = $a; $b.inc(); $a.inc(); say $a.a; # 2 say $b.a; # 2 Will work as expected. Depends a bit on one's expectations :) So infix:= has shallow copy semantics.

Re: Polymorphism and Representations (Was: Re: First look: Advanced Polymorphism whitepaper)

2008-04-29 Thread John M. Dlugosz
TSa Thomas.Sandlass-at-barco.com |Perl 6| wrote: HaloO, Daniel Ruoso wrote: Not really... 'does' is a composition operation, 'realises' would be just a type annotation that doesn't change the actual composition. OK, but that is not in the spec yet. To me that is like the proposed 'like'

Re: Polymorphism and Representations (Was: Re: First look: Advanced Polymorphism whitepaper)

2008-04-29 Thread John M. Dlugosz
TSa Thomas.Sandlass-at-barco.com |Perl 6| wrote: multi infix:= (Any $lhs, A $rhs) { $lhs.STORE($rhs.clone); # or .cow if that's not automatic } $lhs.VAR.STORE. My readings have been that = just copies the ref. Unless it's a value type or immutable which just means that

Re: Polymorphism and Representations (Was: Re: First look: Advanced Polymorphism whitepaper)

2008-04-29 Thread Daniel Ruoso
[ I'm using this message to reply, because I didn't receive your reply... I'm taking it from the list history... There really seems to be something wrong with this list... ] TSa wrote: BTW, is WHICH globally unique? Or is that also an implementation detail? This is not specced apparently to

Re: Polymorphism and Representations (Was: Re: First look: Advanced Polymorphism whitepaper)

2008-04-29 Thread Daniel Ruoso
Ter, 2008-04-29 às 14:21 +0200, TSa escreveu: Daniel Ruoso wrote: Not really... 'does' is a composition operation, 'realises' would be just a type annotation that doesn't change the actual composition. OK, but that is not in the spec yet. To me that is like the proposed 'like' operator but

Re: First look: Advanced Polymorphism whitepaper

2008-04-28 Thread Ovid
--- John M. Dlugosz [EMAIL PROTECTED] wrote: Here is a first look at the ideas I've worked up concerning the Perl 6 type system. It's an overview of the issues and usage of higher-order types in comparison with traditional subtyping subclasses. http://www.dlugosz.com/Perl6/ Nice paper.

Re: First look: Advanced Polymorphism whitepaper

2008-04-28 Thread John M. Dlugosz
Ovid publiustemp-perl6language2-at-yahoo.com |Perl 6| wrote: This might not be too big a deal, but the formatting of the code is a bit odd. It's not monospaced and the indentation and brace placement seem very arbitrary. Since these items are always code smells to me of a bad programmer[1],

Re: First look: Advanced Polymorphism whitepaper

2008-04-28 Thread Ovid
--- John M. Dlugosz [EMAIL PROTECTED] wrote: If the braces and positioning is funny, I wonder if it's a rendering thing. I'm using Windows and have the fonts. Could you post a screen shot and point out what's inconsistent? I see that a large part of this is that we have significantly

Re: First look: Advanced Polymorphism whitepaper

2008-04-28 Thread Jon Lang
John M. Dlugosz wrote: Here is a first look at the ideas I've worked up concerning the Perl 6 type system. It's an overview of the issues and usage of higher-order types in comparison with traditional subtyping subclasses. http://www.dlugosz.com/Perl6/ Very interesting, if puzzling, read.

Re: First look: Advanced Polymorphism whitepaper

2008-04-28 Thread TSa
HaloO, Jon Lang wrote: I'm having some difficulty understanding the business with £. I _think_ that you're saying that £ sort of acts as a prefix operator that changes the meaning of the type with which it is associated; and the only time that a change in meaning occurs is if the type in

Re: First look: Advanced Polymorphism whitepaper

2008-04-28 Thread Jon Lang
TSa wrote: The use of £ in sub foo (£ pointlike ::PointType $p1, PointType $p2 -- PointType) is that of *structural* subtyping. Here FoxPoint is found to be pointlike. In that I would propose again to take the 'like' operator from JavaScript 2. Doing that the role should be better

Re: First look: Advanced Polymorphism whitepaper

2008-04-28 Thread John M. Dlugosz
Jon Lang dataweaver-at-gmail.com |Perl 6| wrote: I'm having some difficulty understanding the business with £. I _think_ that you're saying that £ sort of acts as a prefix operator that changes the meaning of the type with which it is associated; and the only time that a change in meaning

Re: First look: Advanced Polymorphism whitepaper

2008-04-28 Thread Jon Lang
chromatic wrote: Jon Lang wrote: Ah; that clears things up considerably. If I understand you correctly, John is using '£' to mean use Duck Typing here. _That_, I can definitely see uses for. As well, spelling it as 'like' instead of '£' is _much_ more readable. With this in mind,

Re: First look: Advanced Polymorphism whitepaper

2008-04-28 Thread John M. Dlugosz
TSa Thomas.Sandlass-at-barco.com |Perl 6| wrote: HaloO, Jon Lang wrote: I'm having some difficulty understanding the business with £. I _think_ that you're saying that £ sort of acts as a prefix operator that changes the meaning of the type with which it is associated; and the only time that

Re: First look: Advanced Polymorphism whitepaper

2008-04-28 Thread Jon Lang
John M. Dlugosz wrote: TSa wrote: Jon Lang wrote: I'm having some difficulty understanding the business with £. I _think_ that you're saying that £ sort of acts as a prefix operator that changes the meaning of the type with which it is associated; and the only time that a change in

Re: First look: Advanced Polymorphism whitepaper

2008-04-28 Thread John M. Dlugosz
Andy_Bach-at-wiwb.uscourts.gov |Perl 6| wrote: Just an even simpler question: sub bendit (£ IBend ::T $p --T) { T $q = get_something; Does the T ... usage then scope the var so no 'my/our' is needed? a --- Andy Bach Systems Mangler Internet: [EMAIL PROTECTED] Voice:

Re: First look: Advanced Polymorphism whitepaper

2008-04-28 Thread John M. Dlugosz
Jon Lang dataweaver-at-gmail.com |Perl 6| wrote: Ah; that clears things up considerably. If I understand you correctly, John is using '£' to mean use Duck Typing here. _That_, I can definitely see uses for. As well, spelling it as 'like' instead of '£' is _much_ more readable. With this in

Re: First look: Advanced Polymorphism whitepaper

2008-04-28 Thread John M. Dlugosz
chromatic chromatic-at-wgz.org |Perl 6| wrote: That was always my goal for roles in the first place. I'll be a little sad if Perl 6 requires an explicit notation to behave correctly here -- that is, if the default check is for subtyping, not polymorphic equivalence. -- c Perhaps the

Re: First look: Advanced Polymorphism whitepaper

2008-04-28 Thread John M. Dlugosz
Jon Lang dataweaver-at-gmail.com |Perl 6| wrote: Perhaps it would be clearer if you could illustrate the difference between sub bendit (£ IBend ::T $p --T) { T $q = get_something; my T $result= $p.merge($q); return $result; } and sub bendit (IBend ::T $p --T)

Polymorphism and Representations (Was: Re: First look: Advanced Polymorphism whitepaper)

2008-04-28 Thread Daniel Ruoso
Seg, 2008-04-28 às 10:15 -0700, Jon Lang escreveu: Ah; that clears things up considerably. If I understand you correctly, John is using '£' to mean use Duck Typing here. _That_, I can definitely see uses for. hrmm... I might just be overlooking something... but... sub foo (Point $p) {...}

Re: First look: Advanced Polymorphism whitepaper

2008-04-28 Thread John M. Dlugosz
Jon Lang dataweaver-at-gmail.com |Perl 6| wrote: John M. Dlugosz wrote: I think I see another whitepaper in my immediate future. I look forward to it. I'll put a link to it on http://www.dlugosz.com/Perl6/, perhaps even before I'm finished with it. --John