#:g1: QiでL-99 (P20 指定した要素を削除)

Posted 2008-04-03 15:42:00 GMT

-(http://www.ic.unicamp.br/~meidanis/courses/mc336/2006s2/funcional/L-99_Ninety-Nine_Lisp_Problems.html)
若干ダレて来たような(;´Д`)…。

(remove-at [a b c d] 2)
\=> [a c d]
\

(define remove-at [ ] _ -> [ ] X K -> X where (>= 0 K) [H | T] 1 -> T [H | T] K -> [H | (remove-at T (- K 1))])

comments powered by Disqus