Re:Eslisp – An S-expression syntax for ECMAScript/JavaScript...
by asynchrony on Tuesday October 27, 2020 @06:27PM
(#24912760)
How does it handle symbols that aren't legal javascript identifiers? Is that on the user or are the some safety conventions in place in the compiler?
[ Parent
| on HN ]
Re:Eslisp – An S-expression syntax for ECMAScript/JavaScript...
by an_ko on Wednesday October 28, 2020 @06:40AM
(#24917254)
During compile-time, it doesn't care. So you can use "illegal" characters for the names of macros.
(macro what? (function () (return '(a b c))))
(what?)
That compiles just fine to the JavaScript code a(b, c);
It does try to validate identifier names during code generation though (using the esvalid module), so if you give it (? 1 2)
then it will error with [Error] Identifier `name` member must be a valid IdentifierName
At line 1, offset 1:
(? 1 2)
(In a terminal, the offending character is highlighted.)