Commit a7ace141 authored by Raymond Toy's avatar Raymond Toy
Browse files

Print integers with lowercase when *print-case* is :downcase.

Could optimize SUB-OUTPUT-INTEGER and DIGIT-TO-CHAR if needed, but I'm
assuming printing of fixnums and bignums is not limited by the
conversion of each digit to a character.

 * src/code/print.lisp:
   * Print integers in lowercase if *print-case* is :downcase
   * Update a docstring.

 * src/i18n/locale/cmucl.pot:
   * Update

 * src/general-info/release-20f.txt:
   * New file with updated info.
parent bc828bed
......@@ -1297,17 +1297,22 @@
(write-char #\. stream)))
(defun sub-output-integer (integer stream)
(let ((quotient ())
(remainder ()))
(declare (type (and fixnum unsigned-byte) integer))
(let ((quotient 0)
(remainder 0))
(declare (fixnum quotient remainder))
;; Recurse until you have all the digits pushed on the stack.
(if (not (zerop (multiple-value-setq (quotient remainder)
(truncate integer *print-base*))))
(sub-output-integer quotient stream))
(when (not (zerop (multiple-value-setq (quotient remainder)
(truncate integer (the (integer 2 35) *print-base*)))))
(sub-output-integer quotient stream))
;; Then as each recursive call unwinds, turn the digit (in remainder)
;; into a character and output the character.
(write-char (code-char (if (and (> remainder 9.)
(> *print-base* 10.))
(+ (char-code #\A) (- remainder 10.))
(+ (if (eq *print-case* :downcase)
(char-code #\a)
(char-code #\A))
(- remainder 10.))
(+ (char-code #\0) remainder)))
stream)))
......@@ -1343,12 +1348,12 @@ greater than n."
(declaim (inline digit-to-char))
(defun digit-to-char (d)
"Convert digit into a character representation. We use 0..9, a..z for
10..35, and A..Z for 36..52."
"Convert digit into a character representation."
(declare (fixnum d))
(labels ((offset (d b) (code-char (+ d (char-code b)))))
(cond ((< d 10) (offset d #\0))
((< d 36) (offset (- d 10) #\A))
((< d 36) (offset (- d 10) (if (eq *print-case* :downcase)
#\a #\A)))
(t (error _"overflow in digit-to-char")))))
(defun print-fixnum-sub (n r z s)
......
========================== C M U C L 20 f =============================
[In Progress]
The CMUCL project is pleased to announce the release of CMUCL 20f.
This is a major release which contains numerous enhancements and
bug fixes from the 20c release.
CMUCL is a free, high performance implementation of the Common Lisp
programming language which runs on most major Unix platforms. It
mainly conforms to the ANSI Common Lisp standard. CMUCL provides a
sophisticated native code compiler; a powerful foreign function
interface; an implementation of CLOS, the Common Lisp Object System,
which includes multi-methods and a meta-object protocol; a source-level
debugger and code profiler; and an Emacs-like editor implemented in
Common Lisp. CMUCL is maintained by a team of volunteers collaborating
over the Internet, and is mostly in the public domain.
New in this release:
* Known issues:
* Feature enhancements
* Changes
* When *PRINT-CASE* is :DOWNCASE, integers are printed with
lowercase letters when needed.
* ANSI compliance fixes:
* Bugfixes:
* Trac Tickets:
* Other changes:
* Improvements to the PCL implementation of CLOS:
* Changes to building procedure:
This release is not binary compatible with code compiled using CMUCL
20e; you will need to recompile FASL files.
See <URL:http://www.cmucl.org> or
<URL:http://trac.common-lisp.net/cmucl> for download information,
guidelines on reporting bugs, and mailing list details.
We hope you enjoy using this release of CMUCL!
......@@ -7355,9 +7355,7 @@ msgid "overflow in digit-to-char"
msgstr ""
 
#: src/code/print.lisp
msgid ""
"Convert digit into a character representation. We use 0..9, a..z for\n"
"10..35, and A..Z for 36..52."
msgid "Convert digit into a character representation."
msgstr ""
 
#: src/code/print.lisp
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment