Eclipse defined
Function CHAR-BIT, SET-CHAR-BIT
Syntax:
char-bit char &key control meta => result
set-char-bit char &key control meta => new-char
Arguments and Values:
char---a character.
control---a generalized boolean. The default is false
for char-bit, :DEFAULT for set-char-bit.
meta---a generalized boolean. The default is false
for char-bit, :DEFAULT for set-char-bit.
result---a boolean.
new-char---a character.
Description:
Char-bit returns true if char is a base-char which has the control bit set and the control argument is true, or if char is a base-char which has the meta bit set and the meta argument is true. Otherwise char-bit returns false.
Set-char-bit returns a new character which is the same as as char, modified as follows:
NIL, then the control bit is turned off. If char
is a base-char and control is true but not
:DEFAULT, then the control bit is turned on.
NIL, then the meta bit is turned off. If char
is a base-char and meta is true but not
:DEFAULT, then the meta bit is turned on.
Affected By: None.
Exceptional Situations:
Signals an error of type type-error if char is not a character.
See Also:
Notes:
Setting the meta bit is reversible, that is:
(let ((set? (char-bit char :meta t)))
(eql char (set-char-bit (set-char-bit char :meta (not set?)) :meta set?)))
=> true ;for all values of char
However, the control bit is not reversible. Turning the
control bit on always forces an ASCII character to have a code below
32. Turning it back on produces a character which (exclusive of the
meta bit) has a code in the range 64-95 ([@ A B ... _], not [` a b ...]).
(let ((set? (char-bit char :meta t)))
(eql char (set-char-bit (set-char-bit char :meta (not set?)) :meta set?)))
=> true ;except when
; (char<= #\Space (set-char-bit char :meta nil) #\?) or
; (char<= #\` (set-char-bit char :meta nil) #\Delete)
(set-char-bit (set-char-bit #\A :control t) :control nil)
=> #\A
(set-char-bit (set-char-bit #\a :control t) :control nil)
=> #\A