RE: How do I do parametered-roles on member objects?

2004-04-30 Thread Austin Hastings
> 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

RE: How do I do parametered roles?

2004-04-30 Thread Austin Hastings
> 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

RE: How do I do parametered-roles on member objects?

2004-04-30 Thread Aaron Sherman
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.

Re: How do I do parametered roles?

2004-04-30 Thread Luke Palmer
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

RE: How do I do parametered-roles on member objects?

2004-04-30 Thread Austin Hastings
(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

Re: How do I do parametered roles?

2004-04-30 Thread Aaron Sherman
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 > ( >

RE: How do I do parametered roles?

2004-04-30 Thread Austin Hastings
> 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;

How do I do parametered roles?

2004-04-30 Thread Austin Hastings
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

Re: A12 Versioning

2004-04-30 Thread Larry Wall
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

Re: A12: a doubt about .meta, .dispatcher and final methods

2004-04-30 Thread Larry Wall
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? : :

Re: A12: on inheriting wrappers

2004-04-30 Thread Larry Wall
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; :

Re: A12: on inheriting wrappers

2004-04-30 Thread Larry Wall
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

Re: A12: on inheriting wrappers

2004-04-30 Thread Abhijit A. Mahabal
> > role Logging { > > POST { > > foreach ( ::_.meta.getmethods() ) -> $method { > > $method.wrap( { > > log($somewhere, "calling $method"); > > call; > > log($somewhere, "called $method"); > >

Re: A12: on inheriting wrappers

2004-04-30 Thread Abhijit A. Mahabal
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( { >

Re: A12: on inheriting wrappers

2004-04-30 Thread Abhijit A. Mahabal
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

Re: A12: on inheriting wrappers

2004-04-30 Thread Aldo Calpini
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

Re: A12: on inheriting wrappers

2004-04-30 Thread Stéphane Payrard
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

A12: on inheriting wrappers

2004-04-30 Thread Aldo Calpini
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 {