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

function return value with recur doesn't work properly #113

Closed
borkdude opened this issue Oct 16, 2019 · 0 comments
Closed

function return value with recur doesn't work properly #113

borkdude opened this issue Oct 16, 2019 · 0 comments

Comments

@borkdude
Copy link
Collaborator

Example:

(def f (sci/eval-string "(fn [coll n] (if (zero? n) (first coll) (recur (rest coll) (dec n))))" {:deny '[nth]}))

(f '(1 2 3) 1)
((2 3) 0)

Workaround: use a name and use the name instead of recur.

Possible solution: maybe it's possible to do the recur check inside the function body?

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