Newsgroups: perl.perl6.language
From: fibon...@babylonia.flatirons.org (Luke Palmer)
Date: Tue, 6 Jan 2004 19:34:02 -0700
Local: Tues, Jan 6 2004 9:34 pm
Subject: Re: Roles and Mix-ins?
Joe Gottman writes: Renaming methods defeats the purpose of roles. Roles are like > ----- Original Message ----- > > David Storrs writes: > > > On Sat, Dec 13, 2003 at 11:12:31AM -0800, Larry Wall wrote: > > > > : For one, one role's methods don't silently override another's. > > > How do you disambiguate? > > Let's see... > > role Dog { > > Perhaps something like that. In any case, you do it by putting the > How about something like > Then we could have code like > This works better when Dog::bark and Tree::bark are both needed but they 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 compatibility. Your renaming can be done easily enough, and more clearly (IMO) with: class Trog Luke You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||