For example, there is such a function:

; ND Задание:« ? ?(x+y)» x=1 y=1 (defun summa(na) (if (= n 1) (sum na) ( + (sum na) (summa (- n 1) a)))) (defun sum(na) (if (= a 1) (+ na) ( + (+ na) (sum n (- a 1))))) 

What do you need to write on the command line to call for example sum (4 4)?

  • I call it this way (sum 4 4) he writes error: unbound function - SUM - AnnaHatiko
  • one
    Well Duc first you need to load the code with functions. What compiler do you use? In sbcl, for example, you can load a code and a file using (load "file.lisp") - Vladimir Gordeev
  • I didn’t know about the download, now everything is fine , thanks - AnnaHatiko

1 answer 1

(sum 4 4)

  • And it is more interesting to call (summa 4 4) - avp