Anonymous user
Cartesian product of two or more lists: Difference between revisions
Cartesian product of two or more lists (view source)
Revision as of 21:34, 19 January 2021
, 3 years ago\ replaced with lambdas
(Added scheme) |
m (\ replaced with lambdas) |
||
Line 3,483:
(if (or (zero? (length xs)) (zero? (length ys)))
'()
(fold append (map (
(define nary-cartesian-product (
(if (fold (
'()
(map flatten (fold cartesian-product ls)))))
|