Scheme is:
Scheme | Java |
---|---|
(sin 1) | sin(1), or (((sin((1))))) |
(+ 2 3) | 2 + 3 |
(* 6 9) | 6*9 or (((((6)))*((9)))) |
(lambda (x) (+ x 1)) | ? (cannot easily write anonymous function) |
(define add-one (lambda (x) (+ x 1))) | int addOne(int x){ return x+1); } |
(if (< 2 2) 777 888) | (2 < 2) ? 777 : 888 |
;;; (factorial n) ;;; n! ;;; 0! = 1 ;;; 1! = 1 ;;; 2! = 2