User Tools

A PCRE internal error occured. This might be caused by a faulty plugin

====== Function COPY-SEQ ====== ====Syntax==== * **copy-seq** //sequence// → //copied-sequence// ====Arguments and Values==== * //sequence// - a //[[CL:Glossary:proper sequence]]//. * //copied-sequence// - a //[[CL:Glossary:proper sequence]]//. ====Description==== Creates a copy of //sequence//. The //[[CL:Glossary:element|elements]]// of the new //[[CL:Glossary:sequence]]// are the //[[CL:Glossary:same]]// as the corresponding //[[CL:Glossary:element|elements]]// of the given //sequence//. If //sequence// is a //[[CL:Glossary:vector]]//, the result is a //[[CL:Glossary:fresh]]// //[[CL:Glossary:simple array]]// of //[[CL:Glossary:rank]]// one that has the same //[[CL:Glossary:actual array element type]]// as //sequence//. If //sequence// is a //[[CL:Glossary:list]]//, the result is a //[[CL:Glossary:fresh]]// //[[CL:Glossary:list]]//. ====Examples==== <blockquote> ([[CL:Macros:defparameter]] *str* "a string") <r>*STR*</r> *str* <r>"a string" </r> (equalp *str* (copy-seq *str*)) <r>//[[CL:Glossary:true]]// </r> (eql *str* (copy-seq *str*)) <r>//[[CL:Glossary:false]]// </r> </blockquote> ====Side Effects==== None. ====Affected By==== None. ====Exceptional Situations==== Should be prepared to signal an error of type type-error if //sequence// is not a //[[CL:Glossary:proper sequence]]//. ====See Also==== * **[[CL:Functions:copy-list|Function COPY-LIST]]** ====Notes==== From a functional standpoint: <blockquote> (copy-seq x) ≡ ([[CL:Functions:subseq]] x 0) </blockquote> However, the programmer intent is typically very different in these two cases.