Skip to content

Latest commit

 

History

History
55 lines (31 loc) · 1.44 KB

README.md

File metadata and controls

55 lines (31 loc) · 1.44 KB

Study code and Exercises from the book Structure and Interpretation od Computer Programs

The programs in the book are written in an old subset of Scheme, which is a dialect of Lisp.

Online Book

Running on VSCode

  1. Install Racket
  2. Install Magical Racket on VS Code
  3. Use the SICP Collection

Built-In Functions

nil : null?

An alias for ().

(inc x) → number?

  • x : number?
  • Returns (+ x 1).

(dec x) → number?

  • x : number?
  • Returns (- x 1).

the-empty-stream : stream?

The null/empty stream.

(cons-stream first-expr rest-expr)

Produces a stream.

(stream-null? s) → boolean?

  • s : stream?
  • Returns #t if s is the-empty-stream, #f otherwise.

(runtime) → natural-number/c

Returns the current time measured as the number of microseconds passed since a fixed beginning.

(random n) → real?

  • n : positive?
  • Returns a random integer between 0 and n-1 (inclusive) if n is an exact integer. Otherwise, returns a random inexact number between 0 and n (exclusive).

(amb expr ...)

The amb operator.

Additionally, true, false, identity, and error are provided from Racket.