Open pkoppstein opened 2 years ago
decimal2base
looks nice already; can you make it so that the input can be negative as well?
Now that jaq supports recursion as used in jq's def combination:
, jaq can simply include jq's defs for combinations/0
and combinations/1
.
Here is a jaq-defined definition of combinations/1 with the same semantics as jq's combinations/1. It seems to me that the helper functions, namely decimal2base/1 and combinations/2, are both independently worthy of inclusion in the jaq library (and could in fact also be included in the jq library in the sense that they behave in the same way when run using jq), so I have not folded them into the def of combinations/1.
Example:
["a", "b"] | combinations(3)