Lecture Notes on Scheme

http://www.cs.utexas.edu/users/novak/cs307.html

Quick Lisp

                C:                                                 Lisp:

int myfn (arg1, arg2)        (defun myfn (arg1 arg2)
  { int i = 3; float x, y;      (let ((i 3) x y)
    ...                           ...
  }                             ))

{ statement; ... }            (progn statement ... )

i = j + 2;                    (setq i (+ j 2))

sqrt(x)                       (sqrt x)

if ( i > j && j > k )         (if (and (> i j) (> j k))
   statement1                     statement1
   else statement2;               statement2)

for (i=0; i< n; i++) ...      (dotimes (i n) ...)

while ( i < n ) statement;    (while (< i n) statements)

switch ( key ) {              (case key
  case 1,2: statement;          ((1 2) statement)
            break;
  ...                           ...
  default:  statement; }        (t     statement))

printf("%d\n", i);            (format t "~A~%" i)


Gordon S. Novak Jr.