RFC: [] as the solitary list constructor

2002-09-24 Thread Luke Palmer
=head1 TITLE Square brackets are the only list constructor =head1 VERSION Maintainer: Luke Palmer <[EMAIL PROTECTED]> Date: 24 Sep 2002 Number: 362 (?) Version: 1 =head1 ABSTRACT This RFC responds to the fury on perl6-language about the redundancy of parentheses and brackets with res

Re: Paren madness (was Re: Regex query)

2002-09-24 Thread John Williams
On Tue, 24 Sep 2002, Mike Lambert wrote: > > > > $a = (1, 2, 3); # Same as Perl 5's $a = [1,2,3]; > > $a = (1) should then do $a = [1], according to the above. > > This implies that: > > ($a) = (1) implies that $a is [1], something I don't particularly agree > with. You may be missing the chang

RE: Paren madness (was Re: Regex query)

2002-09-24 Thread David Whipp
> From: Jonathan Scott Duff > > $b = 7, 6, 5 > > @b = 7, 6, 5 > > > > Again, both create identical objects, under different > > interfaces. But now we have a problem with +$b: what should > > this mean? To be consistant with +$a (above), I would > > suggest that it simply returns the sum of

[], (), and potential design issues

2002-09-24 Thread Dan Sugalski
Folks, Larry is mostly out of touch this week, so working ourselves into a fury over a potential design issue is probably a bit counterproductive. Perhaps someone can put together a statement of the problem and post it, and we can leave the discussion for a bit, both to give larry time to ge

Re: Paren madness (was Re: Regex query)

2002-09-24 Thread Trey Harris
In a message dated Tue, 24 Sep 2002, Mike Lambert writes: > Consider: > $a = (1); > and > ($a) = (1); Yes? They both do the same thing--set $a to 1. It looks like the bottom one is a list assigned to a list, but that might be optimized out, as it doesn't matter. > > 5. Assignment to arrays an

Re: Paren madness (was Re: Regex query)

2002-09-24 Thread Mike Lambert
> 2. Scalar assignment. > > my $a;# 1. > $a = X; > > my $a;# 3. > ($a) = X; > > These should all do the same thing, regardless of X. Consider: $a = (1); and ($a) = (1); > 5. Assignment to arrays and lists. > > $a = (1, 2, 3); # Same as Perl 5's $a = [1,2,3];

RE: Paren madness (was Re: Regex query)

2002-09-24 Thread Aaron Sherman
On Tue, 2002-09-24 at 14:47, David Whipp wrote: > It seems that the fundamental problem is the dichotomy between > a scalar, and a list of 1 elem. Thus, we want After the first couple of messages, that was really no longer *my* concern, but I can't speak for others. My concern was mostly that par

Re: Paren madness (was Re: Regex query)

2002-09-24 Thread Jonathan Scott Duff
On Tue, Sep 24, 2002 at 11:47:16AM -0700, David Whipp wrote: > It seems that the fundamental problem is the dichotomy between > a scalar, and a list of 1 elem. Thus, we want > > $a = 7 > > to DWIM, whether I mean a list, or a scalar. Seems to me that > the best way to solve a dichotomy is to d

RE: Paren madness (was Re: Regex query)

2002-09-24 Thread David Whipp
It seems that the fundamental problem is the dichotomy between a scalar, and a list of 1 elem. Thus, we want $a = 7 to DWIM, whether I mean a list, or a scalar. Seems to me that the best way to solve a dichotomy is to declare it to not to be one: a scalar *IS* a list of one element. The only t

Re: Regex query

2002-09-24 Thread John Williams
> > In a message dated Tue, 24 Sep 2002, Chip Salzenberg writes: > > > > then what about > > > > > >$a = (1) > > > > > > ? And if someone says that I have to write: > > > > > >$a = (1,) > > > > > > then I am going on the warpath. That Way Lay Python. You _can_ write that, but you don't

Re: Regex query

2002-09-24 Thread Jonathan Scott Duff
On Tue, Sep 24, 2002 at 12:14:10PM -0400, Trey Harris wrote: > In a message dated Tue, 24 Sep 2002, Jonathan Scott Duff writes: > > > On Tue, Sep 24, 2002 at 11:14:04AM -0400, Aaron Sherman wrote: > > > Again, we're wading into the waters of over-simplification. Let's try: > > > > > > sub

Re: Regex query

2002-09-24 Thread Trey Harris
In a message dated Tue, 24 Sep 2002, Jonathan Scott Duff writes: > On Tue, Sep 24, 2002 at 11:14:04AM -0400, Aaron Sherman wrote: > > Again, we're wading into the waters of over-simplification. Let's try: > > > > sub foo1(){ my @foo=(1,2,3); return @foo; } > > sub foo2(){ my $foo

Re: Regex query

2002-09-24 Thread Jonathan Scott Duff
On Tue, Sep 24, 2002 at 11:14:04AM -0400, Aaron Sherman wrote: > Again, we're wading into the waters of over-simplification. Let's try: > > sub foo1(){ my @foo=(1,2,3); return @foo; } > sub foo2(){ my $foo = [1,2,3]; return $foo; } > sub foo3(*@list) { print @list.length,

Re: Regex query

2002-09-24 Thread Trey Harris
In a message dated 24 Sep 2002, Aaron Sherman writes: > That doesn't really work. Because now you introduce the case where: > > $x = (1,2,3); > @y = (1,2,3); > $z = [1,2,3]; > push @a, $x, @y, $z, (1,2,3), [1,2,3]; > > Behaves in ways that will take hours to explain to newb

Re: Regex query

2002-09-24 Thread Aaron Sherman
On Tue, 2002-09-24 at 11:07, Trey Harris wrote: > In a message dated Tue, 24 Sep 2002, Chip Salzenberg writes: > > then what about > > > >$a = (1) > > > > ? And if someone says that I have to write: > > > >$a = (1,) > > > > then I am going on the warpath. That Way Lay Python. I would *

Re: Regex query

2002-09-24 Thread Dan Sugalski
At 11:07 AM -0400 9/24/02, Trey Harris wrote: > >*shrug* Regardless of whether we like it, what Larry said is true unless >and until he invokes Rule 2. And unless he invokes Rule 2, >C is equivalent to C<[1,2,3]>. Then perhaps, rather than fretting over the unpleasant consequences of the curren

Re: Regex query

2002-09-24 Thread Aaron Sherman
On Tue, 2002-09-24 at 10:27, Peter Haworth wrote: > On 24 Sep 2002 05:21:37 -0400, Aaron Sherman wrote: > > On Tue, 2002-09-24 at 01:46, Trey Harris wrote: > > > sub push(@target is rw, *@list); > > > > Well, yes, but that wasn't the point. The C<*@list> will force array > > flattening, thus >

Re: Regex query

2002-09-24 Thread Trey Harris
In a message dated Tue, 24 Sep 2002, Chip Salzenberg writes: > According to Trey Harris: > > According to Larry, > > $a = (1,2,3); > > is equivalent to > > $a = [1,2,3]; > > because they're both equivalent to > > $a = scalar(1,2,3) > > But that's the bit we're arguing about. If you allow >

Re: Regex query

2002-09-24 Thread Chip Salzenberg
According to Trey Harris: > According to Larry, > $a = (1,2,3); > is equivalent to > $a = [1,2,3]; > because they're both equivalent to > $a = scalar(1,2,3) But that's the bit we're arguing about. If you allow $a = (1,2) then what about $a = (1) ? And if someone says that I have

Re: Regex query

2002-09-24 Thread Peter Haworth
On 24 Sep 2002 05:21:37 -0400, Aaron Sherman wrote: > On Tue, 2002-09-24 at 01:46, Trey Harris wrote: > > sub push(@target is rw, *@list); > > Well, yes, but that wasn't the point. The C<*@list> will force array > flattening, thus > > push @a, [1,2,3], 4; > > will (according to Larry's

Re: Regex query

2002-09-24 Thread Jonathan Scott Duff
On Tue, Sep 24, 2002 at 11:30:57AM +0100, Simon Cozens wrote: > At any rate, I do wish we'd stop kidding ourselves that Perl 6 is at all > going to be "cleaned up" or "regular"; I bet it'll end up with more edge > cases and special exceptions than Perl 5. Simon, Perl 6 *will* be more "regular" as

Re: Regex query

2002-09-24 Thread Simon Cozens
[EMAIL PROTECTED] (Aaron Sherman) writes: > > If we have to resort to much magic to get these right, we're pretty much > > doomed from the outset. > > You have that upside-down. Because this is so fundamental, it's worth a > great deal of magic to make it "seem right" in as many contexts as > pos

Re: Regex query

2002-09-24 Thread Simon Cozens
[EMAIL PROTECTED] (Aaron Sherman) writes: > say that array refs behave the same as arrays in every way *except* as > pertains to list flattening, and in that case, explicit flattening is > required, otherwise the ref is kept in the flattened array. Another blow to regularity. :( -- buf[

Re: Regex query

2002-09-24 Thread Aaron Sherman
On Tue, 2002-09-24 at 01:46, Trey Harris wrote: > In a message dated 24 Sep 2002, Aaron Sherman writes: > > This is because push is > > almost certainly defined as: > > > > sub push(@target, *@list) { ... } > > That should be > > sub push(@target is rw, *@list); Well, yes, but that wa