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 ALL

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)!} >} > > However when I tried to move

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 no