Re: [racket] Delete Nth Term

2012-10-08 Thread Bloch Stephen
On Oct 7, 2012, at 10:03 PM, Ashley Fowler wrote: 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) (cd

Re: [racket] Delete Nth Term

2012-10-08 Thread Kieron Hardy
uot;cond: bad syntax (clause is not a > test-value pair) in: ls" > From: Matthias Felleisen [matth...@ccs.neu.edu] > Sent: Monday, October 08, 2012 9:51 AM > To: Ashley Fowler > Cc: users@racket-lang.org > Subject: Re: [racket] Delete Nth Term > > > 3 versions,

Re: [racket] Delete Nth Term

2012-10-08 Thread Ashley Fowler
n: ls" From: Matthias Felleisen [matth...@ccs.neu.edu] Sent: Monday, October 08, 2012 9:51 AM To: Ashley Fowler Cc: users@racket-lang.org Subject: Re: [racket] Delete Nth Term 3 versions, all pass the test suite. Now write the function pick-one-of-three : [List X X X] ->

Re: [racket] Delete Nth Term

2012-10-08 Thread Matthias Felleisen
3 versions, all pass the test suite. Now write the function pick-one-of-three : [List X X X] -> X and turn in. #lang racket (require rackunit) ;; Nat [Listof X] -> [Listof X] ;; delete the n-th item from l, if there is one (module+ test (check-equal? (deleteNth 4 '()) '()) (ch

[racket] Delete Nth Term

2012-10-07 Thread Ashley Fowler
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 '()) r