> From: Aaron Sherman [mailto:[EMAIL PROTECTED]
>
> On Fri, 2004-04-30 at 23:12, Austin Hastings wrote:
>
> > > From: Aaron Sherman [mailto:[EMAIL PROTECTED]
>
> > > I think you want a combination of re-dispatch and delegation:
> [...example code...]
> > > That should do what you want.
> >
> > Well
> From: Luke Palmer [mailto:[EMAIL PROTECTED]
>
> Austin Hastings writes:
> > Suppose that I have, for example:
> >
> > class Session {
> > has @:messages;
> >
> > method clear_messages() {...}
> > method add_message($msg) {...}
> > method have_messages() {...}
> > method g
On Fri, 2004-04-30 at 23:12, Austin Hastings wrote:
> > From: Aaron Sherman [mailto:[EMAIL PROTECTED]
> > I think you want a combination of re-dispatch and delegation:
[...example code...]
> > That should do what you want.
>
> Well, not really:
>
> 1- It required a lot of text for little gain.
Austin Hastings writes:
> Suppose that I have, for example:
>
> class Session {
> has @:messages;
>
> method clear_messages() {...}
> method add_message($msg) {...}
> method have_messages() {...}
> method get_messages() returns Array {... font color="black" ...}
> }
>
> A
(Note more precise topic.)
> -Original Message-
> From: Aaron Sherman [mailto:[EMAIL PROTECTED]
>
> On Fri, 2004-04-30 at 17:58, Austin Hastings wrote:
>
> > class Session
> > {
> > does ListOfMessages
> > (
> >attribute_base => 'messages',
> >metho
On Fri, 2004-04-30 at 17:58, Austin Hastings wrote:
> class Session
> {
> does ListOfMessages
> (
>attribute_base => 'messages',
>method_base=> 'messages',
>display_color => 'black'
> );
>
> does ListOfMessages
> (
>
> Can I just do:
>
> role ListOfMessages($attribute_base, $method_base, $display_color) {...}
>
> or what?
PS:
Sorry: I know that for types and what-not I could do
role ListOfMessages[args]
but I'm wondering about parameters in names.
That is,
has @:messages;
versus
has @:errors;
Suppose that I have, for example:
class Session {
has @:messages;
method clear_messages() {...}
method add_message($msg) {...}
method have_messages() {...}
method get_messages() returns Array {... font color="black" ...}
}
And suppose I add to it:
class Session {
h
On Thu, Apr 29, 2004 at 01:36:39PM +0200, Aldo Calpini wrote:
: On Mon, 2004-04-26 at 16:20, Richard Proctor wrote:
: > Issues:
: >
: > 1) Why does this only use Version and Author? Suppose there are versions
: > for different oses or that use other particular libraries that are wanted
: > or not
On Thu, Apr 29, 2004 at 01:56:30PM +0200, Aldo Calpini wrote:
: On Fri, 2004-04-23 at 17:24, Larry Wall wrote:
: > [...]
: >
: > On the sixth hand, by that argument, since .dispatcher is aiming at
: > a Class, it should be an uppercase C<>. :-)
:
: why not wash all these hands altogether?
:
:
On Fri, Apr 30, 2004 at 06:00:27PM +0200, Aldo Calpini wrote:
: role Logging {
: POST {
: foreach ( ::_.meta.getmethods() ) -> $method {
: $method.wrap( {
: log($somewhere, "calling $method");
: call;
:
On Fri, Apr 30, 2004 at 11:14:55AM +0200, Aldo Calpini wrote:
: class Animal {
: our @.zoo;
: &new.wrap( {
: my @results = call();
: push(@.zoo, @results[0]);
: return @results;
: } );
: }
That would almost certainly fail with an
> > role Logging {
> > POST {
> > foreach ( ::_.meta.getmethods() ) -> $method {
> > $method.wrap( {
> > log($somewhere, "calling $method");
> > call;
> > log($somewhere, "called $method");
> >
On Fri, 30 Apr 2004, Aldo Calpini wrote:
> so I wanted to explore the possible interoperability of wrappers and
> classes. another example I can think of:
> role Logging {
> POST {
> foreach ( ::_.meta.getmethods() ) -> $method {
> $method.wrap( {
>
On Fri, 30 Apr 2004, Aldo Calpini wrote:
> let's suppose I want to build a class that keeps track of the objects it
> creates.
>
> let's suppose that I want this class to be the base for a variety of
> classes.
>
> let's suppose that I decide, rather than fiddling with the default
> constructor, t
On Fri, 2004-04-30 at 16:59, Stéphane Payrard wrote:
> Perl6 seems already to have plenty of mechanisms like delegation
> to dynamically change the behavior of a class. So, probably,
> wrappers is a mechanism more adapted to extend method behavior at
> run-time by entities that don't have access to
On Fri, Apr 30, 2004 at 11:14:55AM +0200, Aldo Calpini wrote:
> let's suppose I want to build a class that keeps track of the objects it
> creates.
>
> let's suppose that I want this class to be the base for a variety of
> classes.
>
> let's suppose that I decide, rather than fiddling with the
let's suppose I want to build a class that keeps track of the objects it
creates.
let's suppose that I want this class to be the base for a variety of
classes.
let's suppose that I decide, rather than fiddling with the default
constructor, to wrap it up.
something like:
class Animal {
18 matches
Mail list logo