主要的lisp 表達是例句
(setf x '(a b c))
(setf y '(1 2 3))
The most important functions on lists are summarized here. The more complicated
ones are explained more thoroughly when they are used.
( f i r s t X) +a first element of a list
(second x) *b second element of a list
( t h i r d x) JC third element of a list
(nth 0 X) +a nth element of a list, 0-based
( r e s t x) + (b C) all but the first element
(car x) +a another name for the first element of a list
(cdr X) * (b C) another name for all but the first element
( l a s t x) =+ (c) last cons cell in a list
(length x) +3 number of elements in a list
(reverse x) +(c b a) puts list in reverse order
(cons 0 y) =+(O 1 2 3) add to front of list
(appendxy) +(abc123) append together elements
( l i s t x y) +((a b C) (1 2 3)) makeanewlist
( l i s t * 1 2 X) +(l 2 a b C) append last argument to others
( n u l l n i l ) +T predicate is true of the empty list
( n u l l x) + n i l . . . and false for everything else
(listp x) +T predicate is true of any list, including n i 1
(listp 3) + n i l . . . and is false for nonlists
(consp x) =+ t predicate is true of non-nil lists
(consp n i 1 1 =+ n i l . . . and false for atoms, including n i 1
(equal x x) =+ t true for lists that look the same
(equal x y) +nil . . . and false for lists that look different
( s o r t y #'>I + (3 2 1) sort a list according to a comparison function
(subseq x 1 2) + (B) subsequence with given start and end points
(setf y '(1 2 3))
The most important functions on lists are summarized here. The more complicated
ones are explained more thoroughly when they are used.
( f i r s t X) +a first element of a list
(second x) *b second element of a list
( t h i r d x) JC third element of a list
(nth 0 X) +a nth element of a list, 0-based
( r e s t x) + (b C) all but the first element
(car x) +a another name for the first element of a list
(cdr X) * (b C) another name for all but the first element
( l a s t x) =+ (c) last cons cell in a list
(length x) +3 number of elements in a list
(reverse x) +(c b a) puts list in reverse order
(cons 0 y) =+(O 1 2 3) add to front of list
(appendxy) +(abc123) append together elements
( l i s t x y) +((a b C) (1 2 3)) makeanewlist
( l i s t * 1 2 X) +(l 2 a b C) append last argument to others
( n u l l n i l ) +T predicate is true of the empty list
( n u l l x) + n i l . . . and false for everything else
(listp x) +T predicate is true of any list, including n i 1
(listp 3) + n i l . . . and is false for nonlists
(consp x) =+ t predicate is true of non-nil lists
(consp n i 1 1 =+ n i l . . . and false for atoms, including n i 1
(equal x x) =+ t true for lists that look the same
(equal x y) +nil . . . and false for lists that look different
( s o r t y #'>I + (3 2 1) sort a list according to a comparison function
(subseq x 1 2) + (B) subsequence with given start and end points
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/133735/viewspace-764270/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Julia是Lisp的轉世 - ArnuldLisp
- “Lisp太難學了”是謊言,Racket語言是中學生都可以接受的Lisp/Python - DustyCloud BrainstormsLispRacketPythonCloudAIORM
- Lisp 的本質Lisp
- Lisp的誕生Lisp
- 【轉】Lisp 已死,Lisp 萬歲!Lisp
- 為什麼檔案上傳表單是主要的安全威脅
- Lisp的永恆之道Lisp
- 99-lisp lisp 的99個問題 P11-20Lisp
- 99-lisp lisp 的99個問題 P1-10Lisp
- Common lisp HyperSpec lisp 語法幫助Lisp
- c++ 中&表達的所有的意思分別是什麼C++
- Common Lisp物件系統是現存最好的物件系統? - mendhekarLisp物件
- lisp 變數的作用域Lisp變數
- lisp 中的 【,@】 與 【·】 以及【‘】 以及【 。,】Lisp
- 關於lispLisp
- 99-lispLisp
- lisp入門Lisp
- lisp 閉包Lisp
- Golang 的正則表達Golang
- lisp 裡的條件判斷Lisp
- lisp 裡的迴圈loop macroLispOOPMac
- 小議 Common Lisp 的名字Lisp
- lisp 裡的相等(相同)的比較Lisp
- Lisp 整體思想Lisp
- Lisp天才神話Lisp
- lisp 習題 occurrencesLisp
- lisp 程式碼示例Lisp
- 超級表達
- python入門-爬取百度翻譯中的雙語例句Python
- 【Linux分享】DNS故障有哪些表現?主要原因是什麼?LinuxDNS
- 大資料的主要特徵是什麼?大資料特徵
- lisp 裡的 ,@ 反引號 的解釋Lisp
- 為敏捷團隊準備的Lisp敏捷Lisp
- lisp 判斷時間Lisp
- Lisp求平方根Lisp
- 向偉大Lisp致敬Lisp
- Common LISP Hints 中文Lisp
- lisp 習題 post+Lisp