Re: Problem defining factorial operator in .rakumod file

2022-10-19 Thread Brian Duggan
On Friday, October 14, Bruce Gray wrote: > because the `~` tilde character is not special to Raku. > Instead of: > use lib '~/Documents/myRaku/gitHub/SequenceHelper/lib'; > , you need either of these: > use lib "%*ENV/Documents/myRaku/gitHub/SequenceHelper/lib"; > use lib %*ENV ~

Re: Problem defining factorial operator in .rakumod file

2022-10-14 Thread Joseph Polanik
On 10/14/22 6:03 PM, Ralph Mellor wrote: On Fri, Oct 14, 2022 at 10:59 PM Joseph Polanik wrote: Update: ... all methods are reporting correct results. Thanks for the help. Good to see resolution of problems. :) Is everything now resolved or are some things still outstanding? -- love,

Re: Problem defining factorial operator in .rakumod file

2022-10-14 Thread Joseph Polanik
On 10/14/22 5:48 PM, Bruce Gray wrote: On Oct 14, 2022, at 3:23 PM, Joseph Polanik wrote: The script Run/run_SequenceHelper.raku contains only the following lines use lib '~/Documents/myRaku/gitHub/SequenceHelper/lib'; use SequenceHelper :ALL; --snip-- A possible piece of the puzzle is that

Re: Problem defining factorial operator in .rakumod file

2022-10-14 Thread Ralph Mellor
On Fri, Oct 14, 2022 at 10:59 PM Joseph Polanik wrote: > > Update: ... all methods are reporting correct results. > > Thanks for the help. Good to see resolution of problems. :) Is everything now resolved or are some things still outstanding? -- love, raiph

Re: Problem defining factorial operator in .rakumod file

2022-10-14 Thread Joseph Polanik
Update: I was missing a couple of commas. Now all methods are reporting correct results. raku --ll-exception -I/home/jpolanik/Documents/myRaku/gitHub/SequenceHelper/lib/ Run/run_SequenceHelper.raku Invoke factorial operator 120 Invoke factorial sub 120 Invoke double factorial operator 15

Re: Problem defining factorial operator in .rakumod file

2022-10-14 Thread Bruce Gray
> On Oct 14, 2022, at 3:23 PM, Joseph Polanik wrote: > >> The script Run/run_SequenceHelper.raku contains only the following lines >>> use lib '~/Documents/myRaku/gitHub/SequenceHelper/lib'; >>> use SequenceHelper :ALL; --snip-- A possible piece of the puzzle is that your `use` line is

Re: Problem defining factorial operator in .rakumod file

2022-10-14 Thread Vadim Belman
I like the way you use ~ in `use lib '~/...';`. Though it doesn't work as expected. But it's nice! :D Best regards, Vadim Belman > On Oct 14, 2022, at 4:05 PM, Joseph Polanik wrote: > > On 10/14/22 3:38 PM, Elizabeth Mattijsen wrote: >>> On 14 Oct 2022, at 21:15, Joseph Polanik >>>

Re: Problem defining factorial operator in .rakumod file

2022-10-14 Thread Joseph Polanik
/Documents/myRaku/gitHub/SequenceHelper/lib/ Run/run_SequenceHelper.raku Invoke factorial operator 120 Invoke factorial sub 120 Invoke double factorial operator 15 Invoke is-palindrome True The other two methods, genSeq_IndexOps and  genSeq_ArrayOps, are producing errors: raku --ll-exceptio

Re: Problem defining factorial operator in .rakumod file

2022-10-14 Thread Elizabeth Mattijsen
> On 14 Oct 2022, at 22:23, Joseph Polanik wrote: > > On 10/14/22 4:15 PM, Elizabeth Mattijsen wrote: > >> The script Run/run_SequenceHelper.raku contains only the following lines >>> use lib '~/Documents/myRaku/gitHub/SequenceHelper/lib'; >>> use SequenceHelper :ALL; >> OOC, what happens if

Re: Problem defining factorial operator in .rakumod file

2022-10-14 Thread Joseph Polanik
On 10/14/22 4:15 PM, Elizabeth Mattijsen wrote: The script Run/run_SequenceHelper.raku contains only the following lines use lib '~/Documents/myRaku/gitHub/SequenceHelper/lib'; use SequenceHelper :ALL; OOC, what happens if you remove the :ALL here? No change that I can see: raku

Re: Problem defining factorial operator in .rakumod file

2022-10-14 Thread Elizabeth Mattijsen
> On 14 Oct 2022, at 22:05, Joseph Polanik wrote: > > On 10/14/22 3:38 PM, Elizabeth Mattijsen wrote: >>> On 14 Oct 2022, at 21:15, Joseph Polanik wrote: >>> Actually, I did create a factorial() sub, but that didn't get me out of my >>> present predicament. It works as expected when

Re: Problem defining factorial operator in .rakumod file

2022-10-14 Thread Joseph Polanik
On 10/14/22 3:38 PM, Elizabeth Mattijsen wrote: On 14 Oct 2022, at 21:15, Joseph Polanik wrote: Actually, I did create a factorial() sub, but that didn't get me out of my present predicament. It works as expected when invoked from the command line. However, when invoked from a test script (or

