Re: adverbs o operators

2008-08-07 Thread TSa
HaloO, Larry Wall wrote: The whitespace proposal is essentially to require whitespace between any operator any following pair if the pair is intended to be a noun and not an adverb. So, then my log:base(2) would still look for the positional argument, right? Alternately, we could force eve

Re: adverbs o operators

2008-08-07 Thread Larry Wall
On Thu, Aug 07, 2008 at 06:15:07PM +0200, TSa wrote: >> Do you write >> >> $a lt:lc $b le:lc $c > > I think that works and looks best. My favorite hope is that > >$x = log:2 $y; > > flies, as well. > >$x = log:base(2) $y; > > is a bit lengthy and > >$x = log $y, :base(2); > > looks

Re: adverbs o operators

2008-08-07 Thread TSa
HaloO, John M. Dlugosz wrote: So do they have to go at the end of the whole expression in the current grammar? I don't follow about the spaces. The problem is term versus operator parsing. Do you write $a lt:lc $b le:lc $c I think that works and looks best. My favorite hope is that

Re: adverbs o operators

2008-08-07 Thread John M. Dlugosz
Larry Wall larry-at-wall.org |Perl 6| wrote: > As for > marking each op individually, it might be possible if we add a > whitespace dependency between "lt:lc" and "lt :lc", but 1 ..:by(2) 100 > is pretty ugly. > > Larry So do they have to go at the end of the whole expression in the current gram

Re: Adverbs

2006-04-24 Thread Jonathan Lang
Larry Wall wrote: > You might have to write that > >@list ==> $foo.act :bar('baz'); > > I think or the colon on the method would be taken as starting a list. > I dunno, depends on whether .act: is considered a "longest token", > I guess. I could argue it the other way as well, and :bar is a lo

Re: Adverbs

2006-04-24 Thread Damian Conway
One other point: act $foo, @list, bar => 'baz'; is actually the same as: act($foo, @list, bar => 'baz'); which might or might not dispatch to a method on $foo, depending on whether (and how) &act is defined. Jonathan probably meant: act $foo: @list, bar => 'baz'; for the indirec

Re: Adverbs

2006-04-24 Thread Larry Wall
On Mon, Apr 24, 2006 at 08:30:04PM -0700, Jonathan Lang wrote: : Larry Wall wrote: : > Jonathan Lang wrote: : > : How do you define new adverbs, and how does a subroutine go about : > : accessing them? : > : > Adverbs are just optional named parameters. Most of the magic is in : > the call syntax.

Re: Adverbs

2006-04-24 Thread Jonathan Lang
Larry Wall wrote: > Jonathan Lang wrote: > : How do you define new adverbs, and how does a subroutine go about > : accessing them? > > Adverbs are just optional named parameters. Most of the magic is in > the call syntax. Ah. So every part of a Capture Object has an alternate call syntax: act

Re: Adverbs

2006-04-24 Thread Larry Wall
On Mon, Apr 24, 2006 at 06:58:04PM -0700, Jonathan Lang wrote: : How do you define new adverbs, and how does a subroutine go about : accessing them? Adverbs are just optional named parameters. Most of the magic is in the call syntax. Larry

Re: adverbs

2004-08-20 Thread Larry Wall
On Fri, Aug 20, 2004 at 06:12:06PM -0600, Luke Palmer wrote: : Larry Wall writes: : > On Fri, Aug 20, 2004 at 04:15:43PM -0600, John Williams wrote: : > : : > :say .meth :foo;# say( .meth( foo=>1 ) ) : > : > That one works. : : But that's because :foo is an adverb to .meth, not because .m

Re: adverbs

2004-08-20 Thread Luke Palmer
Larry Wall writes: > On Fri, Aug 20, 2004 at 04:15:43PM -0600, John Williams wrote: > : > :say .meth :foo;# say( .meth( foo=>1 ) ) > > That one works. But that's because :foo is an adverb to .meth, not because .meth is taking an argument 'foo' => 1, right? > Likewise > > sqrt($x):bo

Re: adverbs

2004-08-20 Thread Larry Wall
On Fri, Aug 20, 2004 at 04:18:55PM -0700, Larry Wall wrote: : Only a sig of () makes it *not* look for an argument as a list operator. That's overstated. Only a sig of () or ($x) or (?$x) suppresses list operator-ness on ordinary function names. Larry

Re: adverbs

2004-08-20 Thread Larry Wall
On Fri, Aug 20, 2004 at 04:15:43PM -0600, John Williams wrote: : Adverbs are confusing me mightily lately. : : It may be that Larry's A12 revision just needs a few examples : *with* parenthesis to straighten me out. : : Here are some semi-coherent attempts to sort it out : in my mind. Please cor