arturo
arturo copied to clipboard
[Collections\combine] should follow the rule: C[n:k] = 0, for k > n
[Collections\combine] should follow the rule: C[n:k] = 0, for k > n being k the attribute by, n the size of the collection and C the amount of possible combinations:
ensure -> empty? combine.by: 4 [a b c]
ensure -> empty? combine.by: 5 [a b c]
ensure -> empty? combine.by: 6 [a b c]
https://github.com/arturo-lang/arturo/blob/7f17d55ea05563a979e16407763df4bbe4c84f8c/src/library/Collections.nim#L305
# TODO(Collections\combine) should also work with in-place Literals?
# labels: library, enhancement, open discussion
# TODO(Collections\combine) should follow the rule: C[n:k] = 0, for k > n
# being k the attribute by, n the size of the collection and
# C the amount of possible combinations:
#
# ```art
# ensure -> empty? combine.by: 4 [a b c]
# ensure -> empty? combine.by: 5 [a b c]
# ensure -> empty? combine.by: 6 [a b c]
# ```
# labels: library, open-discussion
builtin "combine",
alias = unaliased,
op = opNop,
ndex b034d7e282..de0238fc99 100644
++ b/src/library/Comparison.nim
80f39a47d62f96ec111e3e0307355f88c2d8afb3