Questions tagged [sicp]

SICP is the book Structure and Interpretation of Computer Programs by Harold Abelson and Gerald Jay Sussman with Julie Sussman and published by the MIT Press.

Quoting the wikipedia page:

Structure and Interpretation of Computer Programs (SICP) is a textbook published in 1984 about general computer programming concepts from MIT Press written by Massachusetts Institute of Technology (MIT) professors Harold Abelson and Gerald Jay Sussman, with Julie Sussman. It was formerly used as the textbook of MIT introductory programming class and at other schools.

Using a dialect of the Lisp programming language known as Scheme, the book explains core computer science concepts, including abstraction, recursion, interpreters and metalinguistic abstraction, and teaches modular programming.

The book is available online, with accompanying video lectures.

660 questions
19
votes
3 answers

Use of lambda for cons/car/cdr definition in SICP

I was just beginning to feel I had a vague understanding of the use of lambda in racket and scheme when I came across the following 'alternate' definitions for cons and car in SICP (define (cons x y) (lambda (m) (m x y))) (define (car z) (z…
Penguino
  • 2,136
  • 1
  • 14
  • 21
19
votes
3 answers

Scheme: Procedures that return another inner procedure

This is from the SICP book that I am sure many of you are familiar with. This is an early example in the book, but I feel an extremely important concept that I am just not able to get my head around yet. Here it is: (define (cons x y) (define…
Houdini
  • 3,442
  • 9
  • 31
  • 47
18
votes
3 answers

Arithmetic with Church Numerals

I am working through SICP, and the problem 2.6 has put me in something of a quandary. In dealing with Church numerals, the concept of encoding zero and 1 to be arbitrary functions that satisfy certain axioms seems to make sense. Additionally,…
afkbowflexin
  • 4,029
  • 2
  • 37
  • 61
17
votes
5 answers

How do I get the functions put and get in SICP, Scheme, Exercise 2.78 and on

I am trying to do exercise 2.78 in SICP, but the functions put and get are unknown. I have tried multiple languages, like pretty big, racket, r5rs, mit-scheme, mzscheme, etc. I even downloaded the SICP support (http://www.neilvandyke.org/sicp-plt/),…
KnowsLittle
  • 1,197
  • 2
  • 13
  • 20
17
votes
3 answers

Eager evaluation/applicative order and lazy evaluation/normal order

As far as I know, eager evaluation/applicative order evaluates all arguments to a function before applying it, on the other hand, lazy evaluation/normal order evaluates the arguments only when needed. So, what are the differences between the pair of…
Ryan Li
  • 9,020
  • 7
  • 33
  • 62
16
votes
5 answers

How do I get a scheme interpreter working inside Emacs?

I'm going through SICP and I'd like to have an interpreter analogous to the interactive Python interpreter to play around in while I'm watching the lectures and reading the book. Furthermore, I'd like this interpreter to run inside Emacs so I can…
Redwood
  • 66,744
  • 41
  • 126
  • 187
14
votes
3 answers

Running SICP Pattern Matching Rule Based Substitution Code

I have found the code from this lesson online (http://groups.csail.mit.edu/mac/ftpdir/6.001-fall91/ps4/matcher-from-lecture.scm), and I am having a heck of a time trying to debug it. The code looks pretty comparable to what Sussman has written: ;;;…
Benjamin Powers
  • 3,186
  • 2
  • 18
  • 23
14
votes
5 answers

SICP making change

So; I'm a hobbyist who's trying to work through SICP (it's free!) and there is an example procedure in the first chapter that is meant to count the possible ways to make change with American coins; (change-maker 100) => 292. It's implemented…
RyanD
  • 173
  • 1
  • 7
13
votes
3 answers

Which language in DrScheme for SICP?

I have been using the Module for SICP in DrScheme 4.2 but which language has the best support for SICP in DrScheme? Has anyone here tried this? Thanks.
unj2
  • 52,135
  • 87
  • 247
  • 375
13
votes
2 answers

SICP 2.16 interval-arithmetic (scheme)

This isn't a homework question, I'm just left unsatisfied with my understanding of interval arithmetic and the implications of exercise 2.16. The interval arithmetic defined by section 2.14 does not exhibit the properties of normal arithmetic. Two…
MVTC
  • 845
  • 11
  • 28
13
votes
5 answers

Compiling SICP Picture Exercises in DrRacket?

I am going through SICP as a self-study and am on the picture language section in Chapter 2. I have been using DrRacket for the earlier exercises, but I get compilation errors when trying to do an exercise based on the 'draw-line' picture function…
Kevin Finch
  • 183
  • 1
  • 7
13
votes
2 answers

Seemingly unnecessary case in the unification algorithm in SICP

I'm trying to understand the unification algorithm described in SICP here In particular, in the procedure "extend-if-possible", there's a check (the first place marked with asterix "*") which is checking to see if the right hand "expression" is a…
Paul Hollingsworth
  • 13,124
  • 12
  • 51
  • 68
12
votes
2 answers

Installing MIT Scheme on Windows 10 -- 'Requested Allocation is too large'

I'm trying to get Scheme going so I can work through "Structure and Interpretation of Computer Programs" but I keep running into the above-mentioned issue. I know sort of how to solve the problem but I don't know how to go about setting the file in…
Dan
  • 153
  • 1
  • 1
  • 8
12
votes
3 answers

Pros and cons of MIT Scheme and DrScheme for studying SICP

What are the pros and cons of using MIT Scheme versus using DrScheme, in the context of trying to go through SICP (presumably simultaneously to watching some / all the MIT 6.001 videos)?
JDelage
  • 13,036
  • 23
  • 78
  • 112
11
votes
1 answer

mcons in dr racket

I'm having trouble reading output from dr racket. By default it displays lists using mcons. For example, sicp exercise 2.32 produces: > (subsets (list 1 2 3)) (mcons (mcons '() (mcons (mcons 3 '()) (mcons (mcons 2 '()) (mcons …
Dmitri
  • 153
  • 1
  • 10
1
2
3
43 44