by dragonwriter · 10mo ago · 0 comments
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.
Add one more type, like a map, now you have attributes
(fn btn ()
(div
{onClick (fn ())}
"Click me")) (parrot (@ (type "African Grey")) (name "Alfie"))
Becomes: <parrot type="African Grey"><name>Alfie</name></parrot>
https://www.gnu.org/software/guile/manual/html_node/SXML.htm...For example, in elixir parsing html is this syntax: `{html_tag, attributes, children}`.
You indeed can include attributes in s expression