Newsgroups: perl.perl6.language
From: Austin_Hasti...@Yahoo.com (Austin Hastings)
Date: Fri, 30 Apr 2004 17:58:22 -0400
Local: Fri, Apr 30 2004 5:58 pm
Subject: How do I do parametered roles?
Suppose that I have, for example:
class Session { method clear_messages() {...} And suppose I add to it: class Session { method clear_messages() {...} has @:errors; method clear_errors() {...} So I realize that not only is the whole list-of-messages thing a packageable One solution is to compose member objects that implement this behavior: if ($my_object.messages.have_messages) {...} But that sucks. What I want to do is to say: 1- There's a "list of generic messages" role. And then implement two different parameterized invocations of the same role class Session does ListOfMessages ... (Classes are described as "parameterless subroutines". I'd like a Can I just do: role ListOfMessages($attribute_base, $method_base, $display_color) {...} or what? =Austin 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.
| ||||||||||||||