Hello,

I have a task to write a function which prints a cartesian product of a single linked list.

This is what my lecturer gave us and it works perfectly,but I just don't understand how they work. More specifically I can't figure out (func (:data node)) this line. I know that it gives us data of the node but what is func doing?

The slist-cartesian function is totally confusing for me.

Please explain to me how they work.

Thank you!

(defn slist-iter [lst func]

(loop [node (deref (:head lst))]

```
(if (not (nil? node))
(do
(func (:data node))
(recur (deref (:next node)))))))
```

(defn slist-cartesian [lst]

(slist-iter

lst

(fn [x]

```
(slist-iter
lst
(fn [y]
(println x y))))))
```