Commit 328de025 authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby 🤘🏻
Browse files

feat: Define reverse_aux in reverse function.

parent c8fb2df6
......@@ -47,12 +47,11 @@
(defn map-list [f l]
(list (map f l)))
(defn reverse_aux [l acc]
(if (empty? l)
acc
(reverse_aux (cdr! l) (cons (car! l) acc))))
(defn reverse [l]
(defn reverse_aux [l acc]
(if (empty? l)
acc
(reverse_aux (cdr! l) (cons (car! l) acc))))
(reverse_aux l []))
(defn remove-last [l]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment