-1

I just want to omit first value of list using a function but below code is returning same list
I dont want to return from a fucntion Code:

 #! /usr/bin/clisp    

(defun omit(lstold)
    (setf lstold (cdr lstold))
)
(setq x (list 3 1 2))
(omit x)
(write x)  --> gives output 3 1 2 ... why?
ojas
  • 2,150
  • 5
  • 22
  • 37

1 Answers1

0

That's because you didn't modify your x, but you just modified your local lstold, and you returned it to nowhere (i.e. didn't capture returned value).

sheikh_anton
  • 3,422
  • 2
  • 15
  • 23