Home
Blogs
Questions
Jobs
Monetize

Home

About Us

Blogs

Questions

Jobs

Monetize

Post Job

banner

Questions about cons

Read more about cons

python (12.9k questions)

javascript (9.2k questions)

reactjs (4.7k questions)

java (4.2k questions)

java (4.2k questions)

c# (3.5k questions)

c# (3.5k questions)

html (3.3k questions)

Questions - cons

Every solution that I've seen for SICP Exercise 3.16 appears to cheat by creating more than three pairs. Where is my misunderstanding?

SICP Exercise 3.16 gives the reader a broken procedure for counting the numbers of pairs in a list structure: (define (count-pairs x) (if (not (pair? x)) 0 (+ (count-pairs (car x)) ...
test-img

J. Mini

list

scheme

sicp

cons

Votes: 0

Answers: 1

Latest Answer

Write it as (define x (cons 'foo '())) (define y (cons x x)) (define str2 (cons y '())) How many conses? Three conses! But when we count them, x is counted twice, so (cons x x) ==> (+ 1 1 1)...
test-img

Will Ness

Posts

Questions

Blogs

Jobs

The ultimate platform for coders and IT specialists

About

  • Company
  • Support

  • Platform

  • Terms & Conditions
  • Privacy statement
  • Cookie policy
  • Cookie option
  • OnlyCoders © 2025  |  All rights reserved