LISP Notebook

Ready Environment: 0 bindings

LISP Notebook Help

Keyboard Shortcuts

Shift+EnterRun current cell
Ctrl+EnterRun cell and add new below
Ctrl+Shift+EnterRun all cells
Ctrl+DDelete current cell
Ctrl+UpMove to previous cell
Ctrl+DownMove to next cell
TabInsert 2 spaces

Language Features

This is a Scheme-like LISP interpreter supporting:

  • Special forms: define, lambda, if, cond, let, let*, letrec, begin, quote, set!, and, or
  • Data types: numbers, strings, booleans (#t/#f), symbols, lists
  • 70+ built-in functions for math, lists, strings, and more

Example Code

; Define a function
(define (factorial n)
  (if (<= n 1)
      1
      (* n (factorial (- n 1)))))

(factorial 10)  ; => 3628800

; Higher-order functions
(map (lambda (x) (* x x)) '(1 2 3 4 5))
; => (1 4 9 16 25)

; Filter and reduce
(filter even? (range 10))
; => (0 2 4 6 8)

(reduce + 0 '(1 2 3 4 5))
; => 15

; Let bindings
(let ((x 10)
      (y 20))
  (+ x y))  ; => 30

; Recursive named let
(let loop ((n 5) (acc 1))
  (if (<= n 1)
      acc
      (loop (- n 1) (* acc n))))
; => 120