|
|
|
|
|
by velcrovan
150 days ago
|
|
HTML (and XMLish syntax in general) is LISP syntax (not semantics) in disguise. A tag can be viewed as function application, with the attributes as named arguments and the elements as variadic arguments. The example from the link's main page is equivalent to: (button "Say something")
(on_click
(selection-insert-after
(div "Hello, World ")))
[apparently HN strips all emoji but you get the idea] |
|
No, its not. If it was, the attribute vs. child element distinction would not exist. HTML (and HTML-inspired XML) syntax is not a trivial alternative to S-expression syntax, it is more complex with additional distinctions.
A simplified subset of (HT|X)ML that uses only elements and no attributes is pretty much directyl equivalent to S-expressions, sure.