My lisp book sez something along the lines of
This works exactly as written above in CLISP.
It does not in SBCL, where the same NREVERSE
gives us '(0).
The return value is '(3 2 1 0), but that is not
enough, right? NREVERSE is supposed to be destructive,
although in such a way that the original list gets
reversed, not destroyed.
I get the style warning of "return value of NREVERSE shall not
be discarded" -- is that because NREVERSE does not work
as advertised? I edited the spots where I used NREVERSE
by (SETF X (REVERSE X)).
thx for attention
(defparameter x '(0 1 2 3))
(nreverse x)
Now x is '(3 2 1 0)This works exactly as written above in CLISP.
It does not in SBCL, where the same NREVERSE
gives us '(0).
The return value is '(3 2 1 0), but that is not
enough, right? NREVERSE is supposed to be destructive,
although in such a way that the original list gets
reversed, not destroyed.
I get the style warning of "return value of NREVERSE shall not
be discarded" -- is that because NREVERSE does not work
as advertised? I edited the spots where I used NREVERSE
by (SETF X (REVERSE X)).
thx for attention