HaloO,

Stevan Little wrote:
On 10/2/06, Jonathan Lang <[EMAIL PROTECTED]> wrote:
This notion of exclusionary roles is an interesting one, though.  I'd
like to hear about what kinds of situations would find this notion
useful; but for the moment, I'll take your word that such situations
exist and go from there.

Well to be honest, I haven't found a real-world usage for it yet (at
least in my travels so far), but the Fortress example was this:

 trait OrganicMolecule extends Molecule
     excludes { InorganicMolecule }
 end
 trait InorganicMolecule extends Molecule end

Wouldn't that be written in Perl6 the other way around?

  role OrganicMolecule {...}
  role InorganicMolecule {...}

  role Molecule does OrganicMolecule ^ InorganicMolecule {...}

Which is a nice usage of the xor role combinator.


And from that I could see that given a large enough set of roles you
would surely create roles which conflicted with one another on a
conceptual level rather then on a methods/attribute (i.e. - more
concrete) level.

I don't abide to that. If roles are conceptually modelling the same
entity their vocabulary should conflict also. Well unless some
differing coding conventions accidentally produce non-conflicting
roles. The whole point of type systems relies on the fact that
concrete conflicts indicate conceptual ones!


Regards,
--

Reply via email to