SICP Programs¶
Exercises and programs from Structure and Interpretation of Computer Programs book
Chapter 1 - Building abstractions with procedures¶
Programs¶
Fibonacci Tree, Counting change, Exponent, GCD, Primality, Sigma function, Lambda, Half interval, Fixed point, Transformation
Exercises¶
1.1 Elements of Programming
1.2 Procedures and the Processes They Generate
- 1.9, 1.10, 1.11, 1.12, 1.13, 1.15, 1.16, 1.17, 1.18, 1.19, 1.20, 1.21, 1.22, 1.23, 1.24, 1.25, 1.26, 1.27, 1.28
1.3 Formulating Abstractions with Higher-Order Procedures
- 1.29, 1.30, 1.31 (a), 1.31 (b), 1.32 (a), 1.32 (b), 1.33, 1.34, 1.35, 1.36, 1.37 (a), 1.37 (b), 1.38, 1.39, 1.40, 1.41, 1.42, 1.43, 1.44, 1.45, 1.46
Chapter 2 - Building abstractions with data¶
Programs¶
Rational numbers, Sequences, Transforming list, Trees from list, Mapping over tree, Conventional interfaces, Nested mappings, Painter patterns, Painter higher order, Painter transformation, Symbolic differentiation, Sets as unordered list, Sets as ordered list, Sets as trees, Huffman tree, Complex numbers, Arithmetic package
Exercises¶
2.1 Introduction to Data Abstraction
2.2 Hierarchical Data and the Closure Property
- 2.17, 2.18, 2.19, 2.20, 2.21, 2.22, 2.23, 2.24, 2.25, 2.26, 2.27, 2.28, 2.29, 2.30, 2.31, 2.32, 2.33, 2.34, 2.35, 2.36, 2.37, 2.38, 2.39, 2.40, 2.41, 2.42, 2.43, 2.44, 2.45, 2.46, 2.47, 2.48, 2.49, 2.50, 2.51, 2.52
2.3 Symbolic Data
- 2.53, 2.54, 2.55, 2.56, 2.57, 2.58 (a), 2.59, 2.60, 2.61, 2.62, 2.63, 2.64, 2.65, 2.66, 2.67, 2.68, 2.69, 2.70, 2.71, 2.72
2.4 Multiple Representations for Abstract Data
2.5 Systems with Generic Operations
Running the programs¶
Installing MIT Scheme on Mac¶
$ brew install mit-scheme
Installing DrRacket (for a few programs) on Mac¶
$ brew cask install racket
Running scheme programs¶
$ scheme < program_name.scm
Running racket programs¶
$ drracket program_name.rkt