4 ms·
SICP uses Scheme. Racket is a rather different, much larger language. Racket's default #lang isn't even compatible with SICP -- for example its cons cells aren
by perihelions 5y ago
SICP uses Scheme. Racket is a rather different, much larger language.
Racket's default #lang isn't even compatible with SICP -- for example its cons cells aren't mutable. (Though it's perfectly fine to use Racket tooling with SICP or other Scheme books -- just set #lang scheme instead of #lang racket).
- Fellshard 5y agoDr. Racket does have an SICP #lang available; I'm not sure whether I got it through the package manager, or elsewhere.
- Jtsummers 5y agohttps://docs.racket-lang.org/sicp-manual/Installation.html https://docs.racket-lang.org/sicp-manual/Installation.html - Installation instructions.
- perihelions 5y agoLooks like a third-party package? https://docs.racket-lang.org/sicp-manual/index.html https://docs.racket-lang.org/sicp-manual/index.html
- jp0d 5y agoThank you. I did not know that. I thought Racket was a superset of Scheme with a lot of batteries included.
- bmitc 5y agoYou can very easily use Racket for SICP with minimal translations, even without the `#lang sicp` package. Racket's default cons cells aren't mutable, but Racket still has them. The `#lang sicp` package mainly provides the drawing needs that SICP uses as well as defaults for the MIT Scheme used in the book. https://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html https://blog.racket-lang.org/2007/11/getting-rid-of-set-car-... https://docs.racket-lang.org/reference/mpairs.html https://docs.racket-lang.org/reference/mpairs.html
- jp0d 5y agoCheers mate.
- pjmlp 5y agoThat is how it started, as Dr. Scheme, then it decided to go its own way and they decided a new name to make this visible.
- bmitc 5y agoRacket still has mutable cons though. Just prefix everything with an `m`. https://docs.racket-lang.org/reference/mpairs.html https://docs.racket-lang.org/reference/mpairs.html
- jpe90 5y agoI had been combining in rnrs/mutable-pairs-6 when I needed mutable cons, I didn't realize they were available in the base language. Dangit.