Re: Perl 6 - Cheerleaders?

2001-10-31 Thread Randal L. Schwartz
John == John Siracusa [EMAIL PROTECTED] writes: John (Can I pre-order the Perl 6 Camel or what? ;) Of course. You'll almost certainly visit the nodes before the subnodes in the documentation. :-) -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 [EMAIL

Re: Perl 6 - Cheerleaders?

2001-10-31 Thread David Nesting
On Tue, Oct 30, 2001 at 09:37:39AM -0500, Aaron Sherman wrote: : Yep, but in Perl5, this was never very clean or obvious to the : casual programmer. Constants have been coming of age in Perl, : and they're kind of scary if they're not constant. On one hand, one might say that a developer

Re: Auto-creation of simple accessors (was: Perl 6 - Cheerleaders?)

2001-10-30 Thread Brent Dax
John Siracusa: # Okay, so we've got these guys auto-created if we want: # # method foo is lvalue { return $.foo } # # (plus or minus the syntax) which lets us do: # # $obj.foo = 5; # print $obj.foo; # # So, what about simple array accessors? Please note that these are my best

Re: Auto-creation of simple accessors (was: Perl 6 -Cheerleaders?)

2001-10-30 Thread John Siracusa
On 10/30/01 12:13 PM, Brent Dax wrote: John Siracusa: Please note that these are my best guesses; I'm not a Damian ;^). # $obj.colors('red', 'green', 'blue'); # # $obj.colors = ('red', 'green', 'blue'); # # $obj.colors = ['red', 'green', 'blue' ]; $obj.colors=('red',

Re: Perl 6 - Cheerleaders?

2001-10-30 Thread Aaron Sherman
On Tue, Oct 30, 2001 at 04:29:15PM +1100, Damian Conway wrote: I'd do that like so (using Larry's preferred syntax): [...] method INIT ($idval) { $.id := $idval } Hm... that looks to me like a regular :=; is it? Yep. If so, what good is is const if

Re: Perl 6 - Cheerleaders?

2001-10-30 Thread Jonathan Scott Duff
On Mon, Oct 29, 2001 at 04:16:24PM -0800, Larry Wall wrote: [EMAIL PROTECTED] writes: : 3. If you declare a method *without* any parameter list: : : method foo {...} : :then the method call arguments (including the invocant?) :are bound to @_. : : Is

Re: Auto-creation of simple accessors (was: Perl 6 -Cheerleaders?)

2001-10-30 Thread John Siracusa
Okay, so we've got these guys auto-created if we want: method foo is lvalue { return $.foo } (plus or minus the syntax) which lets us do: $obj.foo = 5; print $obj.foo; So, what about simple array accessors? $obj.colors('red', 'green', 'blue'); $obj.colors = ('red',

Re: Perl 6 Object Oriented Operators [was: Perl 6 - Cheerleaders?]

2001-10-30 Thread Damian Conway
method foo ( $me, $again : $big, $boy ) {...} should be able to be called via either of: foo $obj1, $obj2 : @args; or: ($obj1, $obj2).foo(@args); This stuff brings to mind all sorts of questions: * If foo() is

RE: Perl 6 Object Oriented Operators [was: Perl 6 - Cheerleaders?]

2001-10-30 Thread Brent Dax
Damian Conway: # BTW, colon isn't an operator (it's a separator), so it can't be hyped. What do you mean? We can hype the colon all we want! :^) --Brent Dax [EMAIL PROTECTED] Configure pumpking for Perl 6 When I take action, I’m not going to fire a $2 million missile at a $10 empty tent and

Perl 6 Object Oriented Operators [was: Perl 6 - Cheerleaders?]

2001-10-30 Thread Jonathan Scott Duff
On Tue, Oct 30, 2001 at 12:27:32PM +1100, Damian Conway wrote: ($obj1, $obj2)-foo(@args); Is that merely sugar for: # errr, $_.foo(@args) ? $_-foo(@args) foreach($obj1, $obj2); No. What you showed would be achieved with either a hyperoperation:

Re: Perl 6 - Cheerleaders?

