Is it change in interpreter or specifically in functions sort or pop?
It is both, changes in newLISP's core routines processing expressions and changes in built-in functions. Its a type of optimization of ORO memory management, before made only for set, but now available system wide.
All built-in functions when returning lists or arrays bound to symbols or part of those lists or arrays, now return references instead of copies.
This affects the following functions:
assoc
first
last
lookup
nth
replace
reverse
rotate
set (returned reference already)
setf (new function)
setq (old function now working like setf)
set-ref
set-ref-all
sort
swap
and this also effect all control structures, which don't maintain local variables:
begin
if
if-not
cond
case
when
unless
while
until
do-while
do-until
this means you cannot use 'begin' any more to make destructive function non-destructive, you will now use something like (define (copy x) x) and then do: (sort (copy mylist)) to make the sort non-destructive.
Reference-returns together with the new 'setf' make it convenient to change lists and arrays:
(set 'lst '(a b c d))
(setf (last lst) 99)
lst => (a b c 99)
The normal old 'set' has not changed (it always returned a reference, but nobody was aware of it). 'setq' now points to 'setf' internally. I opted to keep both functions, to make it easier for converts from other Lisps. Many have 'setq' and 'setf' and want to keep on using them as they did before. It also improves readability and understandability of code having both.
Version 9.9.2 (a precursor to newLISP v.10.0) is ready, but I am still working on documentation changes. This version will be posted latest on Monday, perhaps earlier.
Although most old code is compatible with the new generation of newLISP, I opted of jumping from version 9 to 10, because the changes mark a new style of programming in newLISP which is closer to other programming languages and more intuitive.
As before user defined lambda function will return copies and copy parameters (except when using default functors).