主要的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
- Common Lisp物件系統是現存最好的物件系統? - mendhekarLisp物件
- Lisp 整體思想Lisp
- Lisp求平方根Lisp
- lisp 判斷時間Lisp
- 最近大火的《死亡擱淺》究竟想表達的是什麼?
- python入門-爬取百度翻譯中的雙語例句Python
- Lisp 永遠成不了程式設計主流語言 vs Lisp 神話之路Lisp程式設計
- 因 AI 而設計的語言 LISPAILisp
- 1.2.3.4.5.6.7的表達(23)
- 1.2.3.4.5.6.7的表達(25)
- 1.2.3.4.5.6.7的表達(24)
- 1.2.3.4.5.6.7的表達(31)
- 1.2.3.4.5.6.7的表達(30)
- 1.2.3.4.5.6.7的表達(29)
- 1.2.3.4.5.6.7的表達(27)
- 1.2.3.4.5.6.7的表達(21)
- 1.2.3.4.5.6.7的表達(22)
- 1.2.3.4.5.6.7的表達(10)
- 1.2.3.4.5.6.7的表達(9)
- 1.2.3.4.5.6.7的表達(7)
- 1.2.3.4.5.6.7的表達(6)
- 1.2.3.4.5.6.7的表達(5)
- 1.2.3.4.5.6.7的表達(8)
- 1.2.3.4.5.6.7的表達(32)
- 1.2.3.4.5.6.7的表達(13)
- 1.2.3.4.5.6.7的表達(15)
- 1.2.3.4.5.6.7的表達(12)
- 1.2.3.4.5.6.7的表達(14)
- 1.2.3.4.5.6.7的表達(11)
- 1.2.3.4.5.6.7的表達(26)
- 1.2.3.4.5.6.7的表達(28)
- 1.2.3.4.5.6.7的表達(35)
- 1.2.3.4.5.6.7的表達(34)
- 1.2.3.4.5.6.7的表達(33)
- 1.2.3.4.5.6.7的表達(18)
- 1.2.3.4.5.6.7的表達(19)