|
|
|
|
|
by djedr
1322 days ago
|
|
The only solution to this war is no commas! To roughly translate the first example in the article (I shortened the value of `d`): svg [
x=[0px]
y=[0px]
viewBox=[0 0 21 21]
path [
fill=[#FFF]
stroke=[#146AFF]
strokeWidth=[2]
d=[M11.1,1.4l2.4,...]
]
]
You can remove all whitespace and it's still unambiguous.It's a perfectly viable lightweight syntax for SVG. See also https://news.ycombinator.com/item?id=32995047 |
|
In Elm though it would cause some ambiguity because of the function call syntax not requiring parentheses. For example:
Is this a List with three elements or is it one element whose value is a function call on foo with the arguments bar and baz? Who knows. Sure you could have implicit commas on line break but that would be weird.