As the title says, is there a place where I can find an exaustive list of the symbols that are
admissible (that is they lead to valid code upon evaluation) as Expr.head values? I was looking at the following https://docs.julialang.org/en/v1/devdocs/ast/#Surface-syntax-AST-1, which list some of theme is sparse order: how can I be sure that there are not any others?
My aim is to automatically decide whether or not the head of an Expr should be
Symbol call, as in
Expr(:call, :foo) Expr(:call, :(==), :a, :b)
as opposed to
Expr(:+=, :x, 2)
By the way, should I trust the fact the exposed julia AST won’t change in any radical way? I ask this because by taking advantage of this fact I wrote a very tiny (21 lines, comprising boilerplate to handle common lisp strings) common lisp function that parse a common lisp list representing julia AST into a julia Expr: calling julia’s
eval twice let me execute julia code written in s-expression syntax, inside common lisp. Of course this cannot be more that a toy if I cannot rely upon the julia AST not to change drastically.
In this context, my initial question stem from the next step I wish to take, which is to get closer to lisp syntax by getting rid of the need of writing
call everywere, as in
(call foo (if (call == 1 2) (call bar 1 2) (call zot 3 4)))
to get to a nicer
(foo (if (== 1 2) (bar 1 2) (zot 3 4)))
Thank you in advance.