Closed annevk closed 9 years ago
If we need in the future to add such an API, we can address it them. Meanwhile:
http://c2.com/cgi/wiki?DoTheSimplestThingThatCouldPossiblyWork http://en.wikipedia.org/wiki/You_aren%27t_gonna_need_it
You can't both define host as several different things while it's actually always a string. And I'm pretty sure we want to be able to distinguish between it being different things. And we want to operate on components of a domain.
Yet we can for URL? https://www.w3.org/Bugs/Public/show_bug.cgi?id=26405#c1 :-)
If/when there is demonstrable implementor interest in operating on components of a domain, it can be added at that time.
There is, look at e.g. the grammar for CSP, wildcard certificates, cookies, definition of public suffix... We need to provide the primitives so they can all be written on top.
(Note that having one term mean different things depending on context is not quite the same. And I think that's probably no longer a good idea, given that people keep seeing that as a problem.)
I don't understand why the IPv4 bit of the parser for instance returns a string rather than the underlying representation. The same goes for many other parts of the parser.
That does not seem useful going forward if we ever want to introduce APIs that return things closer to the metal.