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: Quick question on subroutine declaration syntax

2001-10-30 Thread Aaron Sherman
On Tue, Oct 30, 2001 at 03:59:30PM +1100, Damian Conway wrote: (Though I *do* harbour a secret desire to resurrect - as a type specifier: sub foo (@args) - rettype Hmm... I would have expected is to come in here: sub foo (@args) is IO::Handle my $bar - int; Hmm...

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

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:

Constants

2001-10-30 Thread Damian Conway
Aaron wrote: Cis const means: Once declared cannot be *assigned* to. But that doesn't mean one can't *bind* a new value to the variable (which would retain its Cconst-induced unassignability after the binding). I understand that. I guess what I'm saying is,

Re: Quick question on subroutine declaration syntax

2001-10-30 Thread Damian Conway
Aaron wrote: sub foo (@args) - rettype Hmm... I would have expected is to come in here: sub foo (@args) is IO::Handle It would have to be: sub foo (@args) is type(IO::Handle) or something, I think. Unless Larry decides that every class/module name is

Re: Constants

2001-10-30 Thread David M. Lloyd
On Wed, 31 Oct 2001, Damian Conway wrote: To me Cis const means: the *value* stored in the memory implementing this variable cannot be changed. Which doesn't preclude rebinding the variable to some *other* memory. But others have a different (and equally reasonable) interpretation of Cis

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

2001-10-30 Thread Damian Conway
John asked: So, what about simple array accessors? Writing: class Demo; my @.colors is public; gives you: $obj.colors('red', 'green', 'blue'); No. $obj.colors() takes no arguments. $obj.colors = ('red', 'green', 'blue'); Yes. $obj.colors =

Re: Auto-creation of simple accessors

2001-10-30 Thread Damian Conway
John icked: # # Change apple color, but leave the blue berry # $obj.fruit(apple = 'green'); # # print $obj.fruit('apple'); # green $obj.fruit{apple} Icky, looks unencapsulated to me :) [For the benefit of those playing along at home, the

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