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

failure to report a function name in (+ [map]) #117

Closed elenam closed 8 years ago

elenam commented 8 years ago
(+ [map])

gives an error

In function +, the argument [anonymous-function] must be a number but is a vector,
in the function call (+ [anonymous-function])
elenam commented 8 years ago

This happens to all functions for which we have spec, but haven't overwritten the function itself.

elenam commented 8 years ago

(doc map) still has the original metadata, including the name. Need clojure.repl to use doc.

elenam commented 8 years ago

doc doesn't help since we can't get a function name from the spec object. We would need to map names to objects and do a lookup.

elenam commented 8 years ago

Also doc and source print to the console, don't return anything. Thus we can't use them to get the function name.