Closed tshort closed 6 years ago
I appreciate the sentiment, but I really like the fact that Hyperscript is such a consistent mapping of Julia syntax to HTML (positional arguments are content; keyword arguments are attributes) and think it is a valuable property worth preserving.
The problem is real, though. One angle of approach that I've been thinking about is to define a higher-level syntax for more concise HTML specification, similar to Jade. You could imagine a string macro with roughly this syntax mapping onto a Hyperscript DOM tree, which would give you a clean way to express all attributes without worrying about colliding with Julia keywords.
This works:
This doesn't:
In the last one, it's treating the Pair as content. It'd be nice to support the second one. If it's only allowed after a semicolon, then if you use it with a node with content, it's even clunkier because the optional arguments have to come at the end:
I think it's pretty safe to intercept
Pair{Symbol, T}
and treat it as an argument. I can't think of a use where someone wants to fill in content with that.