Skip to main content
2 votes
0 answers
44 views

I am implementing circular evaluator in Chapter 4 SICP with racket, it seems that the code running fine only it cannot add new frames to the environment due to set-car! issue. I tried the followings: ...
QianruZhou's user avatar
1 vote
2 answers
177 views

From Structure and Implementation of Computer Programs, second edition: Exercise 1.19: There is a clever algorithm for computing the Fibonacci numbers in a logarithmic number of steps.Recall the ...
Tina Russell's user avatar
1 vote
0 answers
146 views

This is from sicp although a bit different: Exercise 3.18. Write a procedure that examines a list and determines whether it contains a cycle, that is, whether a program that tried to find the end of ...
An5Drama's user avatar
  • 774
1 vote
0 answers
63 views

This is from one footnote in SICP: Note that these lazy lists are even lazier than the streams of chapter 3: The car of the list, as well as the cdr, is delayed. ^[41] [41] This permits us to create ...
An5Drama's user avatar
  • 774
1 vote
2 answers
85 views

This is from this CS 61A notes about SICP p80~82 about ucblogo (a dialect of Logo, which derived from Lisp): Second, Logo has first-class expressions; you can run a list that you get as an argument. ...
An5Drama's user avatar
  • 774
1 vote
0 answers
73 views

This is one follow-up question of this QA where how syntax-rules works has been known owing to Shawn. As someone told me before, one different question although somewhat related should be posted as ...
An5Drama's user avatar
  • 774
0 votes
0 answers
157 views

This is from SICP exercise 4.9. Exercise 4.9. Many languages support a variety of iteration constructs, such as do, for, while, and until. In Scheme, iterative processes can be expressed in terms of ...
An5Drama's user avatar
  • 774
1 vote
1 answer
81 views

I am reading SICP section 3.5.1 where it gives the implementation of primitive procedures provided in MIT/GNU Scheme. I tried to load these implementations without considering the order since they are ...
An5Drama's user avatar
  • 774
1 vote
0 answers
87 views

This is one follow-up question of this QA. The comments there focus on how to implement map etc in C++ but doesn't say much about "relationship between environment model" and map etc. SICP ...
An5Drama's user avatar
  • 774
0 votes
2 answers
167 views

When learning SICP, 6.001 lec15 has: A good understanding of the environment model tells me why (IMHO) C++ will never have a fully-functional map, filter, and fold-right/fold-left procedures that are ...
An5Drama's user avatar
  • 774
0 votes
1 answer
62 views

I wrote this code to compute the cube root of a number in Scheme: (define (square x) (* x x)) (define (abs x) (if (< x 0) (- x) x)) (define (cube x) (* x x x)) (define (cube-root-itr guess x) (...
Mohammad Abdullah Khan's user avatar
1 vote
1 answer
88 views

Recently when I self-learnt MIT 6.5151 course, I have read SICP 1 to 2.1 as ps0 requires (also read 2.2.1 as CS 61A notes requires) and then Software Design for Flexibility (SDF) Prologue, chapter 1 ...
An5Drama's user avatar
  • 774
0 votes
1 answer
109 views

I am reading SICP. It says in 2.1.3: That is, the operations satisfy the condition that, for any objects x and y, if z is (cons x y) then (car z) is x and (cdr z) is y. ... Here are the definitions: ...
An5Drama's user avatar
  • 774
3 votes
1 answer
79 views

Recently when reading SICP, one footnote says: Numbers that fool the Fermat test are called Carmichael numbers, and little is known about them other than that they are extremely rare. There are 255 ...
An5Drama's user avatar
  • 774
1 vote
2 answers
155 views

I am reading SICP and read this recitation about chapter 1. I use MIT/GNU Scheme as MIT course 6.5151 (6.905) does with version 12.1. I am stuck at Problem 3. Write a procedure that computes e. I ...
An5Drama's user avatar
  • 774

15 30 50 per page
1
2 3 4 5
46