All Manuals > LispWorks® User Guide and Reference Manual > 36 The EXTERNAL-FORMAT Package

decode-external-string Function

Summary

Decodes a series of integers to make a string.

Package

external-format

Signature

decode-external-string vector-or-function external-format &key start end into => result

Arguments
vector-or-function
A vector of integers or a function.
external-format
An external format spec.
start, end
Bounding index designators of vector-or-function.
into
nil, a string or a function.
Values
result
A string, t or a non-negative integer.
Description

The function decode-external-string decodes integers using encoding external-format to make characters.

If vector-or-function is a vector, then the integers from it bounded by start and end are decoded; otherwise vector-or-function must be a function, which is called repeatedly with no arguments and should either return the next integer or return nil to indicate that there are no more integers..

If into is nil, then a new string containing the decoded characters is returned; if into is a function then it is called with each decoded character and t is returned; otherwise into should be a string of sufficient length into which the decoded characters are stored and the index of the first unmodified element of into is returned.

If vector-or-function is a vector then its element type does not need to match the external-format-foreign-type of external-format.

Compatibility notes

This function exists in LispWorks 5.0 but is not documented and does not take the :start and :end arguments. Also, it was inefficient prior to LispWorks 5.0.1.

See also

26.7 External Formats to translate Lisp characters from/to external encodings
encode-lisp-string


LispWorks® User Guide and Reference Manual - 18 Feb 2025 15:32:20