等同性
- eq - test if two are the same object
- eql - test if two are of same type
- equal - test if two represent the same structure and contents recursively
- equalp - less discriminating
結構
(defstruct person
name
age
sex)
(let ( (p (make-person
:name "Kevin"
:age 20
:sex "Male")) )
(person-name p) ;; Kevin
(person-age p) ;; 20
(person-sex p) ;; Male
)
變數
- use defparameter or defvar to set global variable
- setq - set quoted blah
- setf - set a field
- use let or let* to create local scope and local variables
- use flet to create local function and local scope
串列操作
- basic: cons, car & cdr
- nth - get nth element
- push
No comments:
Post a Comment