;;; Scheme Essentials language ;; Lists are written differently in results window: (list 1 2 3) ;; the result written as (1 2 3) ;; #t and #f instead of true/false (even? 7) ;; the result written as #f (even? 6) ;; the result written as #t ;; true, false are not defined #t #f ;; null? instead of empty?, car and cdr instead of first and rest empty '() ;; another way of writing an empty list, also nil in some versions ;empty? ; not defined (null? '()) ;(first (list 1 2)) (car (list 1 2)) ;(rest (list 1 2)) (cdr (list 2)) ;; Fun with car and cdr (also available in other Scheme levels) (cadr (list 1 2 3)) ;; (car (cdr (list 1 2 3)) (cddr (list 1 2 3)) ;; (cdr (cdr (list 1 2 3)) (cadddr (list 1 2 3 4 5 6 7 8)) ;; works up to 4 levels ;(cadar (list (list 1 2) (list 3 4))) ; what's this??