[racket] Delete Nth Term
I need help with making a function that deletes the nth term from a list.(list LS with its Nth element (with indexes starting at 0) deleted)
So far I have
(define (deleteNth N ls)
(if (null? ls)
ls
(deleteNth (- N 1) (cdr ls))))
The results should be ...
(deleteNth 4 '()) returns ()
(deleteNth 0 '(a b c)) returns (b c)
(deleteNth 3 '(a b c)) returns (a b c)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20121008/b3b84b7e/attachment.html>