HaloO,

Larry Wall wrote:
Then we'd write our "done_by" role above as:

    role Num-1.3-JRANDOM does STD:Num does Complex;
    method re (--> STD:Num) { self }
    method im (--> STD:Num) { 0.0 }

The first issue I see with this approach is that we get one
more contender for the plain name Complex because I think
one wants to define an authority Complex along with a role
and a class. I.e. I would want the import site to read:

  use Complex:Num;

Which also brings us to the second issue. To actually use
the Complex itself one then needs to write:

  use Complex;
  use Complex:Num;

unless Complex is a module that provides in addition to
homonymous role and class Complex a modified version of
Num under authority Complex. How would such a module be
defined?

  module Complex
  {
      role Complex {...}               # for the type
      class Complex does Complex {...} # for instanciation
      role Num-1.3-Complex does STD:Num does Complex
      {
          method re (--> STD:Num) { self }
          method im (--> STD:Num) { 0.0 }
      }
  }


Regards, TSa.
--

Reply via email to