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

Fix call in map #24

Closed
Azer0s opened this issue Oct 1, 2020 · 1 comment
Closed

Fix call in map #24

Azer0s opened this issue Oct 1, 2020 · 1 comment
Assignees

Comments

@Azer0s
Copy link
Owner

Azer0s commented Oct 1, 2020

This doesn't work, yet it should.

(def func (fn x (/ x 2)))
(map (.. 0 10) (fn x (' x (func x))))

I'd tap into doCall and make the call to the native map implementation myself to debug this. Probably something with context not set correctly.

@Azer0s Azer0s self-assigned this Oct 1, 2020
@Azer0s
Copy link
Owner Author

Azer0s commented Oct 1, 2020

Alright...this happened because the parameter for map is also called func. At the time of calling, func from map is shadowed and assigned to (fn x (' x (func x))) which is recursive. This is intended behaviour. I would fix this by prefixing stdlib parameters with _.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant