Re: Delegation syntax

2002-10-10 Thread Larry Wall
: Problem: : : You want to use delegation rather than inheritance to : add some capabilities of one class or object to : another class or object. : : Solution: : : Use a PROXY block: : : class MyClass { : : PROXY { : attr $left_front_wheel is Wheel; : attr $right_fro

Re: [ANNOUNCE] Perl6 OO Cookbook, v0.1

2002-10-10 Thread Larry Wall
On Wed, 9 Oct 2002, Chris Dutton wrote: : Wasn't "class MyClass;" supposed to work along the line of Perl5's : "package MyClass;" and make everything following that statement the : definition of MyClass? Yes, though we're thinking of limiting that construct to the front of a file, along with "m

Re: remote generators and a macro language proposal

2002-10-10 Thread Larry Wall
On Thu, 10 Oct 2002, Chip Salzenberg wrote: : According to Luke Palmer: : > for ( grep { $_{smoker} and $_{age} > 18 } @Subscribers ) { : > .send($Cigarette_Advertisement) : > } : : Hm, would this work too: : : for ( grep { .{smoker} and .{age} > 18 } @Subscribers ) :

Re: Object Instantiation (Was: Re: [ANNOUNCE] Perl6 OO Cookbook, v0.1)

2002-10-10 Thread Larry Wall
On Thu, 10 Oct 2002, Michael Lazzaro wrote: : On Thursday, October 10, 2002, at 11:23 AM, John Williams wrote: : > my $obj = MyClass(...); : > : > This seems to assume that objects have a default method if you treat : > them : > like a subroutine. Kinda tcl-ish, but I don't recall anything li

Object Instantiation (Was: Re: [ANNOUNCE] Perl6 OO Cookbook, v0.1)

2002-10-10 Thread Michael Lazzaro
On Thursday, October 10, 2002, at 11:23 AM, John Williams wrote: > my $obj = MyClass(...); > > This seems to assume that objects have a default method if you treat > them > like a subroutine. Kinda tcl-ish, but I don't recall anything like > this > in the apocalypes. > > my $obj = MyClass;

Re: Interfaces

2002-10-10 Thread Larry Wall
On Mon, 7 Oct 2002, Andy Wardley wrote: : Nicholas Clark wrote: : > I think that the first syntax : > : > class Car::Q is Car renames(eject => ejector_seat) : > is CD_Player renames(drive => cd_drive); : > : > makes it more clear that I'd like to pick and choose which methods : > th

Re: remote generators and a macro language proposal

2002-10-10 Thread Chip Salzenberg
According to Luke Palmer: > for ( grep { $_{smoker} and $_{age} > 18 } @Subscribers ) { > .send($Cigarette_Advertisement) > } Hm, would this work too: for ( grep { .{smoker} and .{age} > 18 } @Subscribers ) { .send($ciggie_ad) } ? I think .{x} read

Re: Interfaces

2002-10-10 Thread Larry Wall
On Mon, 7 Oct 2002, chromatic wrote: : On Wed, 02 Oct 2002 04:12:44 -0700, Michael G Schwern wrote: : : > I like the "class Vehicle is interface" as a shorthand for declaring every : > method of a class to be an interface. : : Perhaps associating a property with a class can be shorthand for asso

Re: Interface lists (was Re: Interfaces)

2002-10-10 Thread Larry Wall
On Mon, 30 Sep 2002, Michael G Schwern wrote: : On Tue, Oct 01, 2002 at 01:36:19AM +0100, Simon Cozens wrote: : > [EMAIL PROTECTED] (Michael G Schwern) writes: : > > method _do_internal_init ($num) is private { : > : > Just thinking aloud, would : > sub foo is method is private is inte

Re: [ANNOUNCE] Perl6 OO Cookbook, v0.1

2002-10-10 Thread John Williams
On Wed, 9 Oct 2002, Michael Lazzaro wrote: > PLEASE contribute to this document! Email me with suggestions, "yes" > or "no" votes on recipe approaches, info on philosophies or best-guess > syntax, etc., or discuss them here on perl6-language. Very nice. I hope this evolves into a useful perl6

Re: [ANNOUNCE] Perl6 OO Cookbook, v0.1

2002-10-10 Thread Michael Lazzaro
On Thursday, October 10, 2002, at 02:33 AM, Angel Faus wrote: > Just a silly note: >> Recipe 1.9: Using Subroutines as Objects > I think it was said that the way to avoid the ambiguity here is to add > & to sub name. Thanks, applied. MikeL

Re: [ANNOUNCE] Perl6 OO Cookbook, v0.1

2002-10-10 Thread Michael Lazzaro
On Wednesday, October 9, 2002, at 07:54 PM, Chris Dutton wrote: > One first thing I notice while I'm supposed to be doing homework. :-) > > Wasn't "class MyClass;" supposed to work along the line of Perl5's > "package MyClass;" and make everything following that statement the > definition of

Delegation syntax

2002-10-10 Thread Ralph Mellor
Problem: You want to use delegation rather than inheritance to add some capabilities of one class or object to another class or object. Solution: Use a PROXY block: class MyClass { PROXY { attr $left_front_wheel is Wheel; attr $right_front_wheel is Wheel;

Delegation syntax

2002-10-10 Thread Me
Problem: You want to use delegation (rather than inheritance) to add some capabilities of one class or object to another class or object. Solution: Use a PROXY block: class MyClass { PROXY { attr $left_front_wheel is Wheel; attr $right_front_wheel is Wheel;

Re: [ANNOUNCE] Perl6 OO Cookbook, v0.1

2002-10-10 Thread Angel Faus
Hi, Many thanks Michael, this is very useful, really. I had lost all the OO discussion and this document is very helpful. I really like the part of context transformations, I hope something like this gets in. Just a silly note: > Recipe 1.9: Using Subroutines as Objects > > Problem: > You w

Re: [ANNOUNCE] Perl6 OO Cookbook, v0.1

2002-10-10 Thread Chris Dutton
One first thing I notice while I'm supposed to be doing homework. :-) Wasn't "class MyClass;" supposed to work along the line of Perl5's "package MyClass;" and make everything following that statement the definition of MyClass?

Re: Fw: perl6 operator precedence table

2002-10-10 Thread Brad Hughes
Larry Wall wrote: [...] > Maybe we should ... to mean "and so on forever": > > @a[0...; 0...:10; 0...:100] > > Except then we couldn't use it to mean what Ruby means by it, which > might be handier in real life. No more yada-yada-yada? Brad