Created
November 5, 2012 21:43
-
-
Save cjfrisz/4020522 to your computer and use it in GitHub Desktop.
Recur effectively disallowed as local function binding
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Does this bother anybody else? | |
((fn [x] (let [recur (dec x)] (if (zero? x) 42 (recur recur)))) 5) | |
;;=> 42 | |
;; Similarly | |
((fn [x] (let [recur (fn [y] 350)] (if (zero? x) 42 (recur (dec x))))) 5) | |
;;=> 42 | |
;; Apparently 'recur' in function position *always* refers to the 'recur' special form | |
;; Doesn't seem that the identifier can be rebound |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes.