Re: Perl6 Operator List, Damian's take

2002-10-30 Thread Larry Wall
On Thu, 31 Oct 2002, Damian Conway wrote: : Larry wrote: : : > That's almost a reduce. Pity you have to include a variable. : > But since rvalues are illegal on the left side of an assignment, we : > *could* go as far as to say that : > : > 0 [+=] @b; # sum : > 1 [*=] @b; # product

Re: Perl6 Operator List, Damian's take

2002-10-30 Thread Damian Conway
Larry wrote: That's almost a reduce. Pity you have to include a variable. But since rvalues are illegal on the left side of an assignment, we *could* go as far as to say that 0 [+=] @b; # sum 1 [*=] @b; # product '' [~=] @b; # cat dwim into reduce operators rather than bein

Re: Perl6 Operator List, Damian's take

2002-10-30 Thread Larry Wall
On Wed, 30 Oct 2002, John Williams wrote: : They are different in the "scalar [op] list" case, as explained here: : : : ($a = 0) [+=] @b; # sum : ($a = 1) [*=] @b; # product : ($a ='') [~=] @b; # cat That's

Re: Perl6 Operator List, Damian's take

2002-10-30 Thread John Williams
On Tue, 29 Oct 2002, Austin Hastings wrote: > Any of you OO guys know of a case where > > $a = $a + $b; # @A [+]= @B; --> @A = @A [+] @B; > > and > > $a += $b; # @A [+=] @B; > > should be different? They are different in the "scalar [op] list" case, as explained here:

Re: Perl6 Operator List, Damian's take

2002-10-29 Thread Dave Storrs
On Tue, 29 Oct 2002, Austin Hastings wrote: > Hell, we might as well throw in multiple dispatch. Actually, I am really hoping we do. > Any of you OO guys know of a case where > > $a = $a + $b; # @A [+]= @B; --> @A = @A [+] @B; > > and > > $a += $b; # @A [+=] @B; > > should be

RE: Perl6 Operator List, Damian's take

2002-10-29 Thread Larry Wall
On Tue, 29 Oct 2002, David Whipp wrote: : Luke Palmer [mailto:fibonaci@;babylonia.flatirons.org] wrote: : : > for @x | @y -> $x is rw | $y { : > $x += $y : > } : : This superposition stuff is getting to me: I had a double-take, : wondering why we were iterating with superpositio

RE: Perl6 Operator List, Damian's take

2002-10-29 Thread David Whipp
Luke Palmer [mailto:fibonaci@;babylonia.flatirons.org] wrote: > for @x | @y -> $x is rw | $y { > $x += $y > } This superposition stuff is getting to me: I had a double-take, wondering why we were iterating with superpositions (Bitops never entered my mind). Did the C<;> ever o

Re: Perl6 Operator List, Damian's take

