Re: Subscripting, semicolons, and adverbs

2021-12-11 Thread Sean McAfee
if N is statically > known, otherwise at run-time. > It's not, though, if certain adverbs such as :exists are present, as in my original message. > @array[-1]:exists <-- compile time error > my $i = -1; @array[$i]:exists <-- evaluates to False To me it appears that the firs

Re: Subscripting, semicolons, and adverbs

2021-12-11 Thread Ralph Mellor
TL;DR Raku does not treat a negative index as valid. To specify the index of the last element, write `*-1`. What you're seeing is Raku trying to inform you that you are using invalid indices. On Fri, Dec 10, 2021 at 9:49 PM Sean McAfee wrote: > > @array[-1]:exists is a syntax error, even though

Re: Subscripting, semicolons, and adverbs

2021-12-10 Thread Sean McAfee
On Fri, Dec 10, 2021 at 1:48 PM I wrote: > So this looks pretty buggy, but I wonder if I'm somehow invoking undefined > behavior by combining semicolons and adverbs while subscripting. The > online docs cover both features separately, but not in tandem that I can > see. > A

Subscripting, semicolons, and adverbs

2021-12-10 Thread Sean McAfee
by all my previous evaluations of @a[$i;$i]:exists. If I continue to evaluate the expression repeatedly, I get a run of Falses, then another batch of errors at some later point. So this looks pretty buggy, but I wonder if I'm somehow invoking undefined behavior by combining semicolons and

