开发者

Sequence in Lisp

Hi What is sequenc开发者_JAVA技巧e in Lisp ? and what is difference between sequence and list in Lisp ? thanks.


A sequence can be a list, string or vector. Sequences are somewhat more general than lists.


In Common Lisp, a list or a vector is a sequence.

However, lists and vectors have different performance characteristics because of their different underlying implementations (as linked-lists or arrays respectively).

In general, your best bet for basic questions about the language should probably be the Common Lisp Hyperspec, which is a highly hyperlinked version of the language standard. So, for instance, the Hyperspec entry on SEQUENCE will tell you that both lists and vectors are sequences, but also suggests that other types might qualify as sequences as well, and provide links to its entries on lists, vectors, etc..

A good second stop is the lispdoc search tool, which searches the Hyperspec and the text of a few books on the language. So, for instance, the lispdoc results for sequence includes hits on the free online text for Practical Common Lisp, which also summarizes the language's standard sequence functions.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