Re: return of copies vs references

2005-03-16 Thread Larry Wall
On Wed, Mar 16, 2005 at 11:10:40PM -0800, Darren Duncan wrote: : When I last asked a related question here, I was told that simply : returning an attribute will allow the caller to modify the original : attribute by default. That used to be true for arrays and hashes, but I just changed my mind

Re: return of copies vs references

2005-03-16 Thread Larry Wall
On Wed, Mar 16, 2005 at 09:49:47PM -0800, Darren Duncan wrote: : I need some clarification on the semantics of subroutine or method : return statements, regarding whether copies or references are : returned. It will help me in my p6ification of p5 code. : : Say I had a class with 3 private attr

Re: return of copies vs references

2005-03-16 Thread Darren Duncan
At 11:26 PM -0700 3/16/05, Luke Palmer wrote: > For each of the above cases, is a copy of or a reference to the attribute returned? For each, will the calling code be able to modify $obj's attributes by modifying the return values, or not? Well if you're making accessors, why the heck are you m

Re: return of copies vs references

2005-03-16 Thread Luke Palmer
Darren Duncan writes: > I need some clarification on the semantics of subroutine or method > return statements, regarding whether copies or references are > returned. It will help me in my p6ification of p5 code. > > Say I had a class with 3 private attributes, named [$:foo, @:bar, > %:baz], a

Re: s/true/better name/

2005-03-16 Thread Rod Adams
Larry Wall wrote: On Wed, Mar 16, 2005 at 01:22:06PM -0600, Rod Adams wrote: : Larry Wall wrote: : : >On Tue, Mar 15, 2005 at 12:28:15PM -0700, Marcus Adair wrote: : >: Isn't saying "false doesn't exist" like saying, "dark doesn't exist"? : >: Why have a word for that? : >: : >: I'm really afrai

return of copies vs references

2005-03-16 Thread Darren Duncan
I need some clarification on the semantics of subroutine or method return statements, regarding whether copies or references are returned. It will help me in my p6ification of p5 code. Say I had a class with 3 private attributes, named [$:foo, @:bar, %:baz], and I was making an explicit access

Re: [Fwd: Re: [RFC] A more extensible/flexible POD (ROUGH-DRAFT)]

2005-03-16 Thread Aaron Sherman
On Wed, 2005-03-16 at 13:42 -0800, Brian Ingerson wrote: First off, thanks for your kind responses. I'm sure I just got confused by some web page I was looking at, and overwrote part of my stack that I'd just populated from the Kwid doc. And thanks also for pointing me to the Kwid docs where they

Re: Referencing a caller's slurpy array.

2005-03-16 Thread Rod Adams
Luke Palmer wrote: Rod Adams writes: In S29, I currently have C as: multi sub grep (Any|Junction $test : [EMAIL PROTECTED]) returns List { gather { for @values -> $x { take $x if $x ~~ $test; } } } That's the listop form. I was referring to the method form: multi sub grep (

Re: New S29 draft up

