supply and demand (was: Roles and Mix-ins?)

2004-01-07 Thread Jonathan Lang
Austin Hastings wrote: Jonathan Lang wrote: Austin Hastings wrote: There's two ways to look at that. One way is to say: I'm going to define an interface as being this OTHER thing minus a method. That seems like a positive construction, and supporting it might be desirable. The

Re: Roles and Mix-ins?

2004-01-07 Thread Piers Cawley
Jonathan Lang [EMAIL PROTECTED] writes: Luke Palmer wrote: Renaming methods defeats the purpose of roles. Roles are like interfaces inside-out. They guarantee a set of methods -- an interface -- except they provide the implementation to (in terms of other, required methods). Renaming the

Re: Roles and Mix-ins?

2004-01-07 Thread Piers Cawley
Joe Gottman [EMAIL PROTECTED] writes: - Original Message - From: Luke Palmer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, January 06, 2004 4:51 AM Subject: [perl] Re: Roles and Mix-ins? David Storrs writes: On Sat, Dec 13, 2003 at 11:12:31AM -0800, Larry Wall wrote

RE: supply and demand (was: Roles and Mix-ins?)

2004-01-07 Thread Austin Hastings
From: Jonathan Lang [mailto:[EMAIL PROTECTED] Austin Hastings wrote: Jonathan Lang wrote: Austin Hastings wrote: There's two ways to look at that. One way is to say: I'm going to define an interface as being this OTHER thing minus a method. That seems like a positive

RE: supply and demand (was: Roles and Mix-ins?)

2004-01-07 Thread Jonathan Lang
Austin Hastings wrote: Jonathan Lang wrote: OK: when you call $spot.bark, Trog looks for a bark method; it finds two: Tree::bark and Dog::bark. Since both methods have been supplied by roles, $spot has no idea which one to use, and throws an exception to that effect. I am

Re: Roles and Mix-ins?

2004-01-06 Thread Luke Palmer
David Storrs writes: On Sat, Dec 13, 2003 at 11:12:31AM -0800, Larry Wall wrote: On Sat, Dec 13, 2003 at 04:57:17AM -0700, Luke Palmer wrote: : For one, one role's methods don't silently override another's. Instead, : you get, er, role conflict and you have to disambiguate yourself.

Re: Roles and Mix-ins?

2004-01-06 Thread Luke Palmer
Joe Gottman writes: - Original Message - From: Luke Palmer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, January 06, 2004 4:51 AM Subject: [perl] Re: Roles and Mix-ins? David Storrs writes: On Sat, Dec 13, 2003 at 11:12:31AM -0800, Larry Wall wrote: On Sat

Re: Roles and Mix-ins?

2004-01-06 Thread Jonathan Lang
Joe Gottman wrote: How about something like class Trog does Dog {bark=dogBark} does Tree {bark=treeBark} {...} Then we could have code like my Trog $foo = Trog.new(); my Dog $spot := $foo; my Tree $willow := $foo; $spot.bark(); #

Re: Roles and Mix-ins?

2004-01-06 Thread Jonathan Lang
Luke Palmer wrote: Renaming methods defeats the purpose of roles. Roles are like interfaces inside-out. They guarantee a set of methods -- an interface -- except they provide the implementation to (in terms of other, required methods). Renaming the method destroys the interface

Re: Roles and Mix-ins?

2004-01-06 Thread Joe Gottman
- Original Message - From: Luke Palmer [EMAIL PROTECTED] To: Joe Gottman [EMAIL PROTECTED] Cc: Perl6 [EMAIL PROTECTED] Sent: Tuesday, January 06, 2004 9:34 PM Subject: [perl] Re: Roles and Mix-ins? Joe Gottman writes: - Original Message - From: Luke Palmer [EMAIL

RE: Roles and Mix-ins?

2004-01-06 Thread Austin Hastings
From: Jonathan Lang [mailto:[EMAIL PROTECTED] Luke Palmer wrote: Renaming methods defeats the purpose of roles. Roles are like interfaces inside-out. They guarantee a set of methods -- an interface -- except they provide the implementation to (in terms of other, required methods).

Re: Roles and Mix-ins?

2004-01-06 Thread Jonathan Lang
Joe Gottman wrote: Luke Palmer wrote: Your renaming can be done easily enough, and more clearly (IMO) with: class Trog does Dog does Tree { method bark() { ... } # Explicitly remove the provided method method dogBark() { .Dog::bark() } method treeBark() {

RE: Roles and Mix-ins?

2004-01-06 Thread Austin Hastings
From: Jonathan Lang [mailto:[EMAIL PROTECTED] Austin Hastings wrote: There's two ways to look at that. One way is to say: I'm going to define an interface as being this OTHER thing minus a method. That seems like a positive construction, and supporting it might be desirable. The

Re: Roles and Mix-ins?

2004-01-05 Thread David Storrs
On Sat, Dec 13, 2003 at 11:12:31AM -0800, Larry Wall wrote: On Sat, Dec 13, 2003 at 04:57:17AM -0700, Luke Palmer wrote: : For one, one role's methods don't silently override another's. Instead, : you get, er, role conflict and you have to disambiguate yourself. How do you disambiguate?

Re: Roles and Mix-ins?

2004-01-05 Thread Jonathan Lang
David Storrs wrote: On Sat, Dec 13, 2003 at 11:12:31AM -0800, Larry Wall wrote: On Sat, Dec 13, 2003 at 04:57:17AM -0700, Luke Palmer wrote: : For one, one role's methods don't silently override another's. : Instead, you get, er, role conflict and you have to disambiguate : yourself.

Roles and Mix-ins?

2003-12-13 Thread Chris Shawmail (E-mail)
I'm still digesting the vocabulary thread, but while I do, let me ask a question that's probably crystal clear to everyone else. Do roles act as a form of mix-in, as Ruby modules may, and Objective-C protocols do? Would the following two snippets be at all equivalent? # Perl6 role Talk {

Re: Roles and Mix-ins?

2003-12-13 Thread Luke Palmer
Chris Shawmail (E-mail) writes: I'm still digesting the vocabulary thread, but while I do, let me ask a question that's probably crystal clear to everyone else. Do roles act as a form of mix-in, as Ruby modules may, and Objective-C protocols do? Would the following two snippets be at all

Re: Roles and Mix-ins?

2003-12-13 Thread Larry Wall
On Sat, Dec 13, 2003 at 04:57:17AM -0700, Luke Palmer wrote: : Chris Shawmail (E-mail) writes: : I'm still digesting the vocabulary thread, but while I do, let me ask a : question that's probably crystal clear to everyone else. : : Do roles act as a form of mix-in, as Ruby modules may, and