glycerine / zygomys

Zygo is a Lisp interpreter written in 100% Go. Central use case: dynamically compose Go struct trees in a zygo script, then invoke compiled Go functions on those trees. Makes Go reflection easy.
https://github.com/glycerine/zygomys/wiki
BSD 2-Clause "Simplified" License
1.71k stars 81 forks source link

Error message that could have been better #37

Closed jkleiser closed 5 years ago

jkleiser commented 5 years ago

If I type (foo), I get this message:

error in evalGeneratedFunction:0: Error calling 'infix': symbol `foo` not found
in infix:0
in __main:34

This is not a very "friendly" error message. Why all the mention of "infix"? The main message here should be "symbol 'foo' not defined".

jkleiser commented 5 years ago

I see this mention of "infix" occurs in other error messages too, e.g. this:

error in aset:-1: Error calling 'infix': Error calling 'aset': Array index out of bounds

Maybe the "infix" function could have another name?

glycerine commented 5 years ago

The message is apt, as the infix parser is the active one.