| #1. SICP : Let's Read! |
| Published: 2026-09-08 [Tue] 19:18, by |
|
> SICP Book: https://mitp-content-server.mit.edu/books/content/sectbyfn/books_pres_0/6515/sicp.zip/full-text/book/book-Z-H-4.html > SICP Lectures: https://www.youtube.com/playlist?list=PLE18841CABEA24090 > Racket Scheme https://racket-lang.org/download/ > SICP Racket https://docs.racket-lang.org/sicp-manual/Installation.html Let's embrace the tree structure of Pohon BBS. Top level comments for chapters of the book, replies to top level comments for discussions of the chapter. Comment #2 will be for general help installing Scheme Comment #3 will be for random Scheme discussion that doesn't fit into chapter discussion. Ready, start, go! |
| #2. |
| Published: 2026-09-08 [Tue] 19:19, by |
|
General Scheme troubleshooting / installation help / etc goes under this comment.... |
| #3. |
| Published: 2026-09-08 [Tue] 19:20, by |
|
Random Scheme / Lisp / programming discussion that doesn't fit into chapter discussion goes here.... |
| #4. Chapter 1 |
| Published: 2026-09-08 [Tue] 19:21, by |
|
SICP chapter 1 > Building Abstractions with Procedures https://mitp-content-server.mit.edu/books/content/sectbyfn/books_pres_0/6515/sicp.zip/full-text/book/book-Z-H-9.html#%_chap_1 |
| #5. phatcat power level formula (first scheme test) |
| Published: 2026-09-08 [Tue] 19:24, by |
|
>>3 (define phatcat_powerlevel 1200) (define unlocked_potential 500) (define (phatcat_bulky_transformation x y) (* 1.2 (+ x y))) (phatcat_bulky_transformation phatcat_powerlevel unlocked_potential) |
| #6. Chapter 2 |
| Published: 2026-09-08 [Tue] 19:27, by |
|
> Building Abstractions with Data https://mitp-content-server.mit.edu/books/content/sectbyfn/books_pres_0/6515/sicp.zip/full-text/book/book-Z-H-13.html#%_chap_2 |
| #7. Chapter 3 |
| Published: 2026-09-08 [Tue] 19:28, by |
|
> Modularity, Objects, and State https://mitp-content-server.mit.edu/books/content/sectbyfn/books_pres_0/6515/sicp.zip/full-text/book/book-Z-H-19.html#%_chap_3 |
| #8. Chapter 4 |
| Published: 2026-09-08 [Tue] 19:29, by |
|
> Metalinguistic Abstraction https://mitp-content-server.mit.edu/books/content/sectbyfn/books_pres_0/6515/sicp.zip/full-text/book/book-Z-H-25.html#%_chap_4 |
| #9. Chapter 5 |
| Published: 2026-09-08 [Tue] 19:30, by |
|
> Computing with Register Machines https://mitp-content-server.mit.edu/books/content/sectbyfn/books_pres_0/6515/sicp.zip/full-text/book/book-Z-H-30.html#%_chap_5 |
| #10. outputs color based on stats (hopefully) |
| Published: 2026-09-08 [Tue] 19:37, by |
|
>>3 (define (clouds_color strength intelligence Defense) (define red strength) (define blue intelligence) (define green defence) (list red green blue))) % gives RGB color (idk how to/ if its even possible for lisp to output a color) |
| #11. some sample lisp code |
| Published: 2026-09-08 [Tue] 19:51, by |
|
>>3 (define pi 3.14159265) (define (square x) (* x x)) (define (volume-of-cone radius height) (* pi (square radius) (/ height 3))) (define my-cone-volume (volume-of-cone 1 2)) my-cone-volume => 2.09 |
| #12. |
| Published: 2026-09-08 [Tue] 20:11, by |
|
>>3 Famous article by a guy who used Lisp to become a billionaire : > Graham, Paul. "The Roots of Lisp." (2001) 15pp https://wiki.eecs.yorku.ca/course_archive/2014-15/W/6339/_media/jmc.pdf discusses how 7 primitives became the meta language |
| #13. exercise 1.3 |
| Published: 2026-09-08 [Tue] 21:50, by |
|
>>4 (define (square x) (* x x)) (define (sum-squares x y) (+ (square x) (square y))) (define (sum-greater-squares x y z) (if (> x y) (if (> y z) (sum-squares x y) (sum-squares x z)) (if (> x z) (sum-squares y x) (sum-squares y z)))) (sum-greater-squares 1 2 3) (sum-greater-squares 4 2 3) (sum-greater-squares 5 1 0) |
| #14. Excercise 1.3 |
| Published: 2026-09-09 [Wed] 01:43, by |
|
>>13 My attempt at exercise 1.3. it took me a long time as most of my attempts made code that excluded anything that wasn't the maximum number, so i guess finding the "middle" number is what makes this challenging. my first attempts were checking each variable against the others individually (mistake). if x>y then output x otherwise 0, if x>z output x otherwise 0 then multiply both outputs, repeat for each variable (rather silly in retrospect). After this i decided to only compare to the third variable if the first check failed and directly compute the square if the variable wasn't the minimum. Code below: #lang sicp (define (sicp_ex_1.3 x y z) (+ (if (< x y) (if (< x z) 0 (* x x)) (* x x)) (if (< y x) (if (< y z) 0 (* y y)) (* y y)) (if (< z y) (if (< z x) 0 (* z z)) (* z z)))) (sicp_ex_1.3 1 2 3) result was 13 so it worked |
| #15. corrected exercise 1.3 |
| Published: 2026-09-09 [Wed] 15:22, by |
|
>>14 Updated to catch PhatCat's fix -- if x, y, and z are the same value, the code does not work (define (square x) (* x x)) (define (sum-squares x y) (+ (square x) (square y))) (define (sum-greater-squares x y z) (if (> x y) (if (> y z) (sum-squares x y) (sum-squares x z)) (if (> x z) (sum-squares y x) (if (= x y z) (sum-squares x x) (sum-squares y z))))) |
| #16. fix ex 1.3 |
| Published: 2026-09-09 [Wed] 15:27, by |
|
>>14 summed all 3 squares if x y z were the same. added a check to just force one variable to zero if all the numbers were equal so theres probably a more elegant solution :P. Code: #lang sicp (define (square x) (* x x)) (define (sicp_ex_1.3 x y z) (+ (if (= x y) 0 (if (= x z) 0 (if (< x y) (if (< x z) 0 (square x)) (square x)))) (if (< y x) (if (< y z) 0 (square y)) (square y)) (if (< z y) (if (< z x) 0 (square z)) (square z)))) (sicp_ex_1.3 1 2 3) (sicp_ex_1.3 2 2 2) (sicp_ex_1.3 2 1 0) |
| #17. epic phail |
| Published: 2026-09-09 [Wed] 15:35, by |
|
>>16 Fixed the fix #lang sicp (define (square x) (* x x)) (define (sicp_ex_1.3 x y z) (+ (if (= x y z) 0 (if (< x y) (if (< x z) 0 (square x)) (square x)))) (if (< y x) (if (< y z) 0 (square y)) (square y)) (if (< z y) (if (< z x) 0 (square z)) (square z))) (sicp_ex_1.3 1 2 3) (sicp_ex_1.3 2 2 2) (sicp_ex_1.3 2 1 0) |
| #18. exercise 1.3 |
| Published: 2026-09-09 [Wed] 20:55, by |
|
>>4 [(define (square a) (* a a)) (define (smallest x y z) (if (< x y) (if (< x z) x z) (if (< y z) y z))) (define (procedure x y z) (- (+ (square x)(square y)(square z))(square (smallest x y z)))) (procedure 7 10 10)] |