Fork me on GitHub
#beginners
<
2015-12-19
>
wei00:12:24

@trancehime: I believe it’s nil

Tim21:12:09

how would I fix a function like this:

(defn list-of-values 
  [exps env]
  (loop [expressions exps environment env]
    (if (nil? expressions)
      nil
      (cons (my-eval (first expressions) environment)
            (recur (rest expressions) environment)))))
or this
(defn wow [x]
  (loop [n x]
    (if (> n 5)
      (conj n (recur (- n 1))))))

Tim21:12:32

they both give an error like can only recur from tail position or similar

frank21:12:46

you can't operate on the result of recur

frank21:12:12

the loop must be tail recursive

frank21:12:13

I think you'd need to just use plain old recursion here

Tim21:12:37

yeah that fixed it