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 changing

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 <[EMAI

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 @_. > : >

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

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 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 Her

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, i

Re: Perl 6 - Cheerleaders?

2001-10-29 Thread Uri Guttman
> "DC" == Damian Conway <[EMAIL PROTECTED]> writes: DC> Uri wrote: >> that clears it up. so the key/value named params get converted to scalar >> args in INIT with the same name. is this in any of the current exegeses? >> or will sub calls be covered in the apocalyptic future? DC>

Re: Perl 6 - Cheerleaders?

2001-10-29 Thread Damian Conway
Uri wrote: > that clears it up. so the key/value named params get converted to scalar > args in INIT with the same name. is this in any of the current exegeses? > or will sub calls be covered in the apocalyptic future? A3/E3 covered named arguments. The only additional bit here is that

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 $barva

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 ow

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 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 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'

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. > >nu

Re: Perl 6 - Cheerleaders?

2001-10-29 Thread Stephane Payrard
On Mon, 29 Oct 2001, Michael G Schwern wrote: > 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) for

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 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 goi

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(@a

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,

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 colo

Re: Perl 6 - Cheerleaders?

2001-10-29 Thread Damian Conway
> > 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. > If so, does this mean that there will be no such thing as a > C++-style const (constant per in

Re: Perl 6 - Cheerleaders?

2001-10-29 Thread Damian Conway
Sam asked: > are there any plans in Perl 6 for specifying > OO <-> RDBMS mapping in the class { } construct? Another way to look at > this would be adding arbitrary fine grained type constraints to > attributes, and then tools can be written which examine these constraints > and

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

Re: Perl 6 - Cheerleaders?

2001-10-29 Thread Damian Conway
> Ick. I don't want to lose the dots that visually distinguish instance > variables from ordinary lexicals, and simultaneously render the extra > bracketing and indentation unnecessary. I'd write the above as: > > class Demo; > > my $.foo is public; > my $.

RE: Perl 6 - Cheerleaders?

2001-10-29 Thread Brent Dax
Damian Conway: # 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.) And it

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 sty

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 flexibili

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 a

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 Larry Wall
[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? Larry

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

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

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.

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

%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 C{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 > reaso

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++-s

Re: Perl 6 - Cheerleaders?

2001-10-29 Thread Aaron Sherman
On Mon, Oct 29, 2001 at 11:03:33AM +1100, 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. This seems wise. Very Perlish. > If it's an outer-scope lexical, use C{MY}>

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 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> $fo

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 "

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 auto-creat

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 fa

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 "fo

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 G

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-27 Thread Aaron Sherman
On Fri, Oct 26, 2001 at 06:43:19PM -0400, Aaron Sherman wrote: > On Sat, Oct 27, 2001 at 08:09:57AM +1000, Damian Conway wrote: > > * If $.foo is "like" the Perl5 $self->{foo}, how do I do > the Perl5 $self->foo? .foo duh. I'm, losing my mind. I was seeing: "$self->{foo}"

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 acce

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 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 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,

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-l

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

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 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}; >

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 Piers Cawley
Bart Lateur <[EMAIL PROTECTED]> writes: > 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 inser

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

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 c

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> http://www.pe