5 ms·
Re tag inference: no I mean both start- and end-tag inference, like HTML does. It's explained in my linked paper, and it's not for "covering up design flaws". I
by tannhaeuser 10y ago
Re tag inference: no I mean both start- and end-tag inference, like HTML does. It's explained in my linked paper, and it's not for "covering up design flaws". I think you're making quite strong conclusions here considering your lack of knowledge of SGML.
- lisper 10y agoWe're talking about syntax here. Start-tag inference is not syntactic. There is no way to tell if there's a missing start tag in: <a><c></c></a> End-tag inference is semi-syntactic. You can tell that the following might have a missing end tag: <a><c></a> But the previous example definitely does not.
- tannhaeuser 10y agoSGML/HTML tag inference is guided by content model declarations, eg. <!ELEMENT html O O (head,body)> tells SGML that the html element should contain a head element, followed by a body element. "O O" (capital letter O for omission) are tag omission indicators (in this case meaning that both the start- and the end-element tags for html can be omitted). This is covered in depth in the linked paper/slides (in fact, covering JimDabell's example exactly).
- lisper 10y agoYou really don't seem to understand the difference between syntax and semantics. Syntax has to do with the rules that govern what strings of characters constitute legal programs. Semantics has to do with what strings of characters which are legal programs mean. For example, the following two documents are both syntactically correct: <!document ...> <a><c></c></a> <!document ...> <!element a O O (b,c)> <a><c></c></a> They just have different semantics. If parsed as HTML, the first produces a DOM with two nodes and the second produces a DOM with three nodes. By way of contrast, this is syntactically incorrect: <table><tr><td>data</img> So is this: <img src=x<y.html> There is no DOM that corresponds to those two examples. One of the (many) problems with SGML is that it muddies the distinction between syntax and semantics. That is one of the (many) reasons that using S-expression syntax to write SGML-like languages is advantageous.
- tannhaeuser 10y ago> You really don't seem to understand the difference between syntax and semantics. Are you talking to me? I've just pointed out how SGML works and didn't say anything about syntax/semantics.
- lisper 10y agoYes, I'm talking to you. You're right, you didn't say anything about syntax and semantics. I did. Go back to the beginning of the thread: > > If you have a good strategy for validating your template files, I'd love to hear it! > Use S-expression syntax instead of SGML syntax [emphasis added] Note the use of the word syntax. I'm talking about syntax. All of your responses have been at best irrelevant or at worst wrong because you either don't understand what syntax is, or you chose to ignore it. It's damned annoying, particularly when you start making demonstrably false claims like, "it's nowhere close to the power of SGML as a text format" (https://news.ycombinator.com/item?id=13569991 https://news.ycombinator.com/item?id=13569991).
- tannhaeuser 10y agoIf reality is so annoying to you, please refrain from (trash-)talking to me.
- lisper 10y agoReality is not annoying. Straw-man arguments are. https://en.wikipedia.org/wiki/Straw_man https://en.wikipedia.org/wiki/Straw_man
- kazinator 10y agoStart and end tag inference really means element inference. LIke, oh, here is a <p>...</p> but it's not in a <body> element; let's wrap it in one to canonicalize it. That can be done in the abstract syntax tree, rather than by literally inserting tag tokens. (I hope for the sake of SGML and HTML that you're the one confusing character level syntax with tree manipulation.)