1)基本的數學函數:
java
+ Adds two numbers
- Subtracts the second number from the first
* Multiplies two numbers
/ Divides the first number by the second
ABS Absolute value of a number
SQRT Square root of a numide
CL-USER> (+ 90 42) 132 CL-USER> (- 23 43) -20 CL-USER> (+ 1 2 3 4 5) 15 CL-USER> (* 10 20 30) 6000 CL-USER> (/ 10 5) 2 CL-USER> (/ 10 3) 10/3 CL-USER> (/ 10 3.0) 3.3333333 CL-USER> (/ 10.0 3) 3.3333333 CL-USER> (abs -100) 100 CL-USER> (abs 32) 32 CL-USER> (sqrt 100) 10.0 CL-USER> (sqrt 89) 9.433981
2)Lisp的數據類型有:數字、字符串、符號和列表函數
CL-USER> 123 ;;number 123 CL-USER> "Hello, World!" ;;string "Hello, World!" CL-USER> 'Artichoke ;;symbol ARTICHOKE CL-USER> '(1 2 3 a b c) ;;list (1 2 3 A B C)
Lisp 用;;; ;; ;進行註釋、字母不分大小寫
spa