;---------------------------最原始的-------------------------------
(+ 2 3 4)
;Value: 9
;---------------------------定義Emmbed--------------------
(define x 2)
(define mm (* x 3))
mm
;Value:6
;-----------------------幾種函數的定義---------------------
(define (sum a b)
(+ a b))
(sum 1 2)
;Value:3
;------------- Cond 使用 --
(define (abs x)
(cond ( (> x 0) x)
( (< x 0) (- x))
(else 0)))
(abs -11)
;Value :11
;--------------- If 使用 --- 邏輯運算使用, and or not -------------
(define (summ a b c)
(cond ((and (> a b) (> c b)) (+ a c))
((and (> a c) (> b c)) (+ a b))
(else (+ b c))))
(summ 1 2 3)
;Value:5