Re: [whatwg/url] Editorial: fold cannot-be-base-URL into path (#655)

@alwinb commented on this pull request.



>  
-<p class="note no-backref">A <a lt="is special">special</a> <a for=/>URL</a> always has a
-<a for=list lt="is empty">non-empty</a> <a for=url>path</a>.
+<p class=note>A <a lt="is special">special</a> <a for=/>URL</a> always has a

> Generally the model is a consequence of the parser

I thought this was where you're coming from, and why I'm curious about the views of others. 
It is a just different perspective on the same thing. I can try to explain. 

Instead of seeing it as a consequence of the parser, you can make it part of the definition. 
So in this case, in the definition, you would _enforce_ that if the scheme is special, then the path is a list. A record that violates that requirement then is not an URL record. 

Then it still is a consequence of the parser, but it must be, otherwise the parser could possibly return a record that is not an URL record. 

It is a fairly common way of defining more complex data structures. And it is is indeed a way to ensure the following. 

> if someone were to construct a URL directly (in a specification) we wouldn't want them to construct something the parser couldn't construct.

Anyway, curious what others think. 


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/url/pull/655#discussion_r724815708

Received on Friday, 8 October 2021 08:39:02 UTC