by ofalkaed · 2y ago · 0 comments
Edit: What I am saying is that in lisp '(' is actually a command and everything after it is an argument to that command. The syntax is command - arguments; this is what gives these languages their power, the simple syntax and lack of grammar allows us to define our own grammar. Hopefully someone will correct me if I misunderstand, I could be seeing Tcl and Forth everywhere since I have been primarily working with them lately.
More info: https://gist.github.com/chaitanyagupta/9324402
This one demonstrates how what's read in can be parsed - sort of a "Lisp in Lisp" version of eval: https://stevelosh.com/blog/2016/06/symbolic-computation/#s11...
With this way of viewing things your "( is actually a command" no longer is useful/ no longer makes sense. (I wouldn't say you're completely wrong, though, just that another view of things seems simpler to me.)
You could probably implement a Lisp with a scanner and a parser but things are a lot easier if you follow the traditional read-eval route (or preferably read-macroexpand-eval).