Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- proto ndr(Any, Int:D $radix where $radix>0=10) {*};
- multi ndr(@vals where so all(@vals) >>~~>> Int, Int $radix) {
- 1+floor log (1 max [max] @vals>>.abs), $radix
- };
- multi ndr(Int:D $val, Int $radix) {
- ndr [$val], $radix
- };
- say ndr(257,16);
- # This works fine. Now, how do I allow the proto to
- # govern subs with any number of positional parameters
- # preceding the Int $radix ?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement