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

Re: Problem defining factorial operator in .rakumod file

2022-10-14 Thread Joseph Polanik
On 10/14/22 4:53 PM, Elizabeth Mattijsen wrote: raku --ll-exception -Idir-with-module Run/run_SequenceHelper.raku I hope you changed "dir-with-module" by the actual directory name. I didn't. My bad. Now, four subs are producing correct results raku --ll-exception

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

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 operator, what's wrong

Re: Problem defining factorial operator in .rakumod file

2022-10-14 Thread Joseph Polanik
On 10/14/22 4:32 AM, Elizabeth Mattijsen wrote: I cannot reproduce: % cat lib/A.rakumod sub postfix: ($n) is export { when $n == 0 {return 1} default {$n * ($n - 1)!} } % raku -e 'use lib "lib"; use A; say 42!' 14050061177528798985431426062445115699363840 Very helpful. I

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

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

Segmentation Fault

2021-08-07 Thread Joseph Polanik
I'm trying to develop classes to replace repetitive portions of an existing set of scripts. However, I'm having a problem: any class with a method seems to generate an error message: "Segmentation fault (core dumped)" whenever a script references the class. The class (.pm6) files look good to

Re: Rakudo+ versions quoted in the documentation

2020-07-08 Thread Joseph Polanik
On 7/4/20 3:07 PM, Parrot Raiser wrote: I just happened to look at the raku.org and raskudo.org download pages, and noticed that both quote 2020.01 as the most recent versions. https://rakudo.org/downloads has the 2020.06.01 binary download for linux but the Rakudo Star bundle page only