-
Notifications
You must be signed in to change notification settings - Fork 83
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
foreach #51
Comments
After reflection, I agree with you.
I like your idea of having
Thank you! I already have some plans for the next release (no breaking changes planned this time ^^). |
@01mf02 - Fantastic! Thanks for the update, and thanks for being willing to reconsider. |
@01mf02 - Your most recent comment in this thread suggested you intended to support To be clear, in jq:
The reason foreach/3 is very helpful is of course that the iteration
###################################
|
Sorry for the misunderstanding --- indeed, I only wanted to suggest that I wanted to support some subset of Also, I think it is that
So here, In conclusion, I believe that the slightly shorter |
There is a large corpus at rosettacode.org: https://rosettacode.org/wiki/Category:Jq Currently there are 926 worked examples. Unfortunately I can’t easily quantify how often the “special case” is used, but the genius of jq’s foreach/3 is indeed that it is not trivially reducible, and indeed the reason I’ve brought up the issue is that I have found it useful (and “essential” to avoid the circumlocution). Because of this and the issue of compatibility with jq/gojq (and earlier versions of jaq), I hope you will further reconsider, but in any case, thanks again for taking the time to reflect and explain. |
I was reading the release notes for 0.9.0 and was quite disappointed to read about some of the changes affecting
foreach
in the BREAKING CHANGE notes.Obviously breaking changes can often be justified, and discrepancies from jq are to be expected, but some of the changes affecting
foreach
are, it seems to me, very hard to justify given (a) their utility,(b) the ordinary meaning of "for each" in English.; and (c) the fact that gojq also conforms with the jq semantics.Since 0.9.0 < 1.0, I am hoping that you will reconsider at least some aspects of
foreach
, e.g. its name.For example, since you evidently feel strongly about the
init
value being emitted, one possibility would be for jaq to have the control structure you want under a different name. Let's suppose it was namedfor
. Then (ideally perhaps) we could have our cake and eat it (i.e. havefor
andforeach
), but if you do not wish to have both, then having your control structure asfor
would at least help avoid confusion.By the way, congratulations on all the improvements in 0.9.0!
The text was updated successfully, but these errors were encountered: