-
Notifications
You must be signed in to change notification settings - Fork 49
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
Making exceptions for {:force-nl? true}
in maps when destructuring
#315
Comments
Interesting problem, thanks for asking! I can solve the argument vector one for you pretty simply. The left hand side of binding vectors is a lot harder. I don't see a way to do that at present, but I'll work on it some more. I want to give you what I have for argument vectors now, though, so you don't have to wait for that. Basically, you just tell zprint that when a map is inside a vector, you should have Here is how you would do this:
This fixes the argument vector. It doesn't fix the other maps in the test expression I have created. I'll work on that. If this doesn't work for you, please let me know and we'll see what we can do to fix it up. Again, thanks for asking! |
I've been thinking about how to handle the maps in Can you tell me where the maps are that you do want to have So, where, specifically, do you want to have |
Sorry for only getting back to you now. Thanks so much for all your suggestions! The maps we wanted to have The example you provided for arglists already helps a lot because this covers most of our cases! Thanks again 🙇 |
I'm still a bit confused. When you say "the ones we use as values", what specifically do you mean? That is, where are the values? Are you talking about values in |
Oh yes I phrased this weirdly. I just meant plain old maps that don't have special meaning in the syntax. We're trying to make it work for maps that are returned from functions, passed as arguments or assigned to a binding or a var and nested maps in all literal data structures too. So it'd be really all maps except those that are on the LHS in bindings or function signatures I'd say. |
In most cases I want maps to have a newline after every key value pair so I have set
{:map {:force-nl? true}}
.In my codebase I frequently have
(defn pipeline-step [{:keys [a b c] :as state}] ...)
and would like to have maps in arglists (and ideally maps on the left hand side in bindings generally) have a different configuration, i.e. leave these in one line if possible. I was not able to come up with a config that makes the relevant exception. Is this possible?The text was updated successfully, but these errors were encountered: