On 9/17/12 3:46 PM, Ashley Fowler wrote:
Well i got
(list(car'(())) ===> (())
(list(car'(3))) ===> (3)
You changed the first example. If you plug in '() for ls you should get to:
(list (car '()))
What's the next step?
Are you saying I need to change (list(car ls)) ?
First, you should
g.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
oo; 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
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 n
7;t work.
From: danny@gmail.com [danny@gmail.com] on behalf of Danny Yoo
[d...@hashcollision.org]
Sent: Monday, September 17, 2012 3:18 PM
To: Ashley Fowler
Cc: users@racket-lang.org
Subject: Re: [racket] Delete Second
On Mon, Sep 17, 2012 at 12:54 PM
On 9/17/12 2:54 PM, Ashley Fowler wrote:
Okay I understand. I made some changes
(define delete-second2
(lambda(ls)
(if(< (length ls) 1) (append(list(car ls))(cdr(cdr ls)))
(list(car ls)
it works for when I do the following tests:
(delete-second2 '(3 7)) ==> (3)
(del
: users@racket-lang.org
Subject: Re: [racket] Delete Second
On Mon, Sep 17, 2012 at 12:54 PM, Ashley Fowler
wrote:
> Okay I understand. I made some changes
>
> (define delete-second2
> (lambda(ls)
> (if(< (length ls) 1) (append(list(car ls))(cdr(cdr ls)))
> (li
On Mon, Sep 17, 2012 at 12:54 PM, Ashley Fowler
wrote:
> Okay I understand. I made some changes
>
> (define delete-second2
> (lambda(ls)
> (if(< (length ls) 1) (append(list(car ls))(cdr(cdr ls)))
> (list(car ls)
>
> it works for when I do the following tests:
>
> (delete-sec
, 2012 1:42 PM
To: Ashley Fowler
Cc: users@racket-lang.org
Subject: Re: [racket] Delete Second
On Mon, Sep 17, 2012 at 11:30 AM, Ashley Fowler
wrote:
> I was just showing my first part lol...but here goes the rest of i below
>
> (define delete-second1(lambd
On Mon, Sep 17, 2012 at 11:30 AM, Ashley Fowler
wrote:
> 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))
>
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
wrote:
> Yeah I got a
On Mon, Sep 17, 2012 at 11:19 AM, Ashley Fowler
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:
To: Ashley Fowler
Cc: users@racket-lang.org
Subject: Re: [racket] Delete Second
> delete-second2 takes the same procedure from delete-second1, I just need to
> know how to use the if expression because you have to find out if the list
> has more than one item in order for it to delete an
The documentation for 'if' is here
http://docs.racket-lang.org/reference/if.html?q=if
Here's a slightly modified example from the doc using 'if':
(if (positive? -5)
(error "shouldn't get here")
(display "hi"))
You might want to consider the 'when', documented here
http://docs.racket-lang.org
> delete-second2 takes the same procedure from delete-second1, I just need to
> know how to use the if expression because you have to find out if the list
> has more than one item in order for it to delete anything.
Ok. Let's look at the expression you had written earlier:
(if (> ls 1) )
@gmail.com] on behalf of Danny Yoo
[d...@hashcollision.org]
Sent: Monday, September 17, 2012 12:44 PM
To: Ashley Fowler
Cc: users@racket-lang.org
Subject: Re: [racket] Delete Second
On Mon, Sep 17, 2012 at 10:40 AM, Ashley Fowler
wrote:
> Basically delete-second2 has to take a input of a list, if the l
On Mon, Sep 17, 2012 at 10:40 AM, Ashley Fowler
wrote:
> Basically delete-second2 has to take a input of a list, if the list has more
> than 1 item then it will delete the second item and return the new list, if
> it doesnt have more than 1 item it will just return the original list.
Let me be
[danny@gmail.com] on behalf of Danny Yoo
[d...@hashcollision.org]
Sent: Monday, September 17, 2012 12:36 PM
To: Ashley Fowler
Cc: Matthias Felleisen; users@racket-lang.org
Subject: Re: [racket] Delete Second
> 2. Write a procedure (delete-second1 LS) that takes a list LS of at
> least two ite
> 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)
eu.edu]
> Sent: Monday, September 17, 2012 12:16 PM
> To: Ashley Fowler
> Cc: users@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
__
From: Matthias Felleisen [matth...@ccs.neu.edu]
Sent: Monday, September 17, 2012 12:16 PM
To: Ashley Fowler
Cc: users@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?
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
I have to 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 no second item, o.w. returns original input list.
I will need to use a conditional. And the tests should be as below.
Tests:
(delete-seco
23 matches
Mail list logo