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

Options as "&rest" arguments #2

Closed
hanshuebner opened this issue Jul 16, 2016 · 2 comments
Closed

Options as "&rest" arguments #2

hanshuebner opened this issue Jul 16, 2016 · 2 comments
Assignees

Comments

@hanshuebner
Copy link
Contributor

I notice that you're using & {:keys [options variables types]} in some function signatures. Can you change those so that options are passed as map instead ({:keys [options variables types]}). Doing it that way makes it easier to compose functions.

@daveliepmann
Copy link
Owner

Like so?

[session module & {:keys [options variables types]}]
to
[session module & [{:keys [options variables types]}]]
?

daveliepmann added a commit that referenced this issue Jul 17, 2016
@daveliepmann daveliepmann self-assigned this Jul 17, 2016
@hanshuebner
Copy link
Contributor Author

The usual idiom would be

(defn foo
  ([session module] (foo session module {}))
  ([session module {:keys [options variables types]}] ...))

Your solution should work as well, but it seems a bit less conventional.

daveliepmann added a commit that referenced this issue Jul 17, 2016
@daveliepmann daveliepmann modified the milestone: 0.2.0 Jul 17, 2016
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

2 participants