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

encode-lisp-string Function

Summary

Converts a string to an encoded series of integers.

Package

external-format

Signature

encode-lisp-string string external-format &key start end into => result

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

The function encode-lisp-string converts the part of string bounded by start and end to integers, to be encoded in encoding external-format.

If into is nil, then a new vector containing the encoded integers is returned (with element type that matches the external-format-foreign-type of external-format); if into is a function then it is called with each encoded integer and t is returned; otherwise into should be a vector of sufficient length into which the encoded integers are stored and the index of the first unmodified element of into is returned.

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
decode-external-string


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