Re: Problem defining factorial operator in .rakumod file

2022-10-14 Thread Elizabeth Mattijsen
> On 14 Oct 2022, at 21:15, Joseph Polanik wrote: > Actually, I did create a factorial() sub, but that didn't get me out of my > present predicament. It works as expected when invoked from the command line. > However, when invoked from a test script (or the REPL) the error message is >

Re: Problem defining factorial operator in .rakumod file

2022-10-14 Thread Joseph Polanik
On 10/14/22 11:39 AM, Parrot Raiser wrote: The cause of the problem may well need to be fixed for other reasons, but re-purposing an almost universal operator like "!" ("not") sounds like a thoroughly bad idea, the route to non-standard code. If you must have a factorial op

Re: Problem defining factorial operator in .rakumod file

2022-10-14 Thread Elizabeth Mattijsen
> On 14 Oct 2022, at 20:35, Joseph Polanik wrote: > Each of these results is correct. So, the problem remains that some subs are > not found when invoked either from a test script or from the REPL. > > Is there some cache that I must clear when changing a .rakumod file to > prevent my system

Re: Problem defining factorial operator in .rakumod file

2022-10-14 Thread Joseph Polanik
helpful. I have 6 subs in my module and all 6 work correctly when invoked from the system command line. # Verify version raku -e 'use lib "lib"; use SequenceHelper; say ver()'; # v0.0.1 # Verify factorial operator raku -e 'use lib "lib&quo

Re: Problem defining factorial operator in .rakumod file

2022-10-14 Thread Parrot Raiser
The cause of the problem may well need to be fixed for other reasons, but re-purposing an almost universal operator like "!" ("not") sounds like a thoroughly bad idea, the route to non-standard code. If you must have a factorial operator, what's wrong with defining "Fact&

Re: Problem defining factorial operator in .rakumod file

2022-10-14 Thread Elizabeth Mattijsen
plementing the Raku® Programming Language v6.d. Built on MoarVM version 2022.07-16-g3ae8a31c1. > On 14 Oct 2022, at 05:30, Joseph Polanik wrote: > > > On 10/13/22 9:19 PM, Ralph Mellor wrote: >> On Fri, Oct 14, 2022 at 12:37 AM Joseph Polanik wrote: >>> I am trying to

Re: Problem defining factorial operator in .rakumod file

2022-10-13 Thread Ralph Mellor
On Fri, Oct 14, 2022 at 4:30 AM Joseph Polanik wrote: > > > It works for me. (v2022.02) > > When I use the REPL, the results are the same. The results are the same for ALL of us, for ALL Rakudo versions. Try the program 42!; Note how the error message is the same. The results are the same for

Re: Problem defining factorial operator in .rakumod file

