Cartesian product in Scheme
- by John Retallack
I've been trying to do a function that returns the Cartesian Product of n sets,in Dr Scheme,the sets are given as a list of lists,I've been stuck at this all day,I would like a few guidelines as where to start,I've wrote a pice of code but it dosen't work.
(define cart-n(?(l)
(if (null? l) '(())
(map
(?(lst) (cons (car ( car(l))) lst))
(cart-n (cdr l) )))))