4 ms·
> Do you prefer to write HTML documents as S-expressions? Actually, yes. I use CL-WHO[1] a lot, in which one can write: (:html (:head (:title
by wtbob 10y ago
> Do you prefer to write HTML documents as S-expressions?
Actually, yes. I use CL-WHO[1] a lot, in which one can write:
(:html
(:head
(:title "Foo bar")
(:link :rel "stylesheet" :href="baz.css"))
(:body
(:p "Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Vestibulum ullamcorper efficitur purus, at suscipit nunc luctus vitae.")
(:ol
(:li "Cras vel est accumsan, malesuada leo eu, iaculis nulla.")
(:li "Proin nec mi feugiat, posuere enim in, vehicula erat.")
(:li "Morbi vitae purus nec neque posuere pharetra ultricies in nibh.")
(:li "Nam maximus lectus faucibus, ullamcorper lectus aliquam, aliquam lectus."))))
Which I contend is prettier than the equivalent HTML.
[1] http://weitz.de/cl-who/ http://weitz.de/cl-who/
- mbrock 10y agoI like S-expressions too, especially when generating markup programmatically. For hand-writing HTML/XML documents, which I do quite a lot, I really enjoy the tag style because of the verbose end tags and the ease of moving blocks. It's at least nice enough to make me annoyed when people claim the tag syntax is some horrible stupid disaster compared to S-expressions or (worse) JSON.
- wtbob 10y ago> For hand-writing HTML/XML documents, which I do quite a lot, I really enjoy the tag style because of the verbose end tags and the ease of moving blocks. I can't say anything about liking verbose tags, which seems to me a matter of taste, but moving around S-expression blocks is easy: C-SPC to set the point, M-C-f to move forward one S-expression, C-w to cut the current region, navigate to where one wants it, C-y to yank the cut region. Granted, this is using emacs, which really had better have good S-expression-editing capabilities after 40 years!
- mbrock 10y agoI also quite like Dylan's way of ending blocks, letting you type for example "end method do-stuff" so you can see clearly what's being ended, which is useful in a document with long sections. And I like that XML block moving is even manageable with ed, which I actually use sometimes. Well, and vi.