Got Homework?
Connect with other students for help. It's a free community.
Here's the question you clicked on:
 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
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

teal Group TitleBest ResponseYou've already chosen the best response.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

dbastos Group TitleBest ResponseYou've already chosen the best response.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?
 3 months ago
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
 Engagement 19 Mad Hatter
 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.