Leon Timmermans wrote:
> What I propose is using role composition for *everything*. Most
> importantly that includes the roles Readable and Writable, but also
> things like Seekable, Mapable, Pollable, Statable, Ownable, Buffered
> (does Readable), Socket, Acceptable (does Pollable), and more.
>
> That may however make some interfaces is a bit wordy. I think that can
> be conveyed using a subset like this (though that may be abusing the
> feature).
>
> subset File of Mapable & Pollable & Statable & Ownable;

subset is the wrong approach: a subset is about taking an existing
role and restricting the range of objects that it will match.  What
you're really asking for are composite roles:

  role File does Mappable does Pollable does Statable does Ownable {}

One of the things about roles is that once you have composed a bunch
of them into another role, they're considered to be composed into
whatever that role is composed into.  So "does File" would be
equivalent to "does Mappable does Pollable does Statable does Ownable"
(barring potential conflicts between Mappable, Pollable, Statable, and
Ownable which File would presumably resolve).

-- 
Jonathan "Dataweaver" Lang

Reply via email to