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

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
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-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"? On 10/14/22, Elizabeth

Re: Problem defining factorial operator in .rakumod file

2022-10-14 Thread Elizabeth Mattijsen
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 % raku -v Welcome to Rakudo™ v2022.07-64-gce1af0fa0. Implementing the