Clojure-Intro-Course / clojure-intro-class

NOTE: This repository is obsolete. Was: A pilot project to use Clojure for introductory computer science courses at the University of Minnesota - Morris
20 stars 3 forks source link

Handling LazySeq argument values in error reporting #37

Closed elenam closed 9 years ago

elenam commented 9 years ago

Error: In function +, the second argument clojure.lang.LazySeq@22 must be a number but is a sequence.

Caused by:

(defn add5 [input & more]
  (if more
    (+ input (map + more) 5)
    (+ input 5)))

(add5 2 3)
elenam commented 9 years ago

Need to deal with nested lazy sequences.