You're trying to do things as if it is C or C++, lisp isn't written like that.
- Code: Select all
(let*((x (read)) (y x)) ;LET for local variables, LET* is the variant where the order matters. (y is pretty pointless)
(if (eql y 1) (write "1") ;Note that print is more usually used for stuff like this.
Note that (read) tries to read from T, it needs user input!
What are you learning with? PCL
is pretty good.
As for what is wrong; DEFINE doesn't exist defaultly in CL, SETQ should only be used on already existing variables. ELSE doesn't exist either; it should be done as the second clause of IF. (Or same effect with other macros like COND, CASE etcetera.)