3 Using Characters and Strings
base-string-p
object
simple-base-string-p
object
base-string-p
is true if its argument is of typebase-string
.
simple-base-string-p
is true if its argument is of typesimple-base-string
.
characterp
object&optional
repertoire
characterp
is true if its argument is a character.
> (characterp #\rubout) Tchar-external-code Function> (characterp #\newline :ascii) T
> (characterp #\a :base) T
> (characterp 12) NIL
char-external-code
character character-set-name
char-external-code
returns a non-negative integer that is the index of the specified character within the specified character set. If the character is not encoded in the character set, the function returnsnil
.
char-external-code-limit
char-external-code-limit
character-set-name
char-external-code-limit
returns the upper exclusive bound of the value returned by the function char-external-code
for the specified character set.
char-external-code
.
char-external-code
*default-character-element-type*
*default-character-element-type*
specifies the default string format for the following strings:make-string
make-string-output-stream
and by the Common Lisp macro with-output-to-string
make-sequence
when the sequence type is'string
*default-character-element-type*
is the default element type for the functionopen
. Once a stream has been opened, all strings constructed by the reader will be in this format.
*default-character-element-type*
depends on the value of the environment variableLANG
. It ischaracter
if the value ofLANG
is eitherjapanese
orjapan
. Otherwise, it isbase-character
.
> *default-character-element-type* BASE-CHARACTER*default-external-format* Variable;;; Override the default value so we can load a file containing ;;; double-byte character data: > (let ((*default-character-element-type* 'character)) (load "dbcs.lisp")) ;;; Loading source file "dbcs.lisp" #P"/u/dru/dbcs.lisp"
*default-base-external-format* Variable
*default-external-format*
*default-base-external-format*
*default-external-format*
specifies the default value for the:external-format
keyword of the functionopen
, when the:element-type
keyword is specified as'character
. The initial value of*default-external-format*
differs for each supported platform and is shown in Table 3.1 on page 25.
*default-base-external-format*
specifies the default value for the:external-format
keyword of the functionopen
, when the:element-type
keyword is specified as'base-character
. The initial value of*default-base-external-format*
differs for each supported platform and is shown in Table 3.2 on page 25.
fast-read-dbcs-char Function
fast-read-dbcs-char
stream&optional
eof-error-p eof-value recursivep
fast-write-dbcs-char
char stream
fast-read-char
andfast-write-char
except that they are designed to be used with extended characters.
:element-type 'character
. Since theextended-character
type is a subtype ofcharacter
, these functions are capable of handling both double-byte and Single-byte characters.
read-char
,write-char
(in Common Lisp: The Language);fast-read-char
,fast-write-char
(in the Advanced User's Guide).
find-external-char
character-set-name char-external-code
find-external-char
returns a character object that is encoded at the specified character index within the specified character set. Since the character set mapping might be sparse, the function can returnnil
if there is no legal character with the index given.
char-external-code
(see char-external-code
on page 28 for details).
general-string-p Function simple-general-string-p Function
general-string-p
object
simple-general-string-p
object
general-string-p
is true if its argument is of typegeneral-string
.
simple-general-string-p
is true if its argument is of typesimple-general-string
.
sbchar Function
sbchar
simple-base-string index
sgchar
simple-general-string index
sbchar
andsgchar
access a single character element of a string. These functions are identical to the Common Lisp functionschar
, except thatsbchar
requires a simple base string argument andsgchar
requires a simple general string argument.
schar
(in Common Lisp: The Language)
Generated with Harlequin WebMaker