Hmm, I'm not seeing the message from Daniel, just this reply.

I like the idea of having a class method primitive to provide some functionality. But type matching is more complex, as you can list multiple types juxtaposed.

   sub foo (A B £ C ::T $param)

and the actual match means does A, does B, and like C must all pass.

Also, note that ^like Point does more than just structure checking: it doesn't check against Point as it exists, but what Point would become (virtual type redefinitions) if it were declared as a direct base class, and also doesn't mean Point[defaultargument] but deduced generic arguments to Point-as-a-base-class that would work.


TSa |Perl 6| wrote:

Daniel Ruoso wrote:
hrmm... I might just be overlooking something... but...

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


$signature ~~ $capture


Point $p := $capture[0]


$capture[0] ~~ 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


which does a *structural* analysis.

Regards, TSa.

Reply via email to