Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clojure.core guide: error in declare example? #226

Closed
jumarko opened this issue Jul 26, 2016 · 0 comments
Closed

clojure.core guide: error in declare example? #226

jumarko opened this issue Jul 26, 2016 · 0 comments

Comments

@jumarko
Copy link

jumarko commented Jul 26, 2016

The clojure.core guide demonstrates following example:

(declare func<10 func<20)

;; without declare you will receive an error similar to:
;; "Unable to resolve symbol: func10 in this context"

(defn func<10 [x]
  (cond
   (< x 10) (func10 (inc x))
   (< x 20) (func20 x)
   :else "too far!"))

(defn func<20 [x]
  (cond
   (< x 10) (func10 x)
   (< x 20) "More than 10, less than 20"
   :else "too far!"))

I guess, that func10 and func20 referenced inside the functions definitions should actually be "func<10" and "funct<20"

michaelklishin added a commit that referenced this issue Jul 26, 2016
Fix issue #226: "declare" examples in clojure.core guide
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant