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

Handle invalid token exceptions #46

Closed elenam closed 9 years ago

elenam commented 9 years ago

(/string ...) and (clojure.string/ ...) are the cases I know. There may be more.

leek5pin commented 9 years ago

(map #: [1 2 3]) Error: java.lang.RuntimeException: Invalid token: : Found in file may2015.clj on line 18 at character 9. intro.core/-main (core.clj line 114)

leek5pin commented 9 years ago

(map : [1 2 3]) Syntax error: Invalid token: : Found in file may2015.clj on line 18 at character 7. intro.core/-main (core.clj line 114)

(map :[1 2 3] [1 2 3]) Syntax error: Invalid token: : Found in file may2015.clj on line 18 at character 7. intro.core/-main (core.clj line 114)

leek5pin commented 9 years ago

(defn # :) Error: java.lang.RuntimeException: Invalid token: : Found in file may2015.clj on line 21 at character 10. intro.core/-main (core.clj line 114)

elenam commented 9 years ago

Suggested wording: You cannot use : in this position.

elenam commented 9 years ago

Can we make the error message on /string to be "You cannot use / in this position"?

leek5pin commented 9 years ago

I think I found a new somewhat related error? (map #/ [1 2 3])

Syntax error: No reader function for tag / Found in file may2015.clj on line 19 at character 16. intro.core/-main (core.clj line 114)

leek5pin commented 9 years ago

I made the fix you asked, and the tests are passing.