2001-10-29 Thread Larry Wall
Brent Dax writes: : Are we still gonna be able to pick what we call the current instance? : From previous programming languages, I'm a lot more comfortable with $me : or $this than $self. (Yeah, it's a little thing, but it's something I : *liked* about Perl 5's OO--it showed how you had

Re: Perl 6 - Cheerleaders?

2001-10-29 Thread Larry Wall
[EMAIL PROTECTED] writes: :method INIT ($fooval, $barval) :{ : $.foo = $fooval; : $.bar = $barval; :} : : (sorry, couldn't help fixing the braces... ;) I don't really care where you put the initial brace, as long as you outdent the closing brace. My personal brace style

Re: Perl 6 - Cheerleaders?

2001-10-29 Thread Jonathan Scott Duff
On Tue, Oct 30, 2001 at 09:39:03AM +1100, Damian Conway wrote: Okay, so let's clarify: 1. If you declare a method *with* a colon separator in its parameter list: method foo ($self: $foosrc, $foodest, $etc) {...} Um, can we be even more clear? What does the

Re: Perl 6 - Cheerleaders?

2001-10-29 Thread Larry Wall
[EMAIL PROTECTED] writes: : Aaron wrote: : : Several questions come up. : :* If $.foo is like the Perl5 $self-{foo}, : : Except (as I'm sure you know) that Perl 6 class instantiations aren't : hashes, and their attributes aren't hash entries. Nevertheless, *using* one as a hash

Re: Perl 6 - Cheerleaders?

2001-10-29 Thread Larry Wall
[EMAIL PROTECTED] writes: : Larry revealed: : : :method bar($me : *@_) { : :... : :} : : : : will use $me instead. : : That is the approach I currently favor. (Though I'd probably leave : out the space in front of the colon.)

Re: Perl 6 - Cheerleaders?

2001-10-29 Thread Larry Wall
[EMAIL PROTECTED] writes: : On Tue, Oct 30, 2001 at 09:39:03AM +1100, Damian Conway wrote: : Okay, so let's clarify: : : 1. If you declare a method *with* a colon separator in its parameter : list: : : method foo ($self: $foosrc, $foodest, $etc) {...} : : Um, can

Re: Perl 6 - Cheerleaders?

2001-10-29 Thread Damian Conway
: Um, can we be even more clear? What does the following do? : : method foo ($atc, $btc: $ctc, $dtc, $etc) {...} : : Is that an error? Multimethod dispatch on two objects? The $64K question then being: can I call it like so: ($obj1, $obj2)-foo(@args);

Re: Perl 6 - Cheerleaders?

2001-10-29 Thread Michael G Schwern
On Tue, Oct 30, 2001 at 11:27:39AM +1100, Damian Conway wrote: The $64K question then being: can I call it like so: ($obj1, $obj2)-foo(@args); Is that merely sugar for: # errr, $_.foo(@args) ? $_-foo(@args) foreach($obj1, $obj2); or is there something more interesting going

Re: Perl 6 - Cheerleaders?

2001-10-29 Thread Damian Conway
($obj1, $obj2)-foo(@args); Is that merely sugar for: # errr, $_.foo(@args) ? $_-foo(@args) foreach($obj1, $obj2); No. What you showed would be achieved with either a hyperoperation: ($obj1, $obj2)^.foo(@args); or a superposition:

Re: Perl 6 - Cheerleaders?

2001-10-29 Thread Dan Sugalski
At 12:27 PM 10/30/2001 +1100, Damian Conway wrote: PS: I'd just like to point out that people gasped in horror when I presented this idea at YAPC::NA::2001 as part of the (soon-to-be-released) Klingon binding of Perl. ;-) I'll add my own, now. nuch SoH!

Re: Perl 6 - Cheerleaders?

2001-10-29 Thread John Siracusa
On 10/29/01 8:44 PM, Dan Sugalski wrote: At 12:27 PM 10/30/2001 +1100, Damian Conway wrote: nuch SoH! bIQambogh DaqDaq qaHoH! The biggest problem with reading mail from Damian is I keep wanting to rot13 the thing.. Whatever filter he's running his thoughts through, I'm pretty sure it's

Re: Perl 6 - Cheerleaders?

2001-10-29 Thread Damian Conway
Does this mean that the caller of a multimethod has to know he calls a multimethod (as oposed to a regular method). Should not the user of a library spared from such implementation details, however sexy they are? One might well argue the same thing about calling normal subroutines

Re: Perl 6 - Cheerleaders?

2001-10-29 Thread Damian Conway
John observed: Whatever filter he's running his thoughts through, I'm pretty sure it's lossy... ;) For which mercy you should probably be extremely grateful. ;-) Damian

Re: Perl 6 - Cheerleaders?

2001-10-29 Thread Michael G Schwern
On Tue, Oct 30, 2001 at 12:27:32PM +1100, Damian Conway wrote: PS: I'd just like to point out that people gasped in horror when I presented this idea at YAPC::NA::2001 as part of the (soon-to-be-released) Klingon binding of Perl. ;-) I'll add my own, now.

Re: Perl 6 - Cheerleaders?

2001-10-29 Thread Uri Guttman
DC == Damian Conway [EMAIL PROTECTED] writes: DC Uri asked: DC method INIT ( $fooval, $barval) { where is the binding from the keys below to the INIT params? surely (and yes, i am calling you shirley) you don't mean that 'bar' is converted or mapped to $barval? i recall

Re: Perl 6 - Cheerleaders?

2001-10-29 Thread Aaron Sherman
On Tue, Oct 30, 2001 at 09:59:49AM +1100, Damian Conway wrote: class Demo { my $threshold is const = 100; Hmm... is a my const the same as an our const? No. 'my' is per-instance; 'our' is per-class. But, in terms of constants, it seems to me

Re: Perl 6 - Cheerleaders?

2001-10-29 Thread Damian Conway
but from this thread it looks like you and larry are still hammering out the details. :) maybe a revision of A3/E3 will be in the offing (like larry's retraction of dropping ). That's entirely possible. The Perl 6 Ministry of Truth is forever on the look-out for Revisionist

Re: Perl 6 - Cheerleaders?

2001-10-29 Thread John Siracusa
On 10/29/01 4:38 PM, Larry Wall wrote: : I'm quite curious to see what the initialization syntax will be like. : : class Demo { : my $foo; : my $bar; : : method INIT ( $fooval, $barval) { : $foo =

Re: Perl 6 - Cheerleaders?

2001-10-29 Thread Damian Conway
Aaron pointed out: But, in terms of constants, it seems to me that there's no difference. They both have only one value that is assigned when the module/class is parsed. Well, in *practice* there's no difference, but in their mystical essences, they're completely different. ;-)

Re: Perl 6 - Cheerleaders?

2001-10-29 Thread John Siracusa
On 10/29/01 4:39 PM, Larry Wall wrote: [EMAIL PROTECTED] writes: : On 10/28/01 7:57 PM, Damian Conway wrote: :method foo is lvalue { :return $foo; : : Any word on automagical creation of these suckers? Yes, certainly. Didn't I say that already?

Re: Perl 6 - Cheerleaders?

2001-10-29 Thread Uri Guttman
BD == Brent Dax [EMAIL PROTECTED] writes: BD Uri Guttman: BD # DC class Demo { BD # DC my $foo; BD # DC my $bar; BD # BD # DC method INIT ( $fooval, $barval) { BD # DC $foo = $fooval; BD #

Re: Perl 6 - Cheerleaders?

2001-10-29 Thread Sam Vilain
On Mon, 29 Oct 2001 11:03:33 +1100 (EST) Damian Conway [EMAIL PROTECTED] wrote: The Real Damian is the Damian inside each of us. You need to get in touch with your *own* inner Damian. SETTING: Trendy bar. DC: Hey, beautiful, how's it going? Say, do you have a little Damian in you?

RE: Perl 6 - Cheerleaders?

2001-10-29 Thread Garrett Goebel
From: Sam Vilain [mailto:[EMAIL PROTECTED]] It would be a bit like Class::Contract merged with Class::Tangram, but if Class::Contract is going into the core then it's a feature I'd like to see... I'd like to see Class::Contract play nicely with Class::Tangram, Class::Multimethods, etc. But

Re: Perl 6 - Cheerleaders?

2001-10-29 Thread John Siracusa
On 10/29/01 1:49 AM, Damian Conway wrote: I guess what I'm really hoping for in Perl 6 is to finally give up my super-simple object base class that does cascading initialization (check) and simple attribute accessor creation (???) when necessary. Yep. I KISS YOU! method foo is lvalue {

Re: Perl 6 - Cheerleaders?

2001-10-29 Thread Aaron Sherman
On Mon, Oct 29, 2001 at 11:57:47AM +1100, Damian Conway wrote: AJS How would this play with constants? class Demo { my $threshold is const = 100; Hmm... is a my const the same as an our const? If so, does this mean that there will be no such thing as a C++-style

%MY:: (was Re: Perl 6 - Cheerleaders?)

2001-10-29 Thread Dave Mitchell
Aaron Sherman [EMAIL PROTECTED] wrote: If it's an outer-scope lexical, use Ccaller-{MY} Ok, I'm all over the nice new features of Perl6, but darnit, upvar is one of the primary reasons that TCL is unusable. Please, let's not soften the walls of lexical scope. They're there for a reason.

Re: %MY:: (was Re: Perl 6 - Cheerleaders?)

2001-10-29 Thread Aaron Sherman
On Mon, Oct 29, 2001 at 03:03:58PM +, Dave Mitchell wrote: As to whether other uses of %MY:: are Good Things, see previous discussions ad nauseum on -internals and -language. Ok, sorry. I didn't mean to resurect an old, tired thread. I'm sure clear heads will prevail and some precaution

RE: Perl 6 - Cheerleaders?

2001-10-28 Thread Damian Conway
Aaron wrote: Several questions come up. * If $.foo is like the Perl5 $self-{foo}, Except (as I'm sure you know) that Perl 6 class instantiations aren't hashes, and their attributes aren't hash entries. how do I do the Perl5 $self-foo? .foo() * Is foo in this

Re: Perl 6 - Cheerleaders?

2001-10-28 Thread John Siracusa
On 10/28/01 7:03 PM, Damian Conway wrote: Brent asked: I assume we're going to recycle 'my' and 'our' to be 'instance' and 'class'--is that correct? That's what I'm proposing. So should I start practicing my typos for instance now? Insatance instancae instance. Mmmm... ;P I favour the

Re: Perl 6 - Cheerleaders?

2001-10-28 Thread John Siracusa
On 10/28/01 7:57 PM, Damian Conway wrote: method foo is lvalue { return $foo; Any word on automagical creation of these suckers? No, not as a module, but built-in. I don't think it's too crazy to build *some* sort of sensible attribute accessor

Re: Perl 6 - Cheerleaders?

2001-10-28 Thread schwern
On Sun, Oct 28, 2001 at 08:36:31PM -0500, John Siracusa wrote: On 10/28/01 7:57 PM, Damian Conway wrote: method foo is lvalue { return $foo; Any word on automagical creation of these suckers? No, not as a module, but built-in. They're called Slots

RE: Perl 6 - Cheerleaders?

2001-10-28 Thread Damian Conway
Brent asked: # Well, I'm not a Damian, but I play one on perl6-language. ;-) Well, then, where's a *real* Damian? :^) The Real Damian is the Damian inside each of us. You need to get in touch with your *own* inner Damian. ;-) I assume we're going to recycle 'my' and

Re: Perl 6 - Cheerleaders?

2001-10-28 Thread Piers Cawley
Damian Conway [EMAIL PROTECTED] writes: Brent told us: All these Star Trek references are threatening to make my warp core breach... :^) Too much information. Look, I'm sorry, okay? I only finished up the article with a Trek reference because, whilst I could see Larry as Giles, I

Re: Perl 6 - Cheerleaders?

2001-10-26 Thread Bart Lateur
On Thu, 25 Oct 2001 16:53:46 -0500, Garrett Goebel wrote: Piers Cawley has written a nice article entitled: Perl 6 : Not Just For Damians. http://www.perl.com/pub/a/2001/10/23/damians.html I just hope that you don't really have to insert that many blank lines in your code just to make it

Re: Perl 6 - Cheerleaders?

2001-10-26 Thread Piers Cawley
Uri Guttman [EMAIL PROTECTED] writes: GG == Garrett Goebel [EMAIL PROTECTED] writes: GG Piers Cawley has written a nice article entitled: Perl 6 : Not GG Just For Damians. GG If the hair on the back of your neck rises when thinking about GG Perl 6, or even if it doesn't... give

Re: Perl 6 - Cheerleaders?

2001-10-26 Thread Aaron Sherman
On Thu, Oct 25, 2001 at 04:53:46PM -0500, Garrett Goebel wrote: Piers Cawley has written a nice article entitled: Perl 6 : Not Just For Damians. I had missed what unary . really did, and this explained it to me. I'm now much more excited about it as a with-like operator. It does make me

Re: Perl 6 - Cheerleaders?

2001-10-26 Thread Jonathan Scott Duff
On Fri, Oct 26, 2001 at 01:13:42PM -0400, Aaron Sherman wrote: It does make me think, though... Would it make sense to have an accessor operator? For example, in Perl5 I would do this: sub foo { my $self = shift; my $old = $self-{foo}; # So

Re: Perl 6 - Cheerleaders?

2001-10-26 Thread Damian Conway
Scott wrote: Actually, I think it becomes: sub foo is method { my $old = .foo; .foo = shift if @_; return $old; } But, I could be wrong. Any Damians care to enlighten? :-) Well, I'm not a Damian, but I play one on perl6-language.

RE: Perl 6 - Cheerleaders?

2001-10-26 Thread Brent Dax
Damian Conway: # Scott wrote: # # Actually, I think it becomes: # # sub foo is method { # my $old = .foo; # .foo = shift if @_; # return $old; # } # # But, I could be wrong. Any Damians care to enlighten? :-) # # Well, I'm not a Damian, but I

Re: Perl 6 - Cheerleaders?

2001-10-26 Thread Aaron Sherman
On Sat, Oct 27, 2001 at 08:09:57AM +1000, Damian Conway wrote: Larry has ideas, I have ideas... All good so far ;-) However, I don't think the above syntax will be it. I think it would likely be closer to: class Demo { my $.foo; method foo {

Re: Perl 6 - Cheerleaders?

2001-10-26 Thread Piers Cawley
Jonathan Scott Duff [EMAIL PROTECTED] writes: On Fri, Oct 26, 2001 at 01:13:42PM -0400, Aaron Sherman wrote: It does make me think, though... Would it make sense to have an accessor operator? For example, in Perl5 I would do this: sub foo { my $self = shift;

Re: Perl 6 - Cheerleaders?

2001-10-26 Thread Jonathan Scott Duff
On Fri, Oct 26, 2001 at 03:28:57PM -0700, Brent Dax wrote: What if we have an instance variable $foo and a global $foo, and we want to access the global? Do you mean if we've hidden a lexical of the same name in the same scope? I seem to recall something related to %MY that would let you

Re: Perl 6 - Cheerleaders?

2001-10-26 Thread Aaron Sherman
On Fri, Oct 26, 2001 at 01:53:09PM -0500, Jonathan Scott Duff wrote: On Fri, Oct 26, 2001 at 01:13:42PM -0400, Aaron Sherman wrote: In Perl6 with the unary ., that becomes: sub .foo (*@args) { my $old = $.{foo}; # So $obj.foo(undef) will work

Re: Perl 6 - Cheerleaders?

2001-10-26 Thread Michael G Schwern
On Fri, Oct 26, 2001 at 01:53:09PM -0500, Jonathan Scott Duff wrote: Actually, I think it becomes: sub foo is method { my $old = .foo; .foo = shift if @_; return $old; } But, I could be wrong. Any Damians care to enlighten? :-) I'm not a

Perl 6 - Cheerleaders?

2001-10-25 Thread Garrett Goebel
Piers Cawley has written a nice article entitled: Perl 6 : Not Just For Damians. If the hair on the back of your neck rises when thinking about Perl 6, or even if it doesn't... give it a read. http://www.perl.com/pub/a/2001/10/23/damians.html

Re: Perl 6 - Cheerleaders?

2001-10-25 Thread Uri Guttman
GG == Garrett Goebel [EMAIL PROTECTED] writes: GG Piers Cawley has written a nice article entitled: Perl 6 : Not GG Just For Damians. GG If the hair on the back of your neck rises when thinking about GG Perl 6, or even if it doesn't... give it a read. GG