Re: Perl6 Operator (REMAINING ISSUES)
On Fri, 1 Nov 2002, it was written: On Fri, Nov 01, 2002 at 10:35:08AM -0800, Ed Peschko wrote: So again, I don't see the difference between the two. ^[+]= and ^+= are synonyms as far as I can see, and hence no need for the first form. Only in the absence of overloading, and only because we've naively defined array ops to always do union rather than intersection. If there were a vector op that took the shorter of two arrays as the overall length, then a = a »op« b Ooo! I have it! a »op« b # picks the shorter of the two lengths (intersection) a «op» b # picks the longer of the two lengths (union) Maybe the hyper-hash guys could work with it too. ~ John Williams
Re: Perl6 Operator (REMAINING ISSUES)
Larry Wall writes: On Fri, Nov 01, 2002 at 11:51:17AM -0700, John Williams wrote: Right. ^= is rather pointless, because = already understands list context. They're not quite the same because list assignment truncates first. To wit: a = [1,2,3]; b = [4,5]; a = b; # a gets [4,5] a ^= b;# a gets [4,5,undef] And if you define = as an intersection rather than a union op, you'd get a ^= b;# a gets [4,5,3] Maybe. Or there could be a truncation implicit in intersection operators. is it possible to make more clear this entry in the perl6 just-ice : for loop is just ... because it seems that all plaintive wine flows because that is unclear . because the second part seems to be obvious : vector operation is just a for loop with arguments scattered around ( and inside) it . something like sub operator:^[] (Code op, a, b) is parsed /\^\[op\]/ { ... } if we assume that ^[] staff is just a for loop ( that is, subroutine ) with one ( for prefix/postfix) or two ( for infix ) input streams ( wich can be degenerate if one of the arguments is scalar ) ( and ^[] is more general , because it can accept hashes ( maybe we should allow hash as input stream in for loop ) ) so if we assume that, than probably the decision on union/intersection in vector ops and for loop with multiple streams should be unifyed . in for loop we have special | , , stream separators to distinguish/force what we want. why for vector operations this have to be more implicit ? ( or may be I misunderstood and It is not ) . in other words , is it going to be that each op will have its own default behavior ( with respect to unify/intersect and such ) when vectorized ? can I define an operator and be sure about its behavior when vectorized , or should I specify it at scalar operator definition , or should I define explicitely both scalar and vector version. arcadi
Re: Perl6 Operator (REMAINING ISSUES)
On Sat, Nov 02, 2002 at 02:18:44AM +0200, [EMAIL PROTECTED] wrote: snip ... in that case the vectorization is *compleatly* orthogonal to the details of op and we even can have something like @a ^[{ $^a $^b ?? 1 :: ($^a,$^b) := ($^b,$^a) }] @b I agree with all that you said above, I'm just saying we should make typing [] *optional*. 99% of the time, people are not going to need it, as they are not defining their own operators as you did above. Ed
Re: Perl6 Operator (REMAINING ISSUES)
Ed Peschko writes: I agree with all that you said above, I'm just saying we should make typing [] *optional*. 99% of the time, people are not going to need it, as they are not defining their own operators as you did above. Ed long ago ( when xor was ! and ^ was called hyper ) Larry Wall was talking about allowing spaces between bulding blocks of long operators a ^ .+ = b . so optional [ ] in vector operations becomes *very* similar to optional ( ) in function call . Now almost sure , that name of the vectorization will change couple of times ( and if it's sub one ( everyone will ! ) can define alias operator:^[] := operator:`` ( very vague ) ). so , maybe , the fruitfull way to generalize vector operations is to say : perl do not have vector operations . perl have operator algebra ( does it ? ) that can produce vector version of any operator , but more so . op op = ^ op v op t op ... arcadi
Re: Perl6 Operator (REMAINING ISSUES)
On 2002-10-31 at 12:45:23, David Wheeler wrote: Plus, it turns out not to be at all hard to type on Mac OS X. ;-) Well, the angle quotes happen to fall within Latin-1, and so they're easier to get to. On Windows you can either set up special key mappings or just type ALT+171 for « and ALT+187 for », which gets wearisome after a while although you can get your fingers taught pretty quickly. Vim and emacs and XIM all take care of the UNIX case. Once you wander away from Latin-1 into the more general world of Unicode, you start running into trouble on the input side. On Windows you pretty much have to use the Character map accessory. Emacs and vim still work on UNIX, but I don't know of a XIM implementation for general Unicode. (Although if you log into your Unix machine using Kermit-95, it has a keystroke sequence for arbitrary Unicode input). Presumably, though, if Perl did have Unicode operators, it would also have an ASCII alternative, even if only something like \u00ab and \u00bb. -- Mark REED| CNN Internet Technology 1 CNN Center Rm SW0831G | [EMAIL PROTECTED] Atlanta, GA 30348 USA | +1 404 827 4754
Re: Perl6 Operator (REMAINING ISSUES)
On 31 Oct 2002 at 15:59, Mark J. Reed wrote: Once you wander away from Latin-1 into the more general world of Unicode, you start running into trouble on the input side. On Windows you pretty much have to use the Character map accessory. Emacs and vim still work on UNIX, but I don't know of a XIM implementation for general Unicode. (Although if you log into your Unix machine using Kermit-95, it has a keystroke sequence for arbitrary Unicode input). Emacs and vim also works on Windows, not just UNIX. -- Markus Laire 'malaire' [EMAIL PROTECTED]
RE: Perl6 Operator (REMAINING ISSUES)
Markus Laire: # Emacs and vim also works on Windows, not just UNIX. So does DOS 'edit'. That doesn't mean Windows users use it. Windows users want tools that look and act like Windows tools--if they didn't, they'd be using another OS. Neither GNU emacs nor xemacs fits the bill, and I doubt vim does either. I'm an aberration--I use Windows, but I have a Cygwin toolkit installed and use it regularly. Still, I use VS.Net (with Visual Perl) for my editing, not a Unix editor. When telnetting, I use emacs, so I installed XEmacs, used it for a while, and decided I didn't like it for my local work. It had some really cool features--I was *very* pleasantly surprised at how nicely it meshed with CVS--but it just didn't fit my Windows-shaped brain. You can bet that if I, a Perl core hacker who keeps two copies of cmd.exe open at all times with c:\cygwin\bin in his path, am not going to use XEmacs, your average Joe who downloads ActiveState Perl 6 to test his hit-counter script won't use emacs or vim either. --Brent Dax [EMAIL PROTECTED] @roles=map {Parrot $_} qw(embedding regexen Configure) Wire telegraph is a kind of a very, very long cat. You pull his tail in New York and his head is meowing in Los Angeles. And radio operates exactly the same way. The only difference is that there is no cat. --Albert Einstein (explaining radio)
Re: Perl6 Operator (REMAINING ISSUES)
actually , ones we decide that ^ *is necessary for vectorization , we can allow other brackets , optional brackets ( where unambiguous ) , and spaces inside the brackets : a ^+= b a ^[+]= b a ^(+)= b a ^( + )= b a ^{ + }= b a ^{+}= b a ^[ + ]= b right, and what does this all mean? I have yet to see a good meaning for array ^[+]= array2 ... Perhaps, having just ^ as a vector op, and using ^[op] to disambiguate (or as an equivalent) is the way to go. Ed