Fix make-array transforms.
[sbcl.git] / src / code / cross-char.lisp
1 ;;;; cross-compile-time-only replacements for unportable character
2 ;;;; stuff
3
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.
12
13 (in-package "SB!IMPL")
14
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)
24         10
25         (+ (position character ascii-standard-chars) 32))))