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
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
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
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
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
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.
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
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(); #
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
- 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
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).
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() {
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
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?
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.
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 {
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
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
18 matches
Mail list logo