Mathjax javascript librry setup

Racket Open Notebook

“LISP is worth learning for a different reason - the profound enlightenment experience you will have when you finally get it; that experience will make you a better programmer for the rest of your days, even if you never actually use Lisp itself a lot.” > – Eric Raymond, How To Become A Hacker

Racket started as PLT Scheme, a dialect of Scheme, which is in turn a dialect of Lisp, the world’s second oldest high-level programming language, after Fortran. Lisp, of course, is an acronym for “Lots of Irritating Silly Parenthesis”. See here, here, here for more Lisp humour (Actually Lisp stands for “List Processing”).

An Anecdote: I learned Lisp on an LMI Lisp Machine in the early 1980s. I learned Emacs to use ZWEIon the Lisp Machine - Yikes!


Basic Racket Documentation

Textbooks and other materials

Background References

General Racket Information

Racket is Derived from Scheme

Racket is a lexically scoped version of Lisp, very similiaer to Scheme. (It was called PLT Scheme until 2010 when is name was changed to Racket to allow it to further evolve in its own direction) The key differeces include:

  • In Racket, a lot of things are self-evaluating which would raise an error in R5RS Scheme
  • In Racket the empty list is treated differently
  • Racket is case sensitive, though R6RS Scheme is also case sensitive
  • Racket cons pairs and list are immutable, unlike Scheme. In Racket mcons is used to create mutable pairs and lists (So no set-car! and set-cdr! - you use set-mcar! and set-mcdr! etc instead).
  • if must have an else branch
  • What Racket calls letrec is called letrec* in R6RS and doesn’t exist in R5RS, what R5RS and R6RS call letrec doesn’t exist in Racket.
  • Racket treats ( ... ), { ... }, and [ ... ] as equivalent, R5RS does not, but R6RS does
  • Racket contains a structure system that is a bit cleaner than the R6RS record system. It has an object oriented class and object system. It has native support for design by contract. It has a unit system reminiscent of the ML module system, as well as a module system much like the R6RS module system.
  • Racket supports multiple languges using its #lang <language> pragma. There is a typed version of Racket, a version which does lazy evaluation, and several other languages, including standard scheme support.
    • Both R5RS and R6RS versions of Scheme are supported
  • Racket is not standardized and is undegoing constant evolution … so its more of a “moving target”.

For more information on Scheme see:

Tools Notes

Unit testing in Racket

Racket includes a JUnit inspired unit testing framework called rackunit. Its very easy to use:

Dr Racket IDE

Key Bindings

s: – All platforms: Shift c: – All platforms: Control a: – Mac OS X: Option m: – Windows: Alt; X: Meta d: – Mac OS X: Command