Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

ericrost Group Title

For Problem Lec.5.3.3: Functions on Lists Part 2 question 12, I don't understand why (length (cons y y)) is 4. For reference y => (1 2 3)

  • one year ago
  • one year ago

  • This Question is Open
  1. teal Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    The list is ((1 2 3) 1 2 3), which is 4 items. The first list is only a single item, because it's in car.

    • one year ago
  2. dbastos Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    Like our friend above says, the first element is a single item. In Lisp, lists can contain any kind of elements. (Even other lists.) In that list of yours, the first element is a list (with 3 elements), but that list with 3 elements is /the first/ element of the list (cons y y). Does that clarify?

    • 4 months ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.