Ashley,
I think you're making this more difficult than it needs to be.

-Greg

-----Original Message-----
From: users-boun...@racket-lang.org [mailto:users-boun...@racket-lang.org] On 
Behalf Of Ashley Fowler
Sent: Monday, September 17, 2012 2:46 PM
To: David Van Horn
Cc: users@racket-lang.org
Subject: Re: [racket] Delete Second

Well i got 




(list(car'(())) ===> (())
(list(car'(3))) ===> (3)




Are you saying I need to change (list(car ls)) ?

________________________________________
From: David Van Horn [dvanh...@ccs.neu.edu]
Sent: Monday, September 17, 2012 3:37 PM
To: Ashley Fowler
Cc: Danny Yoo; users@racket-lang.org
Subject: Re: [racket] Delete Second

On 9/17/12 3:30 PM, Ashley Fowler wrote:
> Disregard the last message with the questions, I get what your saying now. I 
> had to switch the sign.
>
> (define delete-second2
>      (lambda(ls)
>        (if(> (length ls) 1) (append(list(car ls))(cdr(cdr ls)))
>           (list(car ls)))))
>
> Only problem I got now is the first test still doesn't work.

>> (delete-second2 '())  ==>  ()
>> (delete-second2 '(3))  ==>  (3)

There's a striking relationship between what comes in and what goes out in 
these two examples.  What is that relationship?  Do other examples of this 
length exhibit the same relationship?

How is that relationship different from what (list (car ls)) computes?

David






____________________
  Racket Users list:
  http://lists.racket-lang.org/users

____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Reply via email to