develooper Front page | perl.perl6.language | Postings from April 2008

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

Thread Previous | Thread Next
From:
TSa
Date:
April 29, 2008 00:28
Subject:
Re: Polymorphism and Representations (Was: Re: First look: AdvancedPolymorphism whitepaper)
Message ID:
4816CE26.4040307@barco.com
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 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

   sub foo (Point $p) {...}

to mean

   $capture[0].^like(Point)

which does a *structural* analysis.


Regards, TSa.
-- 

"The unavoidable price of reliability is simplicity"  -- C.A.R. Hoare
1 + 2 + 3 + 4 + ... = -1/12  -- Srinivasa Ramanujan

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About