-
Notifications
You must be signed in to change notification settings - Fork 15
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
Symmetry: fn:items-at → fn:get #872
Comments
I support the renaming, but I think it's useful to be able to get multiple items. One of the reasons for having this function was that you can't do (One possibly unintended benefit of the renaming is that you don't have the problem of using a plural form (items-at) when you are only trying to get one item). |
See also issue #825, proposing |
Exactly. If we want |
I’ll create a PR for renaming
|
I had written a comment here, and then Github showed a notification, "confirm your 2FA", and then I confirmed it, and now my comment is gone before I could submit it :( 2FA makes everything unusable |
I had already proposed that in the bug tracker: https://www.w3.org/Bugs/Public/show_bug.cgi?id=29427#c1 (the bug tracker was much better to use, no 2FA there) And it got rejected for being against "policy". |
Sorry about the inconvenience of 2FA, but the vulnerabilities of open source software have become such an issue that it's hardly surprising GitHub are trying to make things more secure. Your previous 2016 comment was turned down not because it was "against policy", but because it came at the wrong time in the cycle of creating and publishing a spec. You've come up with a lot of good ideas over the years which would probably have made it into the spec if you had been a full participant in the process (knowing when and how to present a proposal that the group will be receptive to is often the key to success). Can I encourage you to join the group? We have a Zoom call for an hour once a week on Tuesdays. |
but you literally wrote "We made a policy decision a long time ago that in the interests of consistency, functions should not implicitly map over their operands. "
but now that there are implementations, one would need to change the spec and the implementations, rather than just the spec, so it is an even worse time to change the function
Tuesdays I have to attend a seminar |
@benibela Thanks as well for all your inspiring feedback. Your comments are always interesting.
Just to be sure (I was not involved in the discussion back then): I suggested here that the second parameter of Did you have the same idea, or didn't you rather propose to change the semantics of function calls on maps? |
Questions to be answered in the next meeting (or to be dropped, if it takes more than 5–10 minutes):
|
The CG decided to close this issue without further action at meeting 067. |
I think that
fn:items-at
should be changed tofn:get
:array:get
andmap:get
to retrieve single entries of the input, but we havefn:items-at
for sequences.fn:items-at
allows you to supply more than a single position, butitems-at($seq, (1, 3, 2)
can easily be rewritten to(1, 3, 2) ! get($seq, .)
– similar to(1, 3, 2) ! array:get($array, .)
and(1, 3, 2) ! map:get($map, .)
.fn:items-at
would be the only function left withitems
in its name.The function signature would be as simple as:
Obviously, most people will still use
$input[$at]
– but the same applies to arrays and maps (and other functions likefn:head
). One of the advantages offn:get
is that you can pass on the context item as position argument.The text was updated successfully, but these errors were encountered: