Re: Roles and IO?

2008-12-12 Thread Dmitry Karasik
Hi Leon! Leon Perl 5's solution is to use a fat interface, and raise an error if Leon an unsupported action is tried. Wouldn't the proposed solution raise an error if an unsupported role method is tried? It's not that the proposed solution is inappropriate, but the problem that I

Re: Roles and IO?

2008-12-12 Thread Leon Timmermans
On Fri, Dec 12, 2008 at 3:04 AM, Jon Lang datawea...@gmail.com wrote: 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

Re: Roles and IO?

2008-12-12 Thread TSa
HaloO, Leon Timmermans wrote: I assumed a new role makes a new interface. In other words, that a type that happens to do Pollable, Mappable, Statable and Ownable wouldn't automatically do File in that case. I also think that a new role File that does also the four others is a new type on its

Re: Roles and IO?

2008-12-12 Thread Jon Lang
Leon Timmermans wrote: I assumed a new role makes a new interface. In other words, that a type that happens to do Pollable, Mappable, Statable and Ownable wouldn't automatically do File in that case. If I was wrong my abuse of subset wouldn't be necessary. Otherwise, maybe there should be a

Roles and IO?

2008-12-11 Thread Leon Timmermans
Hi all, I've been thinking about how the IO interface should be organized in perl6. It seems that part of S16 has received little attention so far. One main problem with filehandles is that are rather diverse. The only operation that all of them have in common is close. Reading versus writing is

Re: Roles and IO?

2008-12-11 Thread Jon Lang
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

Re: Roles and IO?

2008-12-11 Thread Brandon S. Allbery KF8NH
On 2008 Dec 11, at 20:16, Leon Timmermans wrote: One main problem with filehandles is that are rather diverse. The only operation that all of them have in common is close. Reading versus Be glad Xenix is dead. There were filehandles which didn't even support close() (they were actually

Re: Roles and IO?

2008-12-11 Thread Mark J. Reed
On Thu, Dec 11, 2008 at 8:16 PM, Leon Timmermans faw...@gmail.com 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),