Newsgroups: perl.perl6.language
From: dsto...@dstorrs.com (David Storrs)
Date: Mon, 5 Jan 2004 08:46:08 -0800
Local: Mon, Jan 5 2004 11:46 am
Subject: Re: Roles and Mix-ins?
On Sat, Dec 13, 2003 at 11:12:31AM -0800, Larry Wall wrote: How do you disambiguate? > 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. > : For After reading this several times, I _think_ I understand. Let me > : two, you can attach new roles to an object at runtime (I don't know if > : you can do this with mixins, actually). > Yes, you can. The mixin creates a new singleton class every time check: imagine that the original class is a text buffer going from 0-99. We have two roles (A and B), each of length 100. Objects of various types can then see different segments of the buffer (i.e., different methods/properties/whatever), as follows: Type Can see Is that right? Dave 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.
| ||||||||||||||