[perl #76744] [TODO] implement :dba adverbs in regexes

2017-12-03 Thread Aleks-Daniel Jakimenko-Aleksejev via RT
Related doc ticket (with some discussion): https://github.com/perl6/doc/issues/1695 On 2010-07-27 02:32:49, moritz wrote: > alpha supported :dba('rule name'), current Rakudo doesn't, but should.

[perl #131280] [BUG] Nested slices do not work when adverbs are present

2017-05-09 Thread via RT
his fails when you add any(?) adverbs and you only get results for top-level indexes: m: dd ("a".."z")[(3, (4, (5,)))] rakudo-moar 6bb1b5: OUTPUT: «("d", ("e", ("f",)))␤» m: dd ("a".."z")[(3, (4, (5,))

[perl #129258] [BUG] the trans method in Cool doesn't handle adverbs correctly

2016-09-12 Thread via RT
# New Ticket Created by Jan-Olof Hendig # Please include the string: [perl #129258] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=129258 > # tested with This is Rakudo version 2016.08.1-169-g15532db built on MoarVM version 2

[perl #129258] [BUG] the trans method in Cool doesn't handle adverbs correctly

2016-09-12 Thread Zoffix Znet via RT
For others reading the ticket. I asked OP to submit the fix[^1] to get some practice fixing Rakudo bugs, so this ticket is taken. [1] http://irclog.perlgeek.de/perl6/2016-09-12#i_13194275

[perl #120788] Quote adverbs ignored after :to

2015-11-12 Thread jn...@jnthn.net via RT
On Fri Dec 13 22:45:16 2013, softmoth wrote: > [23:41:02] $ perl6 --version > This is perl6 version 2013.11-35-g0bf3de5 built on JVM > [23:41:07] $ cat t.pl6 > print q :heredoc :c "EOF"; > 2+3={2+3} > EOF > [23:41:11] $ perl6 t.pl6 > 2+3={2+3} > > A

[perl6/specs] eed90a: [S03] Finally, finally move =head1 Adverbs to =hea...

2014-01-21 Thread GitHub
-operators.pod Log Message: --- [S03] Finally, finally move =head1 Adverbs to =head2 newbie_Perl6++ for reminding me this still needed to be done :) .

[perl #120788] Quote adverbs ignored after :to

2013-12-13 Thread via RT
[23:41:07] $ cat t.pl6 print q :heredoc :c "EOF"; 2+3={2+3} EOF [23:41:11] $ perl6 t.pl6 2+3={2+3} Adverbs before the :heredoc (or :to) take effect. Adverbs after :to are lost. I expect the order of adverbs to not be important.

[perl6/specs] e27f00: Add :chop adverb to quoting adverbs

2013-11-01 Thread GitHub
: M S02-bits.pod Log Message: --- Add :chop adverb to quoting adverbs The idea being that in combination with :to, a .chop could be done at compile time already if there is no interpolation happening at the end of the result.

[perl6/specs] f868fd: Small clarification in subscript adverbs

2013-05-22 Thread GitHub
: M S02-bits.pod Log Message: --- Small clarification in subscript adverbs After masak++ made me think about it more

[perl6/specs] 7883bc: Some clarifications on using adverbs with subscrip...

2013-05-22 Thread GitHub
: M S02-bits.pod Log Message: --- Some clarifications on using adverbs with subscripts Please consider this a draft, a discussion piece if you will. I simply got inspired by http://irclog.perlgeek.de/perl6/2013-05-21#i_7098764

[perl6/specs] fd94c2: Allow false booleans into slice adverbs

2013-05-13 Thread GitHub
-bits.pod Log Message: --- Allow false booleans into slice adverbs

rounding method adverbs

2010-08-01 Thread Darren Duncan
Martin D Kealey said (in the a..b thread): >> So then, "a" cmp "ส้" is always defined, but users can change the >> definition. > > I take the opposite approach; it's always undefined (read, unthrown > exception) unless the user tells us how they want it treated. That can be a > command-line switch

[perl #76744] [TODO] implement :dba adverbs in regexes

2010-07-27 Thread via RT
# New Ticket Created by Moritz Lenz # Please include the string: [perl #76744] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=76744 > alpha supported :dba('rule name'), current Rakudo doesn't, but should.

[perl #74492] [BUG] Rakudo can't parse two-adverbs-in-a-row as having an invisible comma between them

2010-04-19 Thread Carl Mäsak
: sub foo(:$a, :$b, :$c) {}; foo(:a :b :c) rakudo 538606: OUTPUT«Unable to parse postcircumfix:sym<( )>, couldn't find final ')' [...] * masak submits rakudobug std: :a :b std 30407: OUTPUT«ok 00:01 107m␤» is that the same as :a, :b? aye. S02: "Two or more adverb

[perl #59794] [TODO] implement :exists and :delete adverbs

2008-10-11 Thread via RT
# New Ticket Created by Moritz Lenz # Please include the string: [perl #59794] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59794 > exists and delete are now adverbs on the subscript operator, not methods or functi

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
is a bit lengthy and > >$x = log $y, :base(2); > > looks more like a two element list assigned to $x. That's because it *is* a two element list. In the current scheme of things, you have to put: $x = log $y :base(2); The point being that adverbs are recognized only where

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

[perl #47996] [BUG] pge - regex adverbs don't accept leading space

2007-11-30 Thread via RT
# New Ticket Created by Patrick R. Michaud # Please include the string: [perl #47996] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=47996 > PGE seems to have trouble with [ :sigspace(0) this is not spaced ] # fails

Re: S02: generalized quotes and adverbs

2006-05-11 Thread Larry Wall
On Wed, May 10, 2006 at 08:09:45AM +0100, Daniel Hulme wrote: : > qX ::= "q:x:y:z"; : > : > as a simple, argumentless "word" macro. : But would that DWIM when I come to write : : qX(stuff, specifically not an adverb argument); : : ? Just looking at it, I would expect qX() to call a function

Re: S02: generalized quotes and adverbs

2006-05-10 Thread Daniel Hulme
> qX ::= "q:x:y:z"; > > as a simple, argumentless "word" macro. But would that DWIM when I come to write qX(stuff, specifically not an adverb argument); ? -- "The rules of programming are transitory; only Tao is eternal. Therefore you must contemplate Tao before you receive en

Re: S02: generalized quotes and adverbs

2006-05-09 Thread Larry Wall
On Tue, May 09, 2006 at 11:15:24PM -0700, jerry gay wrote: : according to S02, under 'Literals', generalized quotes may now take : adverbs. in that section is the following comment: : : : [Conjectural: Ordinarily the colon is required on adverbs, but the : "quote" decl

S02: generalized quotes and adverbs

2006-05-09 Thread jerry gay
according to S02, under 'Literals', generalized quotes may now take adverbs. in that section is the following comment: [Conjectural: Ordinarily the colon is required on adverbs, but the "quote" declarator allows you to combine any of the existing adverbial forms above wi

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 : &g

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 alt

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

Adverbs

2006-04-24 Thread Jonathan Lang
How do you define new adverbs, and how does a subroutine go about accessing them? -- Jonathan Lang

Re: Context of hash slices; quotation adverbs

2005-04-19 Thread Larry Wall
On Tue, Apr 19, 2005 at 02:14:04AM +0300, wolverian wrote: : On Mon, Apr 18, 2005 at 04:00:53PM -0700, Larry Wall wrote: : > %num_of_lines = [EMAIL PROTECTED]; : > : > : because the Perl 5 way would put a reference to @file in the hash. : > : Scalar context always makes references now, from wh

Re: Context of hash slices; quotation adverbs

2005-04-19 Thread wolverian
On Mon, Apr 18, 2005 at 04:00:53PM -0700, Larry Wall wrote: > %num_of_lines = [EMAIL PROTECTED]; > > : because the Perl 5 way would put a reference to @file in the hash. > : Scalar context always makes references now, from what I understand. > > Interestingly, a stored reference would track t

Re: Context of hash slices; quotation adverbs

2005-04-18 Thread Larry Wall
On Mon, Apr 18, 2005 at 06:44:55PM -0400, Kurt Hutchinson wrote: : On Mon, Apr 18, 2005 at 11:23:34PM +0300, Roie Marianer wrote: : > That makes sense, but that would make : > %num_of_lines = @file : > not DWIM... of course that would translate into : > %num_of_lines = scalar @file : > so maybe t

Re: Context of hash slices; quotation adverbs

2005-04-18 Thread Kurt Hutchinson
On Mon, Apr 18, 2005 at 11:23:34PM +0300, Roie Marianer wrote: > That makes sense, but that would make > %num_of_lines = @file > not DWIM... of course that would translate into > %num_of_lines = scalar @file > so maybe that's OK. In order to promote proper syntactical thinking, note that this is

Re: Context of hash slices; quotation adverbs

2005-04-18 Thread Larry Wall
On Mon, Apr 18, 2005 at 11:23:34PM +0300, Roie Marianer wrote: : > : But when you start interpolating, you get into a big mess: : > : h<\qq[$interpolated]> = want(); # ??? : > : h<<$foo>> = want(); # ??? : > : > I think that, as with functions called in unknown context, we should : > just force t

Re: Context of hash slices; quotation adverbs

2005-04-18 Thread Roie Marianer
> : But when you start interpolating, you get into a big mess: > : h<\qq[$interpolated]> = want(); # ??? > : h<<$foo>> = want(); # ??? > > I think that, as with functions called in unknown context, we should > just force the RHS here to list context, and rely on the RHS to add > extra context as

Re: Context of hash slices; quotation adverbs

2005-04-17 Thread Larry Wall
On Sun, Apr 17, 2005 at 08:00:00PM -0700, Brent 'Dax' Royal-Gordon wrote: : Larry Wall <[EMAIL PROTECTED]> wrote: : > : First, context of hash slices: : > : Hash slices with {} notation are trivially either scalars or lists: : > : $h{'foo'} = want(); # Scalar : > : $h{'foo','bar'} = want(); # Lis

Re: Context of hash slices; quotation adverbs

2005-04-17 Thread Brent 'Dax' Royal-Gordon
Larry Wall <[EMAIL PROTECTED]> wrote: > : First, context of hash slices: > : Hash slices with {} notation are trivially either scalars or lists: > : $h{'foo'} = want(); # Scalar > : $h{'foo','bar'} = want(); # List > > Right. Tangentially, that makes me wonder: is there a difference between sca

Re: Context of hash slices; quotation adverbs

2005-04-17 Thread Larry Wall
); # ??? I think that, as with functions called in unknown context, we should just force the RHS here to list context, and rely on the RHS to add extra context as necessary if they really mean scalar. If something really is always producing a scalar value, it doesn't matter if it's c

Context of hash slices; quotation adverbs

2005-04-17 Thread Roie Marianer
appens: $h = want(); # Scalar $h = want(); # List But when you start interpolating, you get into a big mess: h<\qq[$interpolated]> = want(); # ??? h<<$foo>> = want(); # ??? Secondly, quotation adverbs (S02) that take arguments could theoretically be variables that only exist duri

Re: adverbs

2004-08-20 Thread Larry Wall
izer : at this level. :bar will get tokenized before : will, so that's how : it's interpreted. Or at least, the parser functions as a tokener at this level. : > : Larry also shows this example: : > : : > : > @a.sort:quick:{ +$_ } # both adverbs apply to .sort : > : : > : Would that work for

Re: adverbs

2004-08-20 Thread Luke Palmer
uld be confused with a longer term starting > with colon. And /^\:\w+/ is always a named pair of some sort. Otherwise > we couldn't string together :foo:bar:baz:utf($ate). This nice effect is a result of the fact that Perl will use a tokenizer at this level. :bar will get toke

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. P

adverbs

2004-08-20 Thread John Williams
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 correct me where I have made mistakes. What is the rule(s) for when :foo

Adverbs and Numeric Literals

2002-12-17 Thread Dave Whipp
A3/E3 introduce adverbs using the colon operator. An example given is as a "step" for the range operator: 0..Inf : 2 How is the ambiguity with literals resolved? What is the output of print 0..3#2:2 ? 012345678 or 02 Is it whitespace sensitive? What about "0..3#12:2"? Dave.

pragma adverbs/attributes

2001-07-21 Thread Me
> use strict 'recursive'; If this is not yet done and is deemed a good idea, I'd add that it seems to me to be equally applicable to perl 5. Further, considering the more general [pragma] 'recursive'; I can imagine pragma adverbs / attributes. I searched p