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

add pre-conds and arities for assoc, dissoc #57

Closed elenam closed 9 years ago

elenam commented 9 years ago

Need to allow a nil argument: (assoc nil :key1 "val1" :key2) should work.

elenam commented 9 years ago

Also need to fix assoc on vectors: (assoc [1 2 3] 0 10) should work, (assoc [1 2 3] 10 10) should give an index out of bounds exception, but both give a ClassCast Exception: Attempted to use a function, but a map or a vector was expected.