TSa wrote:
IOW, I fear this could only be put to work with two subset
declarations

   subset ab of Str where /^a.*b$/;
   subset aabb of ab where /^aa.*bb$/;

and the notion that the second subset by virtue of constraining
the possible values further produces a more specific subtype for
dispatch. That is nominal subtyping.

Perl 6 already uses nominal subtyping: S02 - "Types are officially
compared using name equivalence rather than structural equivalence."
There's further elaboration which addresses many of the concerns
involved with using nominal subtyping, so I'd suggest reading the
section in question before commenting.

BTW, the above example is a good case for introducing the subtype
relation operator <: because we have aabb <: ab <: Str but do we
also have aabb.does(ab) and ab.does(Str)? Could we also state that
aabb (<) ab (<) Str?


Regards, TSa.
--



--
Jonathan "Dataweaver" Lang

Reply via email to