[racket] Delete Second

From: Danny Yoo (dyoo at hashcollision.org)
Date: Mon Sep 17 13:15:28 EDT 2012

> 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) <consequent> <alternative>)

I've put placeholders <consequent> and <alternative> for what happens
when the test is true or false, and assume you'll know how to fill
these.  For now, let me just fill them in with "big" and "small".

   (if (> ls 1) "big" "small")

Let's give this expression a concrete list value for "ls", and see if
the expression correctly computes "big" or "small".

   (if (> '(a big list) 1)

If we evaluate this at the Interactions window, we want to see "big",
of course, but what really happens?  Try it.  Does an error occur?

Posted on the users mailing list.