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

Inconsistent argument bracketing between for, lfor, and loop #1941

Closed
peaceamongworlds opened this issue Jan 22, 2021 · 2 comments
Closed

Inconsistent argument bracketing between for, lfor, and loop #1941

peaceamongworlds opened this issue Jan 22, 2021 · 2 comments

Comments

@peaceamongworlds
Copy link
Contributor

lfor, and the other list comprehensions, take arguments as just consecutive forms, not in a list.

(lfor i (range 5) i)

for takes arguments with the same syntax as lfor, but in a list, same as with and let.

(for [i (range 5)] i)

loop takes a list of lists as arguments.

(loop [[i n] [acc 1]]
    (if (zero? i)
      acc
      (recur (dec i) (* acc i))))

Would it not make sense to make all of these consistent between themselves? I think that the best option would be to make all forms that require args to take a single even-length list like for.

@Kodiologist
Copy link
Member

Duplicate of #1723.

@Kodiologist
Copy link
Member

You can add a comment there about loop if you want, but see the discussion.

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

2 participants