perl6-language@perl.org

2004-04-20 Thread Larry Wall
On Tue, Apr 20, 2004 at 03:53:31PM -0400, Aaron Sherman wrote: : In specific, here is a proposal for execution: : : multi run(string $command) returns(Process) {...} # Funky shell default : multi run(Process $process) returns(Process) {...} # Relies on $process.cmdline Eh? What does

Re: A12: Strings

2004-04-20 Thread Larry Wall
On Tue, Apr 20, 2004 at 02:16:01PM -0400, Aaron Sherman wrote: : Well, I have a lot to digest, but off the top of my head (and having : nothing to do with objects, but rather the string discussion at the : end), it would be very useful if I could assert: : : no string "complex"; : : or some

Re: A12: default accessors and encapsulation

2004-04-20 Thread Jonathan Scott Duff
On Tue, Apr 20, 2004 at 10:25:04PM +0200, Juerd wrote: > Brent 'Dax' Royal-Gordon skribis 2004-04-20 12:58 (-0700): > > method buffersize() > > will store { > > my $sqrt=$^v.sqrt; > > die "$^v is not a power of two" unless int($sqrt) == $sqrt; > > $.b

Re: A12: default accessors and encapsulation

2004-04-20 Thread John Williams
On Tue, 20 Apr 2004, Juerd wrote: > Brent 'Dax' Royal-Gordon skribis 2004-04-20 12:58 (-0700): > > method buffersize() > > will store { > > my $sqrt=$^v.sqrt; > > die "$^v is not a power of two" unless int($sqrt) == $sqrt; > > $.buffer = "\x[0]" x $^

perl6-language@perl.org

2004-04-20 Thread Aaron Sherman
On Tue, 2004-04-20 at 13:55, Larry Wall wrote: > Okay, let's put this one to rest. Good, and I'll not try to speak ill of the dead thread, so ignoring hash and/or array access, let me respond to the end of your message. > As for C, it probably needs to be completely rethought anyway, > along wit

minimal accessor declaration

2004-04-20 Thread John Williams
On Tue, 20 Apr 2004, Brent 'Dax' Royal-Gordon wrote: > John Williams wrote: > > I'm not saying there is anything wrong with that, but John Siracusa is > > asking for something different, I think. A simple accessor which looks > > like a method without having to play with Proxy, FETCH, STORE, etc.

Re: A12: default accessors and encapsulation

2004-04-20 Thread Juerd
Brent 'Dax' Royal-Gordon skribis 2004-04-20 12:58 (-0700): > method buffersize() > will store { > my $sqrt=$^v.sqrt; > die "$^v is not a power of two" unless int($sqrt) == $sqrt; > $.buffer = "\x[0]" x $^v; > } > { +$.buffer.bytes } Could

Re: A12: default accessors and encapsulation

2004-04-20 Thread John Siracusa
On 4/20/04 4:08 PM, Aaron Sherman wrote: > On Tue, 2004-04-20 at 15:40, John Siracusa wrote: >> On 4/20/04 2:37 PM, Larry Wall wrote: >>> It's wrong to introduce a fundamental asymmetry that breaks the contract >>> that an accessor can be used as a variable. >> >> Er, I think we have different def

Re: A12: default accessors and encapsulation

2004-04-20 Thread Brent 'Dax' Royal-Gordon
John Williams wrote: class Dog { has $.foo will FETCH { ... } will STORE { ... } ; } I'm not saying there is anything wrong with that, but John Siracusa is asking for something different, I think. A simple accessor which looks like a method without h

Re: A12: default accessors and encapsulation

2004-04-20 Thread Aaron Sherman
On Tue, 2004-04-20 at 15:40, John Siracusa wrote: > On 4/20/04 2:37 PM, Larry Wall wrote: > > It's wrong to introduce a fundamental asymmetry that breaks the contract that > > an accessor can be used as a variable. > > Er, I think we have different definitions of "accessor." I'm perfectly > happy

Re: A12: default accessors and encapsulation

2004-04-20 Thread Mark J. Reed
On 2004-04-20 at 11:37:18, Larry Wall wrote: > So do whatever you like to the declarations, but make sure you preserve > the symmetry and extensibility of > > $obj.foo([EMAIL PROTECTED], *%NONSENSE) # get value of $.foo > $obj.foo([EMAIL PROTECTED], *%NONSENSE) = 5 # set $

Re: A12: default accessors and encapsulation

2004-04-20 Thread John Siracusa
On 4/20/04 2:37 PM, Larry Wall wrote: > On Tue, Apr 20, 2004 at 01:15:24PM -0400, John Siracusa wrote: > : With that "has" line alone, you auto-magically get an accessor that works > : like this: > : > : $obj.foo# get value of $.foo > : $obj.foo(5) # set $.foo = 5 > > I don't care wha

Re: A12: default accessors and encapsulation

2004-04-20 Thread Larry Wall
On Tue, Apr 20, 2004 at 01:15:24PM -0400, John Siracusa wrote: : With that "has" line alone, you auto-magically get an accessor that works : like this: : : $obj.foo# get value of $.foo : $obj.foo(5) # set $.foo = 5 I don't care what syntactic sugar you put underneath, but if you expos

A12: Strings

2004-04-20 Thread Aaron Sherman
Well, I have a lot to digest, but off the top of my head (and having nothing to do with objects, but rather the string discussion at the end), it would be very useful if I could assert: no string "complex"; or something like that. That is to say, I would love to have a way to say that my

Re: A12: default accessors and encapsulation

2004-04-20 Thread John Williams
On Tue, 20 Apr 2004, Luke Palmer wrote: > John Williams writes: > > On Tue, 20 Apr 2004, Luke Palmer wrote: > > > There. Now here's the important part: in order to *use* all this, you > > > import whatever module defines it, and then say: > > > > > > class Dog { > > > method foo (?$ar

Final Answer [Was: backticks]

2004-04-20 Thread Larry Wall
Okay, let's put this one to rest. I've suspended judgement long enough. Let me first say that I have my own personal biases, and they are towards keeping things visually and psychologically distinctive, rather than towards reducing keystrokes. (Though I have enough arthritis in my hands to at le

Re: A12: default accessors and encapsulation

2004-04-20 Thread John Siracusa
On 4/20/04 12:14 PM, Luke Palmer wrote: > Okay, well, I thought that my example did that, but apparently using > C and C is a little too complex... (my sentiments > are beginning to follow Larry's, in that I'm not sure you know what you > want -- perhaps you could give a hypotheical syntax?) There

Re: A12: default accessors and encapsulation

2004-04-20 Thread Mark J. Reed
On 2004-04-20 at 10:51:47, Luke Palmer wrote: > I guess I bogged down that message with the implementation, so the > result may have been easy to miss. That is what happened in my case. Apologies; it looks like your original solution would do the job nicely. As long as the requisite module come

Re: A12: default accessors and encapsulation

2004-04-20 Thread Luke Palmer
John Williams writes: > On Tue, 20 Apr 2004, Luke Palmer wrote: > > There. Now here's the important part: in order to *use* all this, you > > import whatever module defines it, and then say: > > > > class Dog { > > method foo (?$arg) is accessor { > > # accessor code here >

Re: A12: default accessors and encapsulation

2004-04-20 Thread John Williams
On Tue, 20 Apr 2004, Luke Palmer wrote: > There. Now here's the important part: in order to *use* all this, you > import whatever module defines it, and then say: > > class Dog { > method foo (?$arg) is accessor { > # accessor code here > } > } > > If that's not

Re: backticks

2004-04-20 Thread Luke Palmer
Juerd writes: > Peter Haworth skribis 2004-04-20 14:56 (+0100): > > > I think %hash<> is best explained as %hash{ << key key > > > key >> } with implicit curlies, not as an alternative to curlies. > > In that case, why aren't you suggesting something more in line with that? > > Here's what I'd lik

Re: A12: Storage class/class traits

2004-04-20 Thread Luke Palmer
Austin Hastings writes: > One of the things that got a little less clear with A12 was the idea of > multiple C clauses. > > Once upon a time, we talked about: > > my $spot is Dog is const is persistent is ...; > > Obviously some of those are traits, now. However, I'm wondering how to > handle

Re: A12: default accessors and encapsulation

2004-04-20 Thread Luke Palmer
Mark J. Reed writes: > Let me just chime in with my support for John's basic idea. I would > definitely prefer that it be easy to arrange things such that > > $obj.foo = 'bar' > > winds up invoking a method on $obj with 'bar' as an argument, rather > than invoking a method on $obj that ret

A12: Storage class/class traits

2004-04-20 Thread Austin Hastings
One of the things that got a little less clear with A12 was the idea of multiple C clauses. Once upon a time, we talked about: my $spot is Dog is const is persistent is ...; Obviously some of those are traits, now. However, I'm wondering how to handle things like my recent suggestion of a clas

RE: A12: default accessors and encapsulation

2004-04-20 Thread Austin Hastings
> -Original Message- > From: Mark J. Reed [mailto:[EMAIL PROTECTED] > > Let me just chime in with my support for John's basic idea. I would > definitely prefer that it be easy to arrange things such that > > $obj.foo = 'bar' > > winds up invoking a method on $obj with 'bar' as an a

Re: A12: default accessors and encapsulation

2004-04-20 Thread Matthew Walton
Mark J. Reed wrote: Let me just chime in with my support for John's basic idea. I would definitely prefer that it be easy to arrange things such that $obj.foo = 'bar' winds up invoking a method on $obj with 'bar' as an argument, rather than invoking a method on $obj that returns an lvalue to wh

Re: backticks

2004-04-20 Thread Juerd
Peter Haworth skribis 2004-04-20 14:56 (+0100): > > I think %hash<> is best explained as %hash{ << key key > > key >> } with implicit curlies, not as an alternative to curlies. > In that case, why aren't you suggesting something more in line with that? > Here's what I'd like to see instead of your

Re: A12: Required Named Parameters Strike Back!

2004-04-20 Thread Dan Sugalski
At 10:51 AM -0400 4/20/04, John Siracusa wrote: On 4/20/04 10:42 AM, Dan Sugalski wrote: At 9:50 AM -0400 4/20/04, John Siracusa wrote: On 4/19/04 7:16 PM, Larry Wall wrote: Well, no, we're still stuck at run-time validation of that. In the case of methods you can't really do anything else an

Re: A12: Required Named Parameters Strike Back!

2004-04-20 Thread John Siracusa
On 4/20/04 10:42 AM, Dan Sugalski wrote: > At 9:50 AM -0400 4/20/04, John Siracusa wrote: >> On 4/19/04 7:16 PM, Larry Wall wrote: >>> Well, no, we're still stuck at run-time validation of that. In the case >>> of methods you can't really do anything else anyway, generally speaking. >> >> Why is

Re: A12: Required Named Parameters Strike Back!

2004-04-20 Thread Dan Sugalski
At 9:50 AM -0400 4/20/04, John Siracusa wrote: On 4/19/04 7:16 PM, Larry Wall wrote: > Well, no, we're still stuck at run-time validation of that. In the case of methods you can't really do anything else anyway, generally speaking. Why is that? Because at compile time all you have is a generic t

Re: A12: default accessors and encapsulation

2004-04-20 Thread Mark J. Reed
Let me just chime in with my support for John's basic idea. I would definitely prefer that it be easy to arrange things such that $obj.foo = 'bar' winds up invoking a method on $obj with 'bar' as an argument, rather than invoking a method on $obj that returns an lvalue to which 'bar' is

Re: backticks

2004-04-20 Thread Peter Haworth
On Fri, 16 Apr 2004 23:45:48 +0200, Juerd wrote: > Jonathan Scott Duff skribis 2004-04-16 15:51 (-0500): > > Except that you've put things in this explanation that shouldn't be > > there IMHO. The %varname<> is a special case, but not of "getting a > > single item from a hash", rather it's a specia

Re: A12: default accessors and encapsulation

2004-04-20 Thread John Siracusa
On 4/20/04 1:25 AM, Luke Palmer wrote: > John Siracusa writes: >> The "will STORE" stuff covers the easy cases, but can I extend it all the >> way up to a name() that's a multimethod with a ton of optional args? I >> supposed you can (technically) do all of that with "will STORE", but it >> seems

Re: A12: default accessors and encapsulation

2004-04-20 Thread John Siracusa
On 4/19/04 10:04 PM, Damian Conway wrote: > John Siracusa wrote: >> I'd either like a way to more cleanly extend the default accessor's >> assignment behavior down the road (i.e. by just writing a new name() method, >> not by hacking away at STORE traits and adding private worker subs) or a way >>

Re: A12: Required Named Parameters Strike Back!

2004-04-20 Thread John Siracusa
On 4/19/04 9:05 PM, Damian Conway wrote: > You want: > > sub foo(+$a is required, +$b is required) { ... } Yes, that would be just fine :) -John

Re: A12: default accessors and encapsulation

2004-04-20 Thread John Siracusa
On 4/19/04 7:20 PM, Larry Wall wrote: > On Mon, Apr 19, 2004 at 06:53:29PM -0400, John Siracusa wrote: > : Yeah, that's exactly what I don't want to type over and over :) > > I really don't understand what you're getting at here. First you > complain that you'd rather write an ordinary method, an

Re: A12: Required Named Parameters Strike Back!

2004-04-20 Thread John Siracusa
On 4/19/04 7:16 PM, Larry Wall wrote: > On Mon, Apr 19, 2004 at 01:44:53PM -0400, John Siracusa wrote: > : ...named and required, or named and optional? IOW, is this all true? > : > : sub foo(+$a, +$b) { ... } > : > : foo(); # compile-time error! > : foo(1, 2); # compil

Re: A12: default accessors and encapsulation

2004-04-20 Thread mark . a . biggar
> On 4/19/04 3:58 PM, Austin Hastings wrote: > One work-around might be an alternate kind of default accessor that doesn't > allow assignment: > > $dog.name # get > $dog.name('foo') # set > $dog.name = 'foo' # compile-time error I think we already have this. Just define a

Re: A12 - Protected Attributes and Methods

2004-04-20 Thread Larry Wall
On Mon, Apr 19, 2004 at 08:21:58PM -0400, Joe Gottman wrote: :Apocalypse 12 was very clear about the difference between private and : public class members, but it didn't say anything about protected ones? How : can you define a protected member? You can't. The concept of "protected" does not

community involvement - Was: Re: backticks

2004-04-20 Thread Scott Walters
Since this horse came back to life, I'm going to give it a good thrashing, and I've got goons to help me. I've asked the Phoenix Perl Mongers for their take on the situation. I've posted a _completely_ unbiased synopsis of the situation. Here are excerpts from the replies: Tony's take: "Rename