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?
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
© 2022 - 2024 — McMap. All rights reserved.