I was just showing my first part lol...but here goes the rest of i below (define delete-second1(lambda(ls) (if(< (length ls) 1) (append(list(car ls))(cdr(cdr ls)) list(car ls)))))) ________________________________________ From: danny....@gmail.com [danny....@gmail.com] on behalf of Danny Yoo [d...@hashcollision.org] Sent: Monday, September 17, 2012 1:22 PM To: Ashley Fowler Cc: users@racket-lang.org Subject: Re: [racket] Delete Second
On Mon, Sep 17, 2012 at 11:19 AM, Ashley Fowler <afowl...@broncos.uncfsu.edu> wrote: > Yeah I got a error. > > This is what I got so far though. > > (if(< (length ls) 1)(append(list(car ls))(cdr(cdr ls))) I can't read this one-liner. I can't count parens. :) Let me break it down into a few lines: ;;;;;;;;;;;;;;;;;;;;;;;; (if (< (length ls) 1) (append (list (car ls)) (cdr (cdr ls)))) ;;;;;;;;;;;;;;;;;;;;;;;;; >From a glance, this does not look right because an 'if' needs to say what it will compute when the test fails, and your expression doesn't provide the "what to when the test is false" part. ____________________ Racket Users list: http://lists.racket-lang.org/users