[racket] Delete Second

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Mon Sep 17 12:27:18 EDT 2012

Are you saying the problem is not on-line? There must be some context. -- Matthias


On Sep 17, 2012, at 12:22 PM, Ashley Fowler wrote:

> That was the full problem. It started with #2. I'm just confused on how to start #3. I know you have to use a if expression.
> 
> 2. Write a procedure (delete-second1 LS) that takes a list LS of at 
> least two items and returns the same list only with the second item 
> deleted. You may assume the input list has at least two elements.
> 
> Tests:
> (delete-second1 '(3 7))  ==>  (3)
> (delete-second1 '(a b c d))  ==>  (a c d)
> 
> 3. Write a procedure (delete-second2 LS) that takes an arbitrary list 
> LS of items and returns the same list only with the second item deleted 
> if there is a second item, o.w. returns original input list. 
> Hint: you will need to use a conditional.
> 
> Tests:
> (delete-second2 '())  ==>  ()
> (delete-second2 '(3))  ==>  (3)
> (delete-second2 '(3 7))  ==>  (3)
> (delete-second2 '(a b c d))  ==>  (a c d)
> ________________________________________
> From: Matthias Felleisen [matthias at ccs.neu.edu]
> Sent: Monday, September 17, 2012 12:16 PM
> To: Ashley Fowler
> Cc: users at racket-lang.org
> Subject: Re: [racket] Delete Second
> 
> On Sep 17, 2012, at 12:11 PM, Ashley Fowler wrote:
> 
>> I just wanna know if I am starting the procedure out right? This is what I got so far...
>> (define delete-second2(lambda(ls)
>>              (if(>ls 1)
> 
> 
> Since you're asking a yes-no question, the answer has to be 'no'.
> 
> Can you point us to the full problem statement please? The 'tests' specification looks wrong -- Matthias
> 
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4373 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20120917/c7f09cc7/attachment-0001.p7s>

Posted on the users mailing list.