by panzi · 3y ago · 0 comments
foo = "something to use later",
bar = { "a": 1.1, "b": 2.2 },
baz = [ 1n, 999999999999n, ],
/* comments! */
{
[foo]: `\
multiline template string
${foo}`,
...bar, /* spread! */
"baz": [ ...baz, 1234n ],
"more": my_extension("something like !foo in YAML, but just JavaScript function syntax")
}Maybe defining the format as one big comma expression [^1] and disallowing functions+eval would have it's merit... but then, what to do about circular references?
Very creative though :)
[1] So that way, the whole config would evaluate to the expression behind the last top-level comma
Thanks for your elaboration