[racket] Delete Second

From: Ashley Fowler (afowler2 at broncos.uncfsu.edu)
Date: Mon Sep 17 13:30:33 EDT 2012

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.yoo at gmail.com [danny.yoo at gmail.com] on behalf of Danny Yoo [dyoo at hashcollision.org]
Sent: Monday, September 17, 2012 1:22 PM
To: Ashley Fowler
Cc: users at racket-lang.org
Subject: Re: [racket] Delete Second

On Mon, Sep 17, 2012 at 11:19 AM, Ashley Fowler
<afowler2 at 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))))
;;;;;;;;;;;;;;;;;;;;;;;;;


Posted on the users mailing list.