-
Notifications
You must be signed in to change notification settings - Fork 514
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
Adding make-style multivalue assignments #1908
Conversation
This makes single key-value assignments special case of multivalue list assignments.
Is this doing too much?
Thanks for the PR! I might be missing something, but I don't think that this buys us very much. It's essentially a shortcut for creating space-separated variables. As is, I don't think it's very useful, and would much prefer using #11 to do that. |
The main issue is that if we add:
But all it's really doing is:
Then it's not very useful. My point about formatting strings is that if the user wants a space-separated list, they could do:
Which seems nicer than extending the grammar. I think that when people want lists of things, the thing that makes them useful is the ability to access elements of the list, modify the list, and perform other operations on the list:
The issue with that, however, is that in order to figure out if #11 is an issue for allowing interpolation inside of strings, so you could do something like |
I understand. I can't tackle it right now, however; instead, I'll work on adding more convenience functions from make. Are cool with that? |
Of course! If there's something you want to add, open an issue first to discuss the feature and design, so we can make sure it's something that'll get merged. |
This PR adds support for one of the iconic features of Makefiles: multivalued assignments, where a single variable holds a list of values separated by whitespace.
The trick is to make
key := value
a special case ofkey := value1 value2 ...
, which is the easiest way out.This PR hopefully enables new use cases for Just.
EDIT:
Broken tests are now passing.
A follow-up PR will enable Just functions to operate on multivalued variables and add more Just functions that work on multivalued variables. Another one will make variables modifiable with
+=
syntax (or something similar).Closes #1889