Lisp中car,cdr和cons都是基础函数。
cons用于构造lists,car和cdr用于分割lisp。
奇怪的命名
cons函数的名称并非没有含意:它是单词'construct'的缩写。car是短语'Contents of the Address part of the Register';cdr('could-er')是短语'Contents of the Decrement part of the Register'。这些短语说明了Lisp是在多么原始的机器上被开发的。
Lisp中car,cdr和cons都是基础函数。
cons用于构造lists,car和cdr用于分割lisp。
奇怪的命名
cons函数的名称并非没有含意:它是单词'construct'的缩写。car是短语'Contents of the Address part of the Register';cdr('could-er')是短语'Contents of the Decrement part of the Register'。这些短语说明了Lisp是在多么原始的机器上被开发的。