I've written a very simple program:
(define size 2)
(print size)
When I run this code, I get following error:
*** - EVAL: undefined function DEFINE
What does the error mean? How can I resolve it?
define
is not a part of the ANSI Common Lisp language which is implemented by GNU CLISP (I think you are confusing CL with Scheme).
When defining a variable, use defvar
,
for a function use defun
.
You might want to get a book, e.g., ANSI Common Lisp.
define in the Scheme programming language means defining a variable or a function, defvar or defparameter in the Common Lisp programming language (which is what CLISP implements, and which is different from Scheme) means defining a variable. defun in Common Lisp means defining a function.
CL-USER 195 > (defparameter size 2)
SIZE
CL-USER 196 > (print size)
2
2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With