2022-10-13 Thread Joseph Polanik
On 10/13/22 9:19 PM, Ralph Mellor wrote: On Fri, Oct 14, 2022 at 12:37 AM Joseph Polanik wrote: I am trying to define '!' as the factorial operator. The following works in a .raku script file: sub postfix: ($n) is export { when $n == 0 {return 1} default {$n * ($n - 1

Re: Problem defining factorial operator in .rakumod file

2022-10-13 Thread Ralph Mellor
On Fri, Oct 14, 2022 at 12:37 AM Joseph Polanik wrote: > > I am trying to define '!' as the factorial operator. The following works > in a .raku script file: > >sub postfix: ($n) is export { > when $n == 0 {return 1} > default {$n * ($n - 1)!} >} > >

Problem defining factorial operator in .rakumod file

2022-10-13 Thread Joseph Polanik
I am trying to define '!' as the factorial operator. The following works in a .raku script file:   sub postfix: ($n) is export {     when $n == 0 {return 1}     default {$n * ($n - 1)!}   } However when I tried to move this sub to a .rakumod file, it produces an error: Negation metaoperator

Re: The ,= operator

2020-12-07 Thread Ralph Mellor
> > @fib[1, 5, 10..15, 20] > (1 8 (89 144 233 377 610 987) 10946) > ^ > > Why??? As Joe noted in his last email: > remember, back in perl-land the default behavior is to flatten, > in raku ... by default [raku is] oriented toward building up > complex structures like

Re: The ,= operator

2020-12-07 Thread Aureliano Guedes
led "use legal name". When applied >> to a nickname it yields the corresponding legal name. But when >> applied to a legal name it just yields that name, i.e. it's a no op. >> >> That's all that decont does, except the analog to a nickname is >> a `Scalar`, a

Re: The ,= operator

2020-12-06 Thread William Michels via perl6-users
when > applied to a legal name it just yields that name, i.e. it's a no op. > > That's all that decont does, except the analog to a nickname is > a `Scalar`, and the analog to a legal name is anything else. > > > Even if the ",=" postfix operator were to gain this abilit

Re: The ,= operator

2020-12-06 Thread Joseph Brenner
ToddAndMargo via perl6-users wrote: > I am a little late to this conversation, but `,=` > looks a lot like `push` to me. Yes that was my first impression, if you read ahead a bit in the discussion you'll see it explained. In summary: the = shortcuts all work in a precisely parallel way, so @r

Re: The ,= operator

2020-12-05 Thread ToddAndMargo via perl6-users
Hi All, I am a little late to this conversation, but `,=` looks a lot like `push` to me. Am I missing something? -T

Re: The ,= operator

2020-11-30 Thread Joseph Brenner
William Michels wrote: > Joe, what would you expect the code below to produce? > %h<> ,= c => 3; > @a[] ,= 'd'; Well *I* expect it to error out, but that's my p5 brain talking. The Raku approach is if you ask for nothing it gives you everything, so an empty index like that essentially

Re: The ,= operator

2020-11-29 Thread Ralph Mellor
> Ralph Mellor wrote: > >> > @r = @r , 'd'; > >> > >> There isn't anything very useful in this behavior though, is there? > > Just to be clear, I wasn't saying I didn't think circular references > should be forbidden, I just specifically meant that you

Re: The ,= operator

2020-11-29 Thread Ralph Mellor
a `Scalar`, and the analog to a legal name is anything else. > Even if the ",=" postfix operator were to gain this ability on non-hash > objects, then hash-objects would be special-cased in **not** requiring > a Zen-sliced decontainerized object on the LHS, so people would have &

Re: The ,= operator

2020-11-29 Thread William Michels via perl6-users
On Sun, Nov 29, 2020 at 9:16 AM Joseph Brenner wrote: > > William Michels wrote: > >> > "Perhaps more importantly, what improvement do you propose?" > > > > Apologies for top-posting, but what immediately comes to my mind upon > > encountering the creation of a self-referential

Re: The ,= operator

2020-11-29 Thread Joseph Brenner
William Michels wrote: >> > "Perhaps more importantly, what improvement do you propose?" > > Apologies for top-posting, but what immediately comes to my mind upon > encountering the creation of a self-referential (circular/infinite) > object is proverbially 'going-down-a-level' and trying again.

Re: The ,= operator

2020-11-29 Thread Joseph Brenner
Joseph Brenner wrote: > Just to be clear, I wasn't saying I didn't think circular references should be forbidden, Sorry about the double-negative. It could use another "not" to triple it.

Re: The ,= operator

2020-11-29 Thread Joseph Brenner
Yes. > > Here are some relevant results from a search for "self referential" in > the #perl6 and #raku logs. Just to be clear, I wasn't saying I didn't think circular references should be forbidden, I just specifically meant that you weren't likely to want the ",=" operato

Re: The ,= operator

2020-11-29 Thread Parrot Raiser
y very desirable. It's so > much easier to teach and learn a rule like "op= has the same effect, > whatever "op" is; it takes the variable on the LHS, applies the > operator to its contents and the other value on the RHS, then puts the > result back on the LHS side. E.g.

Fwd: The ,= operator

2020-11-29 Thread Parrot Raiser
Having a consistent ("regular", in the linguistic sense), structure for something like the op= form is obviously very desirable. It's so much easier to teach and learn a rule like "op= has the same effect, whatever "op" is; it takes the variable on the LHS, applies the

Re: The ,= operator

2020-11-28 Thread William Michels via perl6-users
age/subscripts#index-entry-Zen_slices Even if the ",=" postfix operator were to gain this ability on non-hash objects, then hash-objects would be special-cased in **not** requiring a Zen-sliced decontainerized object on the LHS, so people would have to consider that outcome. Best Regards, Bill

Re: The ,= operator

2020-11-28 Thread Ralph Mellor
> > @r = @r , 'd'; > > Okay, that makes sense. So the circular reference I thought I > was seeing is really there, and it's working as designed. > > There isn't anything very useful in this behavior though, is there? Yes. Here are some relevant results from a search for "self referential" in

Re: The ,= operator

2020-11-27 Thread Joseph Brenner
About the documentation in general... > > that particular pair-input syntax is my least favorite. > > Flipping around the order of key and value when the value is a numeric...? > > > > And it isn't needed to demo the operator, any pair input syntax works. > > I mi

Re: The ,= operator

2020-11-27 Thread Joseph Brenner
First off, much thanks to Ralph Mellor for his detailed explanations. Ralph Mellor wrote: > @r ,= 'd'; > > The above expands to: > > @r = @r , 'd'; Okay, that makes sense. So the circular reference I thought I was seeing is really there, and it's working as designed. There isn't anything

Fwd: The ,= operator

2020-11-27 Thread Ralph Mellor
I accidentally sent this privately. -- Forwarded message - From: Ralph Mellor Date: Fri, Nov 27, 2020 at 6:06 PM Subject: Re: The ,= operator To: William Michels > I can reproduce your results on Rakudo_2020.10, but I'm afraid I don't > have much more to say

Re: The ,= operator

2020-11-27 Thread Ralph Mellor
; a `Scalar`. In all other cases the compiler passes *a list of values* at runtime to the receiver. What that receiver does with the list depends on the receiver's class. > that particular pair-input syntax is my least favorite. > Flipping around the order of key and value

Re: The ,= operator

2020-11-27 Thread William Michels via perl6-users
Hi Joe, I can reproduce your results on Rakudo_2020.10, but I'm afraid I don't have much more to say about the ",=" operator since I'm unfamiliar with it. Do the "docs" page(s) make more sense changing the phrase "class-dependent" behavior to "hash-dependent&qu

The ,= operator

2020-11-26 Thread Joseph Brenner
I was going through the operator list in the documentation the other day, and I noticed this one: postfix ,= Creates an object that concatenates, in a class-dependent way, the contents of the variable on the left hand side and the expression on the right hand side: my %a = :11a

Re: cross reduce operator magic

2020-10-11 Thread yary
; On Sun, Oct 11, 2020 at 5:55 PM Cezmi Pastirma > wrote: > >> Wow, that's a very comprehensive explanation. I've just found out that I >> couldn't even comprehend the first reduction operator. I was thinking it >> was doing some magic operations. All it did was enable the cross op

Re: cross reduce operator magic

2020-10-11 Thread yary
und out that I > couldn't even comprehend the first reduction operator. I was thinking it > was doing some magic operations. All it did was enable the cross op to act > on the 2 lists without having to be between them. As simple as that. And > surely I mis-took the second bracket as a second

Re: cross reduce operator magic

2020-10-11 Thread Cezmi Pastirma
Wow, that's a very comprehensive explanation. I've just found out that I couldn't even comprehend the first reduction operator. I was thinking it was doing some magic operations. All it did was enable the cross op to act on the 2 lists without having to be  between   them. As simple

Re: cross reduce operator magic

2020-10-11 Thread Joseph Brenner
ish(sort [X[&({$^a**$^b+$b**$a})]] >> 2..32,2..32) >> >> The question in short is: >> >> How does the cross reduce work there? > > The reduction is a red herring to our understanding here. > Note that, when you are only [reducing] on two lists, `[any_op_here] @a

Re: cross reduce operator magic

2020-10-11 Thread Bruce Gray
ng] on two lists, `[any_op_here] @a, @b` is the same as `@a any_op_here @b`. These are equivalent: say [X+] 2..4, 1..5; say 2..4 X+ 1..5; The operator need not be a meta-operator: say [*] 3, 5; say 3 * 5; > Extra info: > > That cross red

cross reduce operator magic

2020-10-11 Thread Cezmi Pastirma
before the cross operator, once before the & operator, which I guess donates a closure. How to interpret this usage of operators? 

Re: Learning the "ff" (flipflop) infix operator? (was Re: Raku version of "The top 10 tricks... .")

2020-08-03 Thread yary
I opened a Raku ticket https://github.com/rakudo/rakudo/issues/3839 -y On Sun, Aug 2, 2020 at 5:42 PM Eirik Berg Hanssen < eirik-berg.hans...@allverden.no> wrote: > On Sun, Aug 2, 2020 at 11:14 PM yary wrote: > >> Issue golf, ff is always evaluating its RHS >> >> $ raku -e 'say "With ff: ";say

Re: Learning the "ff" (flipflop) infix operator? (was Re: Raku version of "The top 10 tricks... .")

2020-08-02 Thread Eirik Berg Hanssen
On Sun, Aug 2, 2020 at 11:14 PM yary wrote: > Issue golf, ff is always evaluating its RHS > > $ raku -e 'say "With ff: ";say ( 1..5 ).grep({False ff .say}); say "With > fff: ";say ( 1..5 ).grep({False fff .say});' > With ff: > 1 > 2 > 3 > 4 > 5 > () > With fff: > () > I haven't looked much at

Re: Learning the "ff" (flipflop) infix operator? (was Re: Raku version of "The top 10 tricks... .")

2020-08-02 Thread yary
xt >> Start >> hi print me >> yes! >> Mark >> user@mbook:~$ raku -ne ' say $_ if ($_ eq "Start" && $++ < 1) ff ($_ eq >> "Mark" && $++ < 1);' yary_ff_example2.txt >> Start >> hi print me >> yes! >> Mark

Re: Learning the "ff" (flipflop) infix operator? (was Re: Raku version of "The top 10 tricks... .")

2020-08-02 Thread yary
++ < 1);' yary_ff_example2.txt > Start > hi print me > yes! > Mark > user@mbook:~$ raku -ne ' say $_ if ($_ eq "Start" && $++ < 2) fff ($_ eq > "Mark" && $++ < 2);' yary_ff_example2.txt > Start > hi print me > yes! > Mark

Re: Learning the "ff" (flipflop) infix operator? (was Re: Raku version of "The top 10 tricks... .")

2020-08-01 Thread William Michels via perl6-users
$ raku -ne ' say $_ if ($_ eq "Start" && $++ < 2) ff ($_ eq "Mark" && $++ < 2);' yary_ff_example2.txt Start hi print me yes! Mark Start We're back! Mark Still here! Start haha that Start does nothing going to end it now Mark !bye bye don't see me! user@mbook:~$

Re: Learning the "ff" (flipflop) infix operator? (was Re: Raku version of "The top 10 tricks... .")

2020-08-01 Thread yary
This made me want to try a contrived puzzle, use 'fff' to show things between a "start" and 2nd "mark" line. That is, print any line below not marked with "!" at the start $ cat example.txt !ignore me Start hi print me yes! Mark still print me Mark !ignore this line !this line too Start

Re: Learning the "ff" (flipflop) infix operator? (was Re: Raku version of "The top 10 tricks... .")

2020-07-28 Thread Brad Gilbert
A regex doesn't have to match the entire string. 'abcd' ~~ / bc / # 「bc」 A string has to match exactly with the smart-match. (`ff` and `fff` do smart-match) 'abcd' ~~ 'bc' # False 'abcd' ~~ 'abcd' # True A string inside of a regex only makes that a single atom, it does not make

Re: Learning the "ff" (flipflop) infix operator? (was Re: Raku version of "The top 10 tricks... .")

2020-07-28 Thread William Michels via perl6-users
Thank you, Brad and Larry, for explaining the "ff" and "fff" infix operators in Raku to me! I have to admit that I'm still fuzzy on the particulars between "ff" and "fff", since I am not familiar with the sed function. I can certainly understand how useful these functions could be to 'pull out

Re: Learning the "ff" (flipflop) infix operator? (was Re: Raku version of "The top 10 tricks... .")

2020-07-26 Thread Larry Wall
On Sat, Jul 25, 2020 at 04:32:02PM -0500, Brad Gilbert wrote: : In the above two cases ff and fff would behave identically. : : The difference shines when the beginning marker can look like the end : marker. The way I think of it is this: You come to the end of "ff" sooner, so you do the end

Re: Learning the "ff" (flipflop) infix operator? (was Re: Raku version of "The top 10 tricks... .")

2020-07-25 Thread Brad Gilbert
There's the ff operator and the fff operator. The ff operator allows both endpoints to match at the same time. The fff operator doesn't. On Sat, Jul 25, 2020 at 3:16 PM William Michels via perl6-users < perl6-us...@perl.org> wrote: > Hello, > > I'm trying to learn the "

Learning the "ff" (flipflop) infix operator? (was Re: Raku version of "The top 10 tricks... .")

2020-07-25 Thread William Michels via perl6-users
Hello, I'm trying to learn the "ff" (flipflop) infix operator, generally taking examples from the docs (below): https://docs.raku.org/routine/ff I tried adding in an "m:1st" adverb and an "m:2nd" adverb, but the output isn't what I expect with the "m:2nd"

Re: Match operator: error with any() junction and user-defined $_ topic variable

2019-10-14 Thread ToddAndMargo via perl6-users
On 10/12/19 3:08 AM, William Michels via perl6-users wrote: Inline: On Fri, Oct 11, 2019 at 8:33 PM ToddAndMargo via perl6-users wrote: On 10/11/19 8:09 PM, William Michels via perl6-users wrote: Hi Todd, Per the REPL, $x looks to be a List: mbook:~ homedir$ perl6 To exit type 'exit' or

Re: Match operator: error with any() junction and user-defined $_ topic variable

2019-10-12 Thread William Michels via perl6-users
Inline: On Fri, Oct 11, 2019 at 8:33 PM ToddAndMargo via perl6-users wrote: > > On 10/11/19 8:09 PM, William Michels via perl6-users wrote: > > Hi Todd, Per the REPL, $x looks to be a List: > > > > mbook:~ homedir$ perl6 > > To exit type 'exit' or '^D' > >> > >> my $x = (44,66) > > (44 66) > >>

Re: Match operator: error with any() junction and user-defined $_ topic variable

2019-10-11 Thread ToddAndMargo via perl6-users
On 10/11/19 8:09 PM, William Michels via perl6-users wrote: Hi Todd, Per the REPL, $x looks to be a List: mbook:~ homedir$ perl6 To exit type 'exit' or '^D' my $x = (44,66) (44 66) say $x.WHAT (List) say $x.^name List my $y = < 55 77 > (55 77) say $y.WHAT (List) say $y.^name List

Re: Match operator: error with any() junction and user-defined $_ topic variable

2019-10-11 Thread William Michels via perl6-users
Hi Todd, Per the REPL, $x looks to be a List: mbook:~ homedir$ perl6 To exit type 'exit' or '^D' > > my $x = (44,66) (44 66) > say $x.WHAT (List) > say $x.^name List > > my $y = < 55 77 > (55 77) > say $y.WHAT (List) > say $y.^name List > > say $*VM moar (2019.07.1) HTH, Bill. On Fri, Oct 11,

Re: Match operator: error with any() junction and user-defined $_ topic variable

2019-10-11 Thread ToddAndMargo via perl6-users
On 10/11/19 2:46 AM, William Michels via perl6-users wrote: Below works: mbook:~ homedir$ perl6 -e 'my $x = (44, 66); say $x; say $x.any < 43' (44 66) any(False, False) # mbook:~ homedir$ perl6 -e 'my $x = (44, 66); say $x; say $x.any < 50' (44 66) any(True, False) # mbook:~ homedir$ perl6 -e

Re: Match operator: error with any() junction and user-defined $_ topic variable

2019-10-11 Thread William Michels via perl6-users
Below works: mbook:~ homedir$ perl6 -e 'my $x = (44, 66); say $x; say $x.any < 43' (44 66) any(False, False) # mbook:~ homedir$ perl6 -e 'my $x = (44, 66); say $x; say $x.any < 50' (44 66) any(True, False) # mbook:~ homedir$ perl6 -e 'my $x=0; my $any=2|4|8; $x==$any ?? put "x exists, value= $x"

Re: Match operator: error with any() junction and user-defined $_ topic variable

2019-10-10 Thread Todd Chester via perl6-users
On 10/8/19 10:53 AM, Brad Gilbert wrote: Most operations with Junctions produce Junctions.     > 1 + any(2, 3)     any(3, 4) $ p6 'say 4 + any(44,66);' any(48, 70) Sweet! But what would you ever use it for? Would this be the intended use: add a number to all values in an array? $ p6

Re: Match operator: error with any() junction and user-defined $_ topic variable

2019-10-08 Thread William Michels via perl6-users
m/Hama/; >> 「Hama」 >> > say $_.WHAT, $/.WHAT; >> (Str)(Match) >> > if any(@genus) ~~ m/Hama/ { put "Matches at least one again"; }; >> Matches at least one again >> > say $_.WHAT, $/.WHAT; >> (Str)(Junction) >> > say m/Hama/;

Re: Match operator: error with any() junction and user-defined $_ topic variable

2019-10-08 Thread Brad Gilbert
> Matches at least one again > > say $_.WHAT, $/.WHAT; > (Str)(Junction) > > say m/Hama/; > Cannot modify an immutable Match (「Hama」) > in block at line 1 > > > say $*VM > moar (2019.07.1) > > > > I understood from the "Learning Perl 6" boo

Match operator: error with any() junction and user-defined $_ topic variable

2019-10-08 Thread William Michels via perl6-users
I understood from the "Learning Perl 6" book that the two smart-match lines of code are equivalent--the first one simply understands that there is an 'implied' any() junction to check the array against the match operator. But REPL reports back that in one case $/ returns a match object typ

[perl #131395] [BUG] Cross meta operator on empty list complains "This type (Scalar) does not support elems"

2019-05-12 Thread Jan-Olof Hendig via RT
On Sat, 30 Sep 2017 12:40:59 -0700, sml...@gmail.com wrote: > On Mon, 29 May 2017 11:36:49 -0700, c...@zoffix.com wrote: > > On Mon, 29 May 2017 10:02:27 -0700, thunderg...@comcast.net wrote: > > > Using a cross meta operator on an empty list complains "This type > >

[SPAM:##] [perl #126014] Too many repetitions with xx operator causes out of memory; should it work lazily?

2018-04-07 Thread Aleks-Daniel Jakimenko-Aleksejev via RT
Tests in https://github.com/perl6/roast/commit/b320464868d3b8da98c090ddc4b0d57604683e13 Closing On 2018-03-10 11:25:06, jan-olof.hen...@bredband.net wrote: > On Wed, 22 Feb 2017 03:59:05 -0800, elizabeth wrote: > > > On 22 Feb 2017, at 12:41, jn...@jnthn.net via RT > > follo...@perl.org> wrote:

[perl #133017] First intermediate value of reduction with zip operator

2018-03-24 Thread Aleks-Daniel Jakimenko-Aleksejev via RT
to RT#131009 ( https://rt.perl.org/Ticket/Display.html?id=131009 ) Also, FYI, we also accept bug reports on github: https://github.com/rakudo/rakudo/issues On 2018-03-23 07:16:22, wellnho...@aevum.de wrote: > When using a reduction operator with the "intermediate results" opti

[perl #133017] First intermediate value of reduction with zip operator

2018-03-23 Thread via RT
# New Ticket Created by Nick Wellnhofer # Please include the string: [perl #133017] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=133017 > When using a reduction operator with the "intermediate results" opt

[perl #126014] Too many repetitions with xx operator causes out of memory; should it work lazily?

2018-03-10 Thread Jan-Olof Hendig via RT
On Wed, 22 Feb 2017 03:59:05 -0800, elizabeth wrote: > > On 22 Feb 2017, at 12:41, jn...@jnthn.net via RT > follo...@perl.org> wrote: > > On Sat, 30 Apr 2016 03:42:00 -0700, alex.jakime...@gmail.com wrote: > >> OK, I said that it only segfaults on 32-bit systems, but I was > >> wrong. > >> > >>

[perl #126563] [BUG] 'X' meta-operator fails with RHS input from parenthesized output of another 'X'

2018-03-10 Thread Jan-Olof Hendig via RT
On Thu, 08 Mar 2018 09:52:50 -0800, jan-olof.hen...@bredband.net wrote: > On Wed, 04 Nov 2015 12:43:18 -0800, dhoek...@gmail.com wrote: > > In perl6 version 2015.10-158-gbccb16d built on MoarVM version > > 2015.10-46-g5bf7e46: > > > > Looking at the code for Hamming numbers at Rosetta Code found

[perl #114554] [BUG] Definition of zero-length postfix operator wrongly allowed in Rakudo

2018-03-09 Thread Zoffix Znet via RT
On Thu, 07 Apr 2016 10:31:20 -0700, diakopter wrote: > new behavior: > > 13:30 m: sub postfix:{}($a) { say "$a bracey brace" }; > 42{} > 13:30 rakudo-moar 61d231: OUTPUT«===SORRY!===␤Internal > error: find_var_decl could not find $_␤» Couple more glitches in the same area: 14:59 Zoffix m:

[perl #114554] [BUG] Definition of zero-length postfix operator wrongly allowed in Rakudo

2018-03-09 Thread Zoffix Znet via RT
On Thu, 07 Apr 2016 10:31:20 -0700, diakopter wrote: > new behavior: > > 13:30 m: sub postfix:{}($a) { say "$a bracey brace" }; > 42{} > 13:30 rakudo-moar 61d231: OUTPUT«===SORRY!===␤Internal > error: find_var_decl could not find $_␤» Couple more glitches in the same area: 14:59 Zoffix m:

[perl #126563] [BUG] 'X' meta-operator fails with RHS input from parenthesized output of another 'X'

2018-03-08 Thread Jan-Olof Hendig via RT
On Wed, 04 Nov 2015 12:43:18 -0800, dhoek...@gmail.com wrote: > In perl6 version 2015.10-158-gbccb16d built on MoarVM version > 2015.10-46-g5bf7e46: > > Looking at the code for Hamming numbers at Rosetta Code found this problem: > > my @z = <1 2>; > say @z X* @z X* @z;# OK > say

[perl #125618] [REGEX] Positional capture of separator on ?% operator causes compiler error

2018-02-11 Thread Aleks-Daniel Jakimenko-Aleksejev via RT
; rakudo-jvm e4077e: OUTPUT«===SORRY!===␤setcodeobj can only > > be used with a CodeRef␤» > > > > And just to show that it's not just the ?% operator alone > > contributing > > to the issue, but the capture too: > > > > m: say "ab" ~~ /^ a ?% [b]

[perl #125618] [REGEX] Positional capture of separator on ?% operator causes compiler error

2018-02-11 Thread Zoffix Znet via RT
77e: OUTPUT«===SORRY!===␤QAST::Block with > cuid cuid_1_1436969557.11546 has not appeared␤» > > On JVM: > > j: say "ab" ~~ /^ a ?% (b) $/ > rakudo-jvm e4077e: OUTPUT«===SORRY!===␤setcodeobj can only > be used with a CodeRef␤» > > And just to show that it's not just the

[perl #125618] [REGEX] Positional capture of separator on ?% operator causes compiler error

2018-02-11 Thread Zoffix Znet via RT
77e: OUTPUT«===SORRY!===␤QAST::Block with > cuid cuid_1_1436969557.11546 has not appeared␤» > > On JVM: > > j: say "ab" ~~ /^ a ?% (b) $/ > rakudo-jvm e4077e: OUTPUT«===SORRY!===␤setcodeobj can only > be used with a CodeRef␤» > > And just to show that it's not just the

[perl #132711] [LTA] Stupidly using `is assoc` with unary prefix operator has an error message from the deep

2018-01-13 Thread Zoffix Znet via RT
On Fri, 12 Jan 2018 03:50:19 -0800, c...@zoffix.com wrote: > This looks to be the same issue as RT#131099. It lists a potential fix > that fails compilation: > https://rt.perl.org/Ticket/Display.html?id=131099#txn-1455809 The fix is to throw on attempt to use list assoc on non-infixes, but

[perl #132711] [LTA] Stupidly using `is assoc` with unary prefix operator has an error message from the deep

2018-01-13 Thread Zoffix Znet via RT
On Fri, 12 Jan 2018 03:50:19 -0800, c...@zoffix.com wrote: > This looks to be the same issue as RT#131099. It lists a potential fix > that fails compilation: > https://rt.perl.org/Ticket/Display.html?id=131099#txn-1455809 The fix is to throw on attempt to use list assoc on non-infixes, but

[perl #132711] [LTA] Stupidly using `is assoc` with unary prefix operator has an error message from the deep

2018-01-12 Thread Zoffix Znet via RT
On Thu, 11 Jan 2018 23:40:54 -0800, comdog wrote: > I stupidly did this: > > sub prefix:<²> ( Int:D \m --> Int:D ) > is assoc > { m ** m } > > put ²(²2); > > And got this error: > > ===SORRY!=== > MVMArray: Can't pop from an empty array > > I figure that

[perl #132711] [LTA] Stupidly using `is assoc` with unary prefix operator has an error message from the deep

2018-01-12 Thread Zoffix Znet via RT
On Thu, 11 Jan 2018 23:40:54 -0800, comdog wrote: > I stupidly did this: > > sub prefix:<²> ( Int:D \m --> Int:D ) > is assoc > { m ** m } > > put ²(²2); > > And got this error: > > ===SORRY!=== > MVMArray: Can't pop from an empty array > > I figure that

[perl #132711] [LTA] Stupidly using `is assoc` with unary prefix operator has an error message from the deep

2018-01-11 Thread brian d foy
# New Ticket Created by "brian d foy" # Please include the string: [perl #132711] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=132711 > I stupidly did this: sub prefix:<²> ( Int:D \m --> Int:D ) is assoc

[perl #131925] [BUG] [REGEX] Smartmatch against `m//` operator mishandles junctions

2017-10-15 Thread Zoffix Znet via RT
On Fri, 18 Aug 2017 13:26:25 -0700, alex.jakime...@gmail.com wrote: > Code: > say so $*DISTRO.Str|$*KERNEL.Str ~~ /linux/ > > Result: > True > > > Code: > say so $*DISTRO.Str|$*KERNEL.Str ~~ m/linux/ > > Result: > False > > > I'd expect the result to be identical in both cases. > > IRC log:

[perl #131925] [BUG] [REGEX] Smartmatch against `m//` operator mishandles junctions

2017-10-15 Thread Zoffix Znet via RT
On Fri, 18 Aug 2017 13:26:25 -0700, alex.jakime...@gmail.com wrote: > Code: > say so $*DISTRO.Str|$*KERNEL.Str ~~ /linux/ > > Result: > True > > > Code: > say so $*DISTRO.Str|$*KERNEL.Str ~~ m/linux/ > > Result: > False > > > I'd expect the result to be identical in both cases. > > IRC log:

[perl #131395] Using a cross meta operator on an empty list complains about not supporting elems

2017-09-30 Thread Sam S. via RT
On Mon, 29 May 2017 11:36:49 -0700, c...@zoffix.com wrote: > On Mon, 29 May 2017 10:02:27 -0700, thunderg...@comcast.net wrote: > > Using a cross meta operator on an empty list complains "This type > > (Scalar) does not support elems". > > > > say (

[perl #124987] Roast rakudo skip/todo test:./S06-operator-overloading/sub.t line:268 reason: 'assoc(non)'

2017-08-28 Thread Aleks-Daniel Jakimenko-Aleksejev via RT
Unskipped in https://github.com/perl6/roast/commit/5425477851ee07c5489d4647920797fe7ae01e19

[perl #131925] [BUG] [REGEX] Smartmatch against `m//` operator mishandles junctions

2017-08-19 Thread Sam S. via RT
bisectable6: say .any ~~ m/a/; smls, On both starting points (old=2015.12 new=e3e29c5) the exit code is 0 and the output is identical as well smls, Output on both points: «False»

Re: [perl #131900] [BUG] REPL issue defining new operator with Euro symbol

2017-08-16 Thread Elizabeth Mattijsen via RT
Further datapoints: $ perl6 To exit type 'exit' or '^D' > sub postfix:<€> (Int $n) {2*$n}; say 42€ 84 > say postfix:<€> (42) 84 So, the sub *does* survive from one call to the next. It only loses the grammar adaptations that defining a sub postfix:<> do. > On 15 Aug 2017, at 21:06,

Re: [perl #131900] [BUG] REPL issue defining new operator with Euro symbol

2017-08-16 Thread Elizabeth Mattijsen
Further datapoints: $ perl6 To exit type 'exit' or '^D' > sub postfix:<€> (Int $n) {2*$n}; say 42€ 84 > say postfix:<€> (42) 84 So, the sub *does* survive from one call to the next. It only loses the grammar adaptations that defining a sub postfix:<> do. > On 15 Aug 2017, at 21:06,

Re: [perl #131900] [BUG] REPL issue defining new operator with Euro symbol

2017-08-16 Thread Patrick Tonnerre via RT
It works, thank you > Le 15 août 2017 à 21:06, Elizabeth Mattijsen via RT > a écrit : > > This appears to be forgetfulness of the REPL from one input to the next. If > you put it on the same line, it *does* work: > >> sub postfix:<€> (Int $n) {2*$n}; say 42€ >

Re: [perl #131900] [BUG] REPL issue defining new operator with Euro symbol

2017-08-16 Thread Patrick Tonnerre
It works, thank you > Le 15 août 2017 à 21:06, Elizabeth Mattijsen via RT > a écrit : > > This appears to be forgetfulness of the REPL from one input to the next. If > you put it on the same line, it *does* work: > >> sub postfix:<€> (Int $n) {2*$n}; say 42€ >

Re: [perl #131900] [BUG] REPL issue defining new operator with Euro symbol

2017-08-15 Thread Elizabeth Mattijsen via RT
This appears to be forgetfulness of the REPL from one input to the next. If you put it on the same line, it *does* work: > sub postfix:<€> (Int $n) {2*$n}; say 42€ 84 So this boils down to a much more generic issue, for which we already have tickets I believe. > On 15 Aug 2017, at 14:25,

Re: [perl #131900] [BUG] REPL issue defining new operator with Euro symbol

2017-08-15 Thread Elizabeth Mattijsen
This appears to be forgetfulness of the REPL from one input to the next. If you put it on the same line, it *does* work: > sub postfix:<€> (Int $n) {2*$n}; say 42€ 84 So this boils down to a much more generic issue, for which we already have tickets I believe. > On 15 Aug 2017, at 14:25,

[perl #131900] [BUG] REPL issue defining new operator with Euro symbol

2017-08-15 Thread via RT
# New Ticket Created by Patrick Tonnerre # Please include the string: [perl #131900] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=131900 > Hi, context is : MBP running macOS Sierra 10.12.6 RakudoStar dmg installed This is

  1   2   3   4   5   6   7   8   9   10   >