LISPのリストの挿入に関するコードがあります。私はHELP挿入一般的なリストの並び替え
(defun insertionSort (myList)
(if (null myList)
'()
(insertInPlace (car myList) (insertionSort (cdr myList)))))
enter code her
(defun insertInPlace (e myList)
(if (null myList)
(cons e '())
(if (<= e (car myList))
(cons e myList)
(cons (car myList) (insertInPlace e (cdr myList))))))
(setq n (read))
(setq n (- n 1))
(setq d (read))
(setq myList (list d))
(dotimes (i n)
(setq d (read))
(setq myList (cons d myList))
)
(write myList)
(insertionSort(myList))
をあなたはそれがdoesnの「とはどういう意味ですかやってない?どのようなエラーが出ますか? "enter code her"とは何ですか?なぜ 'myList'を引数なしの関数として' insertionSort'に渡すのですか? – Rptx