Basically Haml then.
Produce HTML from S-Expressions
11–20 of 63 posts
Re: Produce HTML from S-Expressions
#12(h1 :disabled Hello world!) (div :class="alert" So long, and (b thanks) for all the (em fish)) I hate that syntax for attributes. :class="alert" is strictly worse than ((class . "alert")) or any other variation that actually leverages s-expressions instead of merging key and value into the same symbol. Ew. Not a fan of the bare words instead of strings either, which means this cannot be naively evaluated by a Lisp. I…
> Not a fan of the bare words instead of strings either, which means this cannot be naively evaluated by a Lisp. Most Lisps (all that I know of) have a way to convert symbols to strings. The hard part is resolving the ambiguity between what should be text, and what should be treated as an HTML node. Like, what if I wanted to actually write the string "(b thanks)" on a page? R7RS could probably do this with the pipe i…
Re: Produce HTML from S-Expressions
#13Earlier quoted context omitted.
> :class="alert" is strictly worse than ((class . "alert")) or any other variation that actually leverages s-expressions instead of merging key and value into the same symbol. Ew. I hear you, but I wasn't aiming for leveraging the power of macros. Using `((class . "alert"))` does not provide any benefits over :class="alert". > Not a fan of the bare words instead of strings either, which means this cannot be naively e…
> Using `((class . "alert"))` does not provide any benefits over :class="alert". Of course it does. It is a s-exp, like everything else in this language, so it's just another list you can map, apply or otherwise transform. The keyword approach instead requires a weird incantation of (string-trim (cadr (string-split (keyword->string :class="alert") ?=)) ?") to extract the value from the attribute. For what benefit? If…
My goal wasn't "Use s-expressions", it's "More readable and writable HTML trees."
This isn't a Lisp interpreter either, TBH. There's plenty of those around and they require the user to use a Lisp implementation, and write Lisp code.
map, string-trim, car, cadr etc are not required for s-expressions, they're required for Lisp.
Re: Produce HTML from S-Expressions
#14Earlier quoted context omitted.
> Not a fan of the bare words instead of strings either, which means this cannot be naively evaluated by a Lisp. Most Lisps (all that I know of) have a way to convert symbols to strings. The hard part is resolving the ambiguity between what should be text, and what should be treated as an HTML node. Like, what if I wanted to actually write the string "(b thanks)" on a page? R7RS could probably do this with the pipe i…
Bare words are fine until you have a variable with the same name as your bare word, so you need additional syntax to determine if you're referencing a variable, or it is just text.
This doesn't have variables. Or functions.
Re: Produce HTML from S-Expressions
#15 m("h1", {class: "title"}, "My first app")Re: Produce HTML from S-Expressions
#16(h1 :disabled Hello world!) (div :class="alert" So long, and (b thanks) for all the (em fish)) I hate that syntax for attributes. :class="alert" is strictly worse than ((class . "alert")) or any other variation that actually leverages s-expressions instead of merging key and value into the same symbol. Ew. Not a fan of the bare words instead of strings either, which means this cannot be naively evaluated by a Lisp. I…
Like this amirite https://github.com/weavejester/hiccup