3 ms·
At least in Julia, which is a Lisp-inspired language without s-expressions, what you have is a dual representation for all code [1] in which you can manipulate
by ddragon 7y ago
At least in Julia, which is a Lisp-inspired language without s-expressions, what you have is a dual representation for all code [1] in which you can manipulate either directly on the normal infix notation with quote and unquote, which is good for code injection [2], or in the s-expression-like representation (Surface syntax AST) [3] in which you have the full control over the structure but you have to deal with a different syntax. Using the s-expression-like is more powerful, but for the function user it doesn't really matter which you use.
[1] https://docs.julialang.org/en/v1/manual/metaprogramming/index.html#Expressions-and-evaluation-1 https://docs.julialang.org/en/v1/manual/metaprogramming/inde...
[2] https://docs.julialang.org/en/v1/manual/metaprogramming/index.html#Code-Generation-1 https://docs.julialang.org/en/v1/manual/metaprogramming/inde...
[3] https://docs.julialang.org/en/v1/devdocs/ast/#Surface-syntax-AST-1 https://docs.julialang.org/en/v1/devdocs/ast/#Surface-syntax...