Fix FORMAT compilation on non-simple strings.
[sbcl.git] / src / code / cross-char.lisp
blobc6cdf150972dfea58d237d523abd7b9449946ea9
1 ;;;; cross-compile-time-only replacements for unportable character
2 ;;;; stuff
4 ;;;; This software is part of the SBCL system. See the README file for
5 ;;;; more information.
6 ;;;;
7 ;;;; This software is derived from the CMU CL system, which was
8 ;;;; written at Carnegie Mellon University and released into the
9 ;;;; public domain. The software is in the public domain and is
10 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
11 ;;;; files for more information.
13 (in-package "SB!IMPL")
15 (let ((ascii-standard-chars " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"))
16 (defun sb!xc:code-char (x)
17 (declare (type (or (integer 10 10) (integer 32 126)) x))
18 (if (= x 10)
19 #\Newline
20 (char ascii-standard-chars (- x 32))))
21 (defun sb!xc:char-code (character)
22 (declare (type standard-char character))
23 (if (char= character #\Newline)
25 (+ (position character ascii-standard-chars) 32))))