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

Add a definition of multimap #198

Open
BurtHarris opened this issue May 7, 2018 · 12 comments
Open

Add a definition of multimap #198

BurtHarris opened this issue May 7, 2018 · 12 comments

Comments

@BurtHarris
Copy link

The INFRA spec currently has a good definition of ordered map, but its definition requires key uniqueness. Sometimes the uniqueness constraint isn't desirable. For example whatwg/fetch describes header-list as multimap, saying:

A header list is essentially a specialized multimap. An ordered list of key-value pairs with potentially duplicate keys.

I would suggest it is useful to define multimap in the general whatwg/infra spec. The language above, making multimap an ordered list of key-value pairs, seems perfectly acceptable to me.

@annevk
Copy link
Member

annevk commented May 7, 2018

It would be interesting to see if a specialized data structure would simplify defining Headers/URLSearchParams/FormData a lot. Currently they use a list underneath, which is somewhat reasonable too.

@domenic
Copy link
Member

domenic commented May 7, 2018

Headers went back to single-map, right?

@annevk
Copy link
Member

annevk commented May 7, 2018

Ah, right, Headers did, but header list cannot (due to Set-Cookie which isn't exposed through Headers).

@BurtHarris
Copy link
Author

I drafted a pull request for this, but for some reason can't get bikeshed to process it (even the online version at https://api.csswg.org/bikeshed/). The output page appears to contain the single character "#".

I"m running Windows 10, so it might be a line ending problem, anyone familiar with this?

@domenic
Copy link
Member

domenic commented May 7, 2018

I haven't had this problem myself; I also use Windows 10. But yes, please make sure you are using LF line endings; our gitattributes and editorconfig should be enforcing that.

Maybe first try compiling the spec as-is, to make sure that works?

@BurtHarris
Copy link
Author

@domenic, same result when I paste the original into https://api.csswg.org/bikeshed/ (as text.)

If I use the upload file option, I get this message:

FATAL ERROR: Found unmatched text macro [SNAPSHOT-LINK]. Correct the macro, or escape it with a leading backslash.
✘ Did not generate, due to fatal errors

@domenic
Copy link
Member

domenic commented May 7, 2018

Right, you need to set the SNAPSHOT-LINK macro, per the makefile.

@BurtHarris
Copy link
Author

BurtHarris commented May 7, 2018

Can you recommend what Make tool I should be using on Windows?

@domenic
Copy link
Member

domenic commented May 7, 2018

You'll need https://curl.haxx.se/download.html. You can either copy and paste the commands from the Makefile, or use http://gnuwin32.sourceforge.net/packages/make.htm.

(We should probably have this stuff documented in the contributing.md...)

BurtHarris pushed a commit to BurtHarris/infra that referenced this issue May 7, 2018
Adjust language in definition of ordered map.

Fixes: whatwg#198
@BurtHarris
Copy link
Author

Got it. Thanks.

@BurtHarris
Copy link
Author

Hmm, now I'm wondering if pairs is/should be a synonym for multimap.

@annevk
Copy link
Member

annevk commented May 8, 2018

For clarity, if we adopt multimap it has to simplify these standards:

I think that's all the multimaps we have in the platform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants