in reply to Something that bugs me about the Numeric class hierarchy in Perl 6
Removing the list product from your function to see the list of computed values:
sub infix:<list_vals> { ($^n ... 0) Z/ 1 .. $^p } say 10 list_vals 3; # -> (10 4.5 2.666667) sub infix:<choose> { [*] ($^n ... 0) Z/ 1 .. $^p } say 10 choose 3; # -> 120 (rat)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Something that bugs me about the Numeric class hierarchy in Perl 6
by grondilu (Friar) on Nov 27, 2015 at 10:36 UTC | |
by Ovid (Cardinal) on Jan 08, 2016 at 10:10 UTC |