User Tools

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

====== Function READ-FROM-STRING ====== ====Syntax==== * **read-from-string** //string// ''&optional'' //eof-error-p// //eof-value// ''&key'' //start// //end// //preserve-whitespace// → //object//, //position// ====Arguments and Values==== * //string// - a //[[CL:Glossary:string]]//. * //eof-error-p// - a //[[CL:Glossary:generalized boolean]]//. The default is //[[CL:Glossary:true]]//. * //eof-value// - an //[[CL:Glossary:object]]//. The default is **[[CL:Constant Variables:nil]]**. * //start//, //end// - //[[CL:Glossary:bounding index designators]]// of //string//. The defaults for //start// and //end// are ''0'' and **[[CL:Constant Variables:nil]]**, respectively. * //preserve-whitespace// - a //[[CL:Glossary:generalized boolean]]//. The default is //[[CL:Glossary:false]]//. * //object// - an //[[CL:Glossary:object]]// (parsed by the //[[CL:Glossary:Lisp reader]]//) or the //eof-value//. * //position// - an //[[CL:Glossary:integer]]// greater than or equal to zero, and less than or equal to one more than the //[[CL:Glossary:length]]// of the //string//. ====Description==== Parses the printed representation of an //[[CL:Glossary:object]]// from the subsequence of //string// //[[CL:Glossary:bounded]]// by //start// and //end//, as if **[[CL:Functions:read]]** had been called on an //[[CL:Glossary:input]]// //[[CL:Glossary:stream]]// containing those same //[[CL:Glossary:character|characters]]//. If //preserve-whitespace// is //[[CL:Glossary:true]]//, the operation will preserve //[[CL:Glossary:whitespace]]// as **[[CL:Functions:read-preserving-whitespace]]** would do. If an //[[CL:Glossary:object]]// is successfully parsed, the //[[CL:Glossary:primary value]]//, //object//, is the //[[CL:Glossary:object]]// that was parsed. If //eof-error-p// is //[[CL:Glossary:false]]// and if the end of the //substring// is reached, //eof-value// is returned. The //[[CL:Glossary:secondary value]]//, //position//, is the index of the first //[[CL:Glossary:character]]// in the //[[CL:Glossary:bounded]]// //string// that was not read. The //position// may depend upon the value of //preserve-whitespace//. If the entire //string// was read, the //position// returned is either the //length// of the //string// or one greater than the //length// of the //string//. ====Examples==== <blockquote> (read-from-string " 1 3 5" [[CL:Constant Variables:t]] [[CL:Constant Variables:nil]] :start 2) <r>3 5 </r> (read-from-string "(a b c)") <r>(A B C) 7 </r> </blockquote> ====Side Effects==== None. ====Affected By==== None. ====Exceptional Situations==== If the end of the supplied substring occurs before an //[[CL:Glossary:object]]// can be read, an error is signaled if //eof-error-p// is //[[CL:Glossary:true]]//. An error is signaled if the end of the //substring// occurs in the middle of an incomplete //[[CL:Glossary:object]]//. ====See Also==== * **[[CL:Functions:read|Function READ]]** * **[[CL:Functions:read-preserving-whitespace|Function READ-PRESERVING-WHITESPACE]]** ====Notes==== The reason that //position// is allowed to be beyond the //[[CL:Glossary:length]]// of the //string// is to permit (but not require) the //[[CL:Glossary:implementation]]// to work by simulating the effect of a trailing delimiter at the end of the //[[CL:Glossary:bound|bounded]]// //string//. When //preserve-whitespace// is //[[CL:Glossary:true]]//, the //position// might count the simulated delimiter. \issue{ARGUMENTS-UNDERSPECIFIED:SPECIFY} \issue{SUBSEQ-OUT-OF-BOUNDS} \issue{RANGE-OF-START-AND-END-PARAMETERS:INTEGER-AND-INTEGER-NIL}