2005-03-16 Thread Rod Adams
Luke Palmer wrote: Joe Gottman writes: multi sub kv (Array @array : [EMAIL PROTECTED]) returns List Returns the indexes and associated values stored in @array, lazily and in order by index. Optionally, only those of the slice defined by @indices. This one is real easy: multi sub kv (@arr

Re: New S29 draft up

2005-03-16 Thread Luke Palmer
Joe Gottman writes: > multi sub kv (Array @array : [EMAIL PROTECTED]) returns List > Returns the indexes and associated values stored in @array, lazily and in > order by index. Optionally, only those of the slice defined by @indices. This one is real easy: multi sub kv (@array) returns List {

RE: New S29 draft up

2005-03-16 Thread Joe Gottman
> -Original Message- > From: Rod Adams [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 16, 2005 3:18 AM > To: Perl6 Language List > Subject: New S29 draft up > > > I just posted a fresh copy of S29 to: > > http://www.rodadams.net/Perl/S29.pod > http://www.rodadams.net/Perl/S29.ht

Re: Referencing a caller's slurpy array.

2005-03-16 Thread Luke Palmer
Rod Adams writes: > >Uhmm... isn't *&foo the adverbial block? That is, isn't it where grep > >gets its code block in: > > > > @list.grep:{ $_ % 2 } > > > > > > > In S29, I currently have C as: > > multi sub grep (Any|Junction $test : [EMAIL PROTECTED]) returns List { > gather { > for @va

Re: [Fwd: Re: [RFC] A more extensible/flexible POD (ROUGH-DRAFT)]

2005-03-16 Thread David Storrs
On Wed, Mar 16, 2005 at 01:30:04PM -0500, Aaron Sherman wrote: > On Wed, 2005-03-16 at 12:25, David Storrs wrote: > > > I quite like <> as the bracketing characters. They are > > visually distinctive, they connect well with their adjacent C/X/L/etc > > without visually merging into it (compare L

perl6-language@perl.org

2005-03-16 Thread Larry Wall
On Wed, Mar 16, 2005 at 02:55:21PM -0600, Rod Adams wrote: : Of course, I now have to question the need for C. Other than : linguistics, which is not to be dismissed, what difference is there between : :given $expr { ... } : : and : :for $expr { ... } : : with equivalent ...'s? : : hm

Re: quotemeta

2005-03-16 Thread Larry Wall
On Wed, Mar 16, 2005 at 10:46:29PM +0100, Juerd wrote: : Larry Wall skribis 2005-03-16 9:41 (-0800): : > Except that q:meta would be an upgrade in terms of specialness, : > and besides, it's inside out from what you want, which is to quote : > a particular argument to a string interpolation, not t

Re: [Fwd: Re: [RFC] A more extensible/flexible POD (ROUGH-DRAFT)]

2005-03-16 Thread Brian Ingerson
On 16/03/05 14:56 -0500, Aaron Sherman wrote: > On Wed, 2005-03-16 at 14:24, Brian Ingerson wrote: > > > vs Kwid: > > > > `$x > $y` is about as *easy* as it gets in [Perl] > > > > Did you really read `perlkwid.kwid`? > > Yes, and can you please stop asking that question? I read it seve

Re: quotemeta

2005-03-16 Thread Juerd
Larry Wall skribis 2005-03-16 9:41 (-0800): > Except that q:meta would be an upgrade in terms of specialness, > and besides, it's inside out from what you want, which is to quote > a particular argument to a string interpolation, not the entire > interpolation. It just wants to be a miscellaneous

Re: s/true/better name/

2005-03-16 Thread John Macdonald
On Wednesday 16 March 2005 15:40, Autrijus Tang wrote: > On Wed, Mar 16, 2005 at 12:09:40PM -0800, Larry Wall wrote: > > So I'm thinking we'll just go back to "true", both for that reason, > > and because it does syntactically block the naughty meaning of true as > > a term (as long as we don't def

Re: [Fwd: Re: [RFC] A more extensible/flexible POD (ROUGH-DRAFT)]

2005-03-16 Thread Brian Ingerson
On 16/03/05 14:33 -0500, Aaron Sherman wrote: > On Wed, 2005-03-16 at 14:17, Brian Ingerson wrote: > > > Kwid does this by formally changing > > > >X<...> > > > > into > > > >{X...X} > > Ok, where is THAT proposal?! I'm reading the doc that's in > doc/perlkwid.kwid in the pugs source

perl6-language@perl.org

2005-03-16 Thread Juerd
Larry Wall skribis 2005-03-16 12:17 (-0800): > for @foo {...} > is actually short for: > for @foo -> $_ is rw {...} Has there been any decision on <-> yet? If <-> is there, it's much easier to say that without arguments, <-> $_ is used. That way, there is no surprising magic "is rw

perl6-language@perl.org

2005-03-16 Thread Rod Adams
Larry Wall wrote: Well paint yourself unchagrined, because S04 sez: Parameters are by default constant within the block. You can declare a parameter read/write by including the "is rw" trait. If you rely on $_ as the implicit parameter to a block, then then $_ is considered read/write b

Re: s/true/better name/

2005-03-16 Thread Autrijus Tang
On Wed, Mar 16, 2005 at 12:09:40PM -0800, Larry Wall wrote: > whereas as a native English speaker would probably expect > > $x = whether($a or $b); > > So I'm thinking we'll just go back to "true", both for that reason, > and because it does syntactically block the naughty meaning of true as

perl6-language@perl.org

2005-03-16 Thread Larry Wall
On Wed, Mar 16, 2005 at 01:48:27PM -0600, Rod Adams wrote: : Larry Wall wrote: : >Yes, and it distributes as any array return type declaration would. : > : > : Does this mean that we can define multiple slurpuy arrays (and : hashes?!?) in a parameter list, of different types, and Perl will sort

Re: s/true/better name/

2005-03-16 Thread Larry Wall
On Wed, Mar 16, 2005 at 01:22:06PM -0600, Rod Adams wrote: : Larry Wall wrote: : : >On Tue, Mar 15, 2005 at 12:28:15PM -0700, Marcus Adair wrote: : >: Isn't saying "false doesn't exist" like saying, "dark doesn't exist"? : >: Why have a word for that? : >: : >: I'm really afraid I'm missing some

Re: [Fwd: Re: [RFC] A more extensible/flexible POD (ROUGH-DRAFT)]

2005-03-16 Thread Aaron Sherman
On Wed, 2005-03-16 at 14:24, Brian Ingerson wrote: > vs Kwid: > > `$x > $y` is about as *easy* as it gets in [Perl] > > Did you really read `perlkwid.kwid`? Yes, and can you please stop asking that question? I read it several times, and you're starting to get just this side of insultin

perl6-language@perl.org

2005-03-16 Thread Rod Adams
Larry Wall wrote: If we go with my once-upon-a-time notion of using zip(@a;@b), then it naturally comes in as [EMAIL PROTECTED],[EMAIL PROTECTED] It pretty much has to use the list of lists syntax, since the number of Arrays we are zipping is variadic, and that means using a slurpy, which woul

Re: [Fwd: Re: [RFC] A more extensible/flexible POD (ROUGH-DRAFT)]

2005-03-16 Thread Aaron Sherman
On Wed, 2005-03-16 at 14:17, Brian Ingerson wrote: > Kwid does this by formally changing > >X<...> > > into > >{X...X} Ok, where is THAT proposal?! I'm reading the doc that's in doc/perlkwid.kwid in the pugs source tree. Hmmm... odd, I just did an update and it's GONE now... was I loo

Re: [Fwd: Re: [RFC] A more extensible/flexible POD (ROUGH-DRAFT)]

2005-03-16 Thread Brian Ingerson
On 16/03/05 13:30 -0500, Aaron Sherman wrote: > On Wed, 2005-03-16 at 12:25, David Storrs wrote: > > > I quite like <> as the bracketing characters. They are > > visually distinctive, they connect well with their adjacent C/X/L/etc > > without visually merging into it (compare L with L[foo]), and

Re: Referencing a caller's slurpy array.

2005-03-16 Thread Rod Adams
Luke Palmer wrote: Larry Wall writes: Certainly. The zone markers are as orthogonal to sigils as we can make 'em. Though I'm not sure we've given a meaning to *&foo yet. I suppose that would have to mean that the next slurpy parameter has to be a sub ref. Uhmm... isn't *&foo the adverbial

Re: s/true/better name/

2005-03-16 Thread Rod Adams
Larry Wall wrote: On Tue, Mar 15, 2005 at 12:28:15PM -0700, Marcus Adair wrote: : Isn't saying "false doesn't exist" like saying, "dark doesn't exist"? : Why have a word for that? : : I'm really afraid I'm missing something obvious here, but I'm worried : that neither "whether" nor "indeed" work

Re: [Fwd: Re: [RFC] A more extensible/flexible POD (ROUGH-DRAFT)]

2005-03-16 Thread Brian Ingerson
On 16/03/05 12:00 -0500, Aaron Sherman wrote: > On Tue, 2005-03-15 at 13:48, Brian Ingerson wrote: > > Aaron, > > > > Upon reading this, it is unclear to me whether you have read about the > > Kwid format or you are simply guessing that Kwid is the same syntax > > used by Kwiki. > > I read the Kw

Re: Referencing a caller's slurpy array.

2005-03-16 Thread Larry Wall
On Wed, Mar 16, 2005 at 11:53:43AM -0700, Luke Palmer wrote: : Larry Wall writes: : > Certainly. The zone markers are as orthogonal to sigils as we can : > make 'em. Though I'm not sure we've given a meaning to *&foo yet. : > I suppose that would have to mean that the next slurpy parameter has :

Re: Referencing a caller's slurpy array.

2005-03-16 Thread Luke Palmer
Larry Wall writes: > Certainly. The zone markers are as orthogonal to sigils as we can > make 'em. Though I'm not sure we've given a meaning to *&foo yet. > I suppose that would have to mean that the next slurpy parameter has > to be a sub ref. Uhmm... isn't *&foo the adverbial block? That is,

perl6-language@perl.org

2005-03-16 Thread Larry Wall
On Thu, Mar 17, 2005 at 02:38:45AM +0800, Autrijus Tang wrote: : On Wed, Mar 16, 2005 at 10:24:16AM -0800, Larry Wall wrote: : > On Wed, Mar 16, 2005 at 08:46:03PM +0800, Autrijus Tang wrote: : > : Is using wrap/call the correct choice here, or is there another way : > : to do it that I missed? : >

Re: s/true/better name/

2005-03-16 Thread Larry Wall
On Wed, Mar 16, 2005 at 01:41:56PM -0500, Mark J. Reed wrote: : Luke Palmer wrote: : : >Marcus Adair writes: : >> Additionally I question whether this is truly a case improving to the : >> point of least surprise? After all, I don't know a programmer who's : >> going to be surprised by what true m

Re: s/true/better name/

2005-03-16 Thread Mark J. Reed
Luke Palmer wrote: Marcus Adair writes: > Additionally I question whether this is truly a case improving to the > point of least surprise? After all, I don't know a programmer who's > going to be surprised by what true means. There are still *some* things > you may have to learn in software dev 101

Re: s/true/better name/

2005-03-16 Thread Larry Wall
On Tue, Mar 15, 2005 at 12:28:15PM -0700, Marcus Adair wrote: : Isn't saying "false doesn't exist" like saying, "dark doesn't exist"? : Why have a word for that? : : I'm really afraid I'm missing something obvious here, but I'm worried : that neither "whether" nor "indeed" work very well in many

perl6-language@perl.org

2005-03-16 Thread Autrijus Tang
On Wed, Mar 16, 2005 at 10:24:16AM -0800, Larry Wall wrote: > On Wed, Mar 16, 2005 at 08:46:03PM +0800, Autrijus Tang wrote: > : Is using wrap/call the correct choice here, or is there another way > : to do it that I missed? > > wrap/call should do what you want there, but if you want to hack in >

Re: Markup language-like features in Perl6?

2005-03-16 Thread Luke Palmer
Michele Dondi writes: > However I have the impression that there's still "too much" to it. > Granted, GUIs are intrinsically some order of complexity above textual > IO, but I think that letting the language have intrinsic markup > language(-like) features may make things much easier from the > huf

Re: s/true/better name/

2005-03-16 Thread Luke Palmer
Marcus Adair writes: > Additionally I question whether this is truly a case improving to the > point of least surprise? After all, I don't know a programmer who's > going to be surprised by what true means. There are still *some* things > you may have to learn in software dev 101 ;) The problem

Re: [Fwd: Re: [RFC] A more extensible/flexible POD (ROUGH-DRAFT)]

2005-03-16 Thread Aaron Sherman
On Wed, 2005-03-16 at 12:25, David Storrs wrote: > I quite like <> as the bracketing characters. They are > visually distinctive, they connect well with their adjacent C/X/L/etc > without visually merging into it (compare L with L[foo]), and in > the circumstance that you want to bracket an unbal

Re: s/true/better name/

2005-03-16 Thread Luke Palmer
Juerd writes: > Nicholas Clark skribis 2005-03-15 17:53 (+): > > On Tue, Mar 15, 2005 at 05:57:57PM +0100, Juerd wrote: > > > And re its spelling, that's a very good feature, because it'll slowly > > > teach me how to spell this word. And when I know how to spell it, I can > > > use it on IRC w

perl6-language@perl.org

2005-03-16 Thread Larry Wall
On Wed, Mar 16, 2005 at 08:46:03PM +0800, Autrijus Tang wrote: : Just a quick question. In Pugs t/op/arith.t we have: : : sub tryeq_sloppy ($lhs, $rhs, ?$todo1 = '') { : ... : ok($lhs==$rhs,$ todo); : ... : } : : But it breaks the $?CALLER based error reporting, because

Re: Q: index("Hello", "", 999)

2005-03-16 Thread Larry Wall
On Wed, Mar 16, 2005 at 06:44:47PM +0100, Thomas Sandlaß wrote: : Markus Laire wrote: : >What should index("Hello", "", 999) return in perl6? : : Since the first thing that needs definition is how does : the empty string match, it could be e.g. any(0.."Hello".elems). If the position of the first

Re: Referencing a caller's slurpy array.

2005-03-16 Thread Larry Wall
On Tue, Mar 15, 2005 at 01:54:09AM -0600, Rod Adams wrote: : A06 says: : : If you |shift| or |pop| without an argument, it shifts or pops whatever : slurpy array is in scope. : : : Shall we assume that @_ is always an alias for this array, so I can say : something like: : : multi sub pop (Ar

perl6-language@perl.org

2005-03-16 Thread Larry Wall
On Tue, Mar 15, 2005 at 02:47:33AM -0600, Rod Adams wrote: : I'm trying to define zip(), but can't come up with a signature for a : function that returns a lazy list of lvalues, but the list itself is not : lazy? If we go with my once-upon-a-time notion of using zip(@a;@b), then it naturally com

Re: pop, push, reverse, sort, and splice on a multidimensional array

2005-03-16 Thread Larry Wall
On Tue, Mar 15, 2005 at 02:22:13AM -0600, Rod Adams wrote: : : my int @a is shape(Int ; Int) = (1..10 ; 2..100 :by(2) ; 4); : : $x = pop @a : push @a, $x; : @b = sort @a; : # etc : : I see two views to take with these cases. : : 1) flatten the array to one dimension, and act accordingly. : : o

Re: Q: index("Hello", "", 999)

2005-03-16 Thread Thomas Sandlaß
Markus Laire wrote: What should index("Hello", "", 999) return in perl6? Since the first thing that needs definition is how does the empty string match, it could be e.g. any(0.."Hello".elems). As described in A12 string positions are much more these days than simple ints. There is a class StrPositi

Re: quotemeta

2005-03-16 Thread Larry Wall
On Wed, Mar 16, 2005 at 10:17:33AM +, Richard Proctor wrote: : On Wed 16 Mar, Rod Adams wrote: : > I vote for axing C in favor of C and C. : > : : Given A05 states that bare scalars match literally, quotemeta is (almost?) : obsolete. It can certainly be downgraded. Except that q:meta would

Re: Q: index("Hello", "", 999)

2005-03-16 Thread Larry Wall
On Wed, Mar 16, 2005 at 05:31:17PM +0200, Markus Laire wrote: : What should index("Hello", "", 999) return in perl6? : : In perl5 that returns 5, but IMHO -1 would be right result. Well, neither of those is the right result, since index is probably not going to be returning integers in Perl 6, bu

Re: [Fwd: Re: [RFC] A more extensible/flexible POD (ROUGH-DRAFT)]

2005-03-16 Thread David Storrs
On Wed, Mar 16, 2005 at 12:00:28PM -0500, Aaron Sherman wrote: > > The one obvious thing to POD users is the replacement of <> with [] or > {}. Why is this? Because < and > are used in un-balanced ways in a large > number of situations, so they should not be the primary bracketing > constructs.

Re: [Fwd: Re: [RFC] A more extensible/flexible POD (ROUGH-DRAFT)]

2005-03-16 Thread Aaron Sherman
On Tue, 2005-03-15 at 13:48, Brian Ingerson wrote: > Aaron, > > Upon reading this, it is unclear to me whether you have read about the > Kwid format or you are simply guessing that Kwid is the same syntax > used by Kwiki. I read the Kwid documentation from the Pugs distribution in depth.

Re: Q: index("Hello", "", 999)

2005-03-16 Thread Aaron Sherman
On Wed, 2005-03-16 at 10:31, Markus Laire wrote: > What should index("Hello", "", 999) return in perl6? > > In perl5 that returns 5, but IMHO -1 would be right result. Urk... exception? Seriously, if you give index a position that is off the end of the string, your options should be: a. Extend

Q: index("Hello", "", 999)

2005-03-16 Thread Markus Laire
What should index("Hello", "", 999) return in perl6? In perl5 that returns 5, but IMHO -1 would be right result. -- Markus Laire

perl6-language@perl.org

2005-03-16 Thread Autrijus Tang
On Wed, Mar 16, 2005 at 08:46:03PM +0800, Autrijus Tang wrote: > Does that form still work with Perl 6? Or should I use this? > > { local &_ := &ok; call($lhs == $rhs, $todo); } s/local/my/ of course. :-) Thanks, /Autrijus/ pgpGy03aIypYS.pgp Description: PGP signature

perl6-language@perl.org

2005-03-16 Thread Autrijus Tang
Just a quick question. In Pugs t/op/arith.t we have: sub tryeq_sloppy ($lhs, $rhs, ?$todo1 = '') { ... ok($lhs==$rhs,$ todo); ... } But it breaks the $?CALLER based error reporting, because it introduces another layer of caller. In Perl5, I'd do this: { loca

Re: s/true/better name/

2005-03-16 Thread Marcus Adair
Isn't saying "false doesn't exist" like saying, "dark doesn't exist"? Why have a word for that? I'm really afraid I'm missing something obvious here, but I'm worried that neither "whether" nor "indeed" work very well in many contexts. It seems to me that testing trueness exists in so many conte

Re: quotemeta

2005-03-16 Thread Richard Proctor
On Wed 16 Mar, Rod Adams wrote: > I vote for axing C in favor of C and C. > Given A05 states that bare scalars match literally, quotemeta is (almost?) obsolete. It can certainly be downgraded. Richard -- Personal [EMAIL PROTECTED]http://www.waveney.org Telecoms [EMAIL PROT

New S29 draft up

2005-03-16 Thread Rod Adams
I just posted a fresh copy of S29 to: http://www.rodadams.net/Perl/S29.pod http://www.rodadams.net/Perl/S29.html New: All defined functions have been restructured into packages. Perl6::Arrays, Perl6::Lists, and Perl6::Hashes are (mostly) written. Some Math::Basic and Math::Trig functions added. :'s

quotemeta

2005-03-16 Thread Rod Adams
I vote for axing C in favor of C and C. -- Rod Adams