I had an exercise while reading 《PLP》. I suddenly thought that the various errors in elixir are provided by Parser(The SyntaxError). Is there any lexical error? Or what is something I didn’t notice?
Crazy Logs
I had an exercise while reading 《PLP》. I suddenly thought that the various errors in elixir are provided by Parser(The SyntaxError). Is there any lexical error? Or what is something I didn’t notice?
Crazy Logs
LOL, I find the compile errors in the REPL, forgive me.
Actually neither is a compile error as such. The first one IS a lexical error as <a>
is no legal syntax. The second one is legal syntax, it is a list of a list of one element, the variable a
. The error comes from when the shell REPL tries to evaluate this and finds that the variable a
has no value and there is no function a/0
. This can be a bit confusing as a
in this case can mean 2 things, either a variable or a function call.