2002-10-29 Thread Dan Sugalski
At 1:20 AM + 10/30/02, Simon Cozens wrote: [EMAIL PROTECTED] (Dave Mitchell) writes: (I'm thinking utf8 here). I'd strongly advise against that. I'd agree. Thinking UTF-8 is generally a bad idea. If you think anything, think fixed-size code points, since that's what you're ultimately g

Re: Perl6 Operator List, Damian's take

2002-10-29 Thread Larry Wall
On 30 Oct 2002, Simon Cozens wrote: : [EMAIL PROTECTED] (Dave Mitchell) writes: : > (I'm thinking utf8 here). : : I'd strongly advise against that. Actually, it works out rather well in practice, because the string abstraction in Perl is that of a sequence of codepoints. But at least in Perl 5,

Re: Perl6 Operator List, Damian's take

2002-10-29 Thread Simon Cozens
[EMAIL PROTECTED] (Dave Mitchell) writes: > (I'm thinking utf8 here). I'd strongly advise against that. -- Ermine? NO thanks. I take MINE black. - Henry Braun is Oxford Zippy

Re: Perl6 Operator List, Damian's take

2002-10-29 Thread Austin Hastings
Interesting point, especially if operator:+= can be overloaded. @a [+=] @b; implies iteratively invoking operator:+=, whereas @a [+]= @b; implies assigning the result of iteratively invoking operator:+ It only matters when they're different. :-| And, of course, if they ARE different then t

Re: Perl6 Operator List, Damian's take

2002-10-29 Thread Luke Palmer
> Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm > Date: Tue, 29 Oct 2002 21:37:32 + > From: Aaron Crane <[EMAIL PROTECTED]> > Content-Disposition: inline > X-SMTPD: qpsmtpd/0.12, http://develooper.com/code/qpsmtpd/ > > Damian Conway writes: > > My personal favorite solution is to use s

Re: Perl6 Operator List, Damian's take

2002-10-29 Thread Damian Conway
Aaron Crane wrote: Mmm, yummy. I do have a question though (and apologies if I've merely missed the answer). We've got two productive operation-formation rules: one saying "add a final = to operate-and-assign", and the other saying "wrap in [] to vectorise". But no-one's said which order they

Re: Perl6 Operator List, Damian's take

2002-10-29 Thread Aaron Crane
Damian Conway writes: > My personal favorite solution is to use square brackets (for their dual > array and indexing connotations, and because they highlight the operator > so nicely): > > $count = @a + @b; > @sums = @a [+] @b; Mmm, yummy. I do have a question though (and apologies

Re: Perl6 Operator List, Damian's take

2002-10-29 Thread fearcadi
Michael Lazzaro writes: > > Any ideas on what > > { $^a op $^b } > > would become? > > MikeL maybe { $_a op $_b } { _ op _ } and we have simple ( ? ) rules to distinguish it from "space-eater" _ * _ surrounded by spaces is placeholder if term is ex

Re: Perl6 Operator List, Damian's take

2002-10-29 Thread Dave Mitchell
On Wed, Oct 30, 2002 at 06:51:14AM +1100, Damian Conway wrote: > String complement treats the value as a string then bitwise complements every > bit of each character. Is that the complement of the codepoint or the individual bytes? (I'm thinking utf8 here). -- Nothing ventured, nothing lost.

Re: Perl6 Operator List, Damian's take

2002-10-29 Thread Michael Lazzaro
On Tuesday, October 29, 2002, at 11:47 AM, Luke Palmer wrote: [i.e. this change doesn't make any difference] Doh! You're right, of course. For some reason I was thinking a long while back that it would be confusing to have { $^a op $^b } if ^ went back to meaning xor. But there's the s

Re: Perl6 Operator List, Damian's take

2002-10-29 Thread Damian Conway
Uri Guttman wrote: what is a string complement? bitwise? i take it the numeric is one's complement. String complement treats the value as a string then bitwise complements every bit of each character. Integer complement treats the value as a int then bitwise complements every bit. DC>

Re: Perl6 Operator List, Damian's take

2002-10-29 Thread Luke Palmer
> Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm > Date: Tue, 29 Oct 2002 11:36:20 -0800 > Cc: [EMAIL PROTECTED] > From: Michael Lazzaro <[EMAIL PROTECTED]> > X-SMTPD: qpsmtpd/0.12, http://develooper.com/code/qpsmtpd/ > > > On Tuesday, October 29, 2002, at 11:21 AM, Damian Conway wrote: >

Re: Perl6 Operator List, Damian's take

2002-10-29 Thread Damian Conway
Michael Lazzaro wrote: Any ideas on what { $^a op $^b } would become? It would be unchanged. Placeholders have nothing to do with hyperoperators. And never have had. Damian

Re: Perl6 Operator List, Damian's take

2002-10-29 Thread Uri Guttman
> "DC" == Damian Conway <[EMAIL PROTECTED]> writes: DC> Oh boy, I just *hate* the idea of C for xor. DC> Hate it, hate it, hate it! Yuck, yuck, yuck! tell us how you _really_ feel! :-) DC> My personal favorite solution is to use square brackets (for their dual DC> array and indexing

Re: Perl6 Operator List, Damian's take

2002-10-29 Thread Michael Lazzaro
On Tuesday, October 29, 2002, at 11:21 AM, Damian Conway wrote: My personal favorite solution is to use square brackets (for their dual array and indexing connotations, and because they highlight the operator so nicely): $count = @a + @b; @sums = @a [+] @b; Any ideas on what { $^a op $^b

Perl6 Operator List, Damian's take

2002-10-29 Thread Damian Conway
Oh boy, I just *hate* the idea of C for xor. Hate it, hate it, hate it! Yuck, yuck, yuck! But I do like Michael's idea of using C<@> as the hyperoperator marker (the array connotation works well, I think). The only problem is that we end up with too many C<@>'s in most expressions: $count = @a +