ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 主要的lisp 表达是例句

主要的lisp 表达是例句

原创 Linux操作系统 作者:babyyellow 时间:2013-06-19 11:54:06 0 删除 编辑
(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


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/133735/viewspace-764270/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
oracle MySQL Postgresql 专职数据库dba。 系统架构师。 mysql 官方认知dba 。 15年专职dba 经验。 潜意识沟通实证者 心理咨询师。 禅修布道者, 禅修指导员。 禅定实证者。

注册时间:2010-12-02

  • 博文量
    367
  • 访问量
    1908848