Hello,
I tried to write a little storting program, but I make a mistake in calling the function "sort-insert". Can anybody tell me my mistake?
I tried to write a little storting program, but I make a mistake in calling the function "sort-insert". Can anybody tell me my mistake?
(setq test-list (list 3 5 1 2 9 4 7 8 6))
(defun sort-list(ulist)
(let ((nlist (list)))
(dolist (x ulist)
(setq nlist `(sort-insert ,x ,nlist))
)
(setq ulist nlist)
)
ulist
)
(defun sort-insert(element liste)
(let ((blist (list)) (filled 0))
(dolist (x liste)
(when (and (> x element) (= filled 0))
(setq blist `(,@blist ,element))
(setq filled 1)
)
(setq blist `(,@blist ,x))
)
(print blist)
(setq liste blist)
)
liste
)
Thanks in advance!"Wenn du nicht irrst, kommst du nicht zu Verstand! Willst du entstehn, entsteh auf eigne Hand!" » FAUST II «
-----
http://www.faustas.de
http://www.makeaims.com
http://www.nebelklar.de
-----
http://www.faustas.de
http://www.makeaims.com
http://www.nebelklar.de