| ||
defun(quicksort (lst)
if(lst==nil then nil
else let((pivot rest less greater)
pivot=car(lst)
rest=cdr(lst)
less='()
greater='()
if(rest!=nil
then foreach(item rest
if(item<pivot then setq(less cons(item less))
else setq(greater cons(item greater))
);if3
);foreach
else nil
);if2
append(quicksort(less) append(list(pivot) quicksort(greater)))
);let
);if1
);defun