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 does not invent the answer!
The programmer of FoxPoint has to declare that explicitly via

   class FoxPoint does Point {...}


The point here is whom to delegate the association between FoxPoint and
Point...

I see only two systems: the meta and the type system. The latter is
still underspecced. Even more unspecced is their interrelation.


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 that 'realises' is spelled 'does'.
This is the infix operator that composes a role into an object's
class at runtime.


This way, the dispatching mechanism is still the same (and still typed),
but the object now also answers true to .^does(Point).

But note that

   FoxPoint $fp = ...;
   $y = $fp;
   $y === $fp; # obviously true

   $fp does Point;
   $y === $fp; # false because of different HOW?

Unfortunately S03 doesn't say if === checks for the same WHAT or the
same HOW as precondition to checking the WHICH. Generally WHAT is also
quite underspecced.


Which means that the typed code remains typed and the feature is
implemented as a trait that can be used to any object, thus leaving the
fragile type inference to the code calling the method and not to the
method that wants a stronger typing...

I don't understand what you want to say here.


Regards, TSa.
--

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

Reply via email to