Re: Musings on operator overloading

2008-03-27 Thread Larry Wall
On Thu, Mar 27, 2008 at 09:02:37AM -0600, Thom Boyer wrote: > Larry Wall wrote: >> The .++ form is still not a method (single) dispatch, just an alternate >> form of the postfix, which is a multi dispatch. > > But the postfix is a unary operator, right? So that'd be multi dispatch on > one argum

Re: Musings on operator overloading

2008-03-27 Thread Thom Boyer
Larry Wall wrote: The .++ form is still not a method (single) dispatch, just an alternate form of the postfix, which is a multi dispatch. But the postfix is a unary operator, right? So that'd be multi dispatch on one argument. How does single dispatch differ from multi dispatch on a single

Re: Musings on operator overloading

2008-03-27 Thread Larry Wall
On Thu, Mar 27, 2008 at 09:46:29AM -0400, Mark J. Reed wrote: : Is it just me, or is all this talk about precedence and functions vs : operators vs methods creating a niggling sensation in anyone else's : head? It feels like we're in the vicinity of another one of them Big : Simplifying Idea thing

Re: Musings on operator overloading

2008-03-27 Thread Larry Wall
On Thu, Mar 27, 2008 at 01:08:43PM +0100, TSa wrote: > HaloO, > > TSa wrote: >> Another good use of the dot forms is to get a single character >> form to tighten precedence: $x**3! != $x**3.! == $x**(3!). > > BTW, is the dot form only available for postfix or for infix > as well? I.e. 3 * 2 == 3.*(

Re: Musings on operator overloading

2008-03-27 Thread Larry Wall
On Thu, Mar 27, 2008 at 01:01:27PM +0100, TSa wrote: > HaloO, > > Larry Wall wrote: >> I deem that to be an unlikely failure mode, however. So maybe .++ >> is just gone now, and you have to write \++ instead. Any objections? > > Please keep .++ as outlined below. Does the degenerate unspace not >

Re: Musings on operator overloading

2008-03-27 Thread Larry Wall
On Wed, Mar 26, 2008 at 07:32:23PM -0600, Thom Boyer wrote: > Question: given > > ($x)++ # no whitespace, so postfix? > > is ++ postfix, or infix? That is postfix. Any infix that could be confused with a postfix requires intervening whitespace. > Now, I think that > > $x.foo > > is

Re: Musings on operator overloading

2008-03-27 Thread Mark J. Reed
Is it just me, or is all this talk about precedence and functions vs operators vs methods creating a niggling sensation in anyone else's head? It feels like we're in the vicinity of another one of them Big Simplifying Idea things. Unfortunately, I don't have the actual Big Idea, so it could just

Re: Musings on operator overloading

2008-03-27 Thread Thom Boyer
Jon Lang wrote: Thom Boyer wrote: That seems better to me than saying that there's no tab character in say "blah $x\t blah" Whoever said that? Oops. I thought Larry did. But he didn't; I misread it. Whew. Somehow I managed to read Larry's words and get exactly the *opposite* meaning

Re: Musings on operator overloading

2008-03-27 Thread TSa
HaloO, Jon Lang wrote: TSa wrote: Note that I see ** more as a parametric postscript then a real binary. That is $x**$y sort of means $x(**$y). That's where we differ, then. I'm having trouble seeing the benefit of that perspective, and I can clearly see a drawback to it - namely, you have

Re: Musings on operator overloading

2008-03-27 Thread TSa
HaloO, TSa wrote: Another good use of the dot forms is to get a single character form to tighten precedence: $x**3! != $x**3.! == $x**(3!). BTW, is the dot form only available for postfix or for infix as well? I.e. 3 * 2 == 3.*(2)? Regards, TSa. -- The Angel of Geometry and the Devil of Alg

Re: Musings on operator overloading

2008-03-27 Thread TSa
HaloO, Larry Wall wrote: I deem that to be an unlikely failure mode, however. So maybe .++ is just gone now, and you have to write \++ instead. Any objections? Please keep .++ as outlined below. Does the degenerate unspace not collide with &prefix:<\>? That is does foo\bar() not mean to capt

Re: Musings on operator overloading

2008-03-27 Thread Thom Boyer
Thom Boyer wrote: And does dot always do that? If it does, then something odd happens. Consider infix:<*> and postfix:, where infix:<*> binds tighter than postfix:<+>, and both bind more loosely than dot. Then I meant "... tighter than postfix:, ..." 1 * 2! # means (1 * 2)! 1 *

Re: Musings on operator overloading

2008-03-27 Thread Thom Boyer
Thom Boyer wrote: Now, I think that $x.foo is a method call, even if there's a postfix: declaration in scope. And that's a problem, because, no matter what precedence postfix: was given, 1,2,3.foo is still going to mean 1, 2, (3.foo) instead of the desired postfix:(1,2,3