From a7ace14123e6cbe17f041142328593287cdf6586 Mon Sep 17 00:00:00 2001 From: Raymond Toy <toy.raymond@gmail.com> Date: Sun, 29 Sep 2013 14:44:15 -0700 Subject: [PATCH] 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. --- src/code/print.lisp | 23 ++++++++------ src/general-info/release-20f.txt | 51 ++++++++++++++++++++++++++++++++ src/i18n/locale/cmucl.pot | 4 +-- 3 files changed, 66 insertions(+), 12 deletions(-) create mode 100644 src/general-info/release-20f.txt diff --git a/src/code/print.lisp b/src/code/print.lisp index f2f42c9a0..999bc943c 100644 --- a/src/code/print.lisp +++ b/src/code/print.lisp @@ -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) diff --git a/src/general-info/release-20f.txt b/src/general-info/release-20f.txt new file mode 100644 index 000000000..3c6db5265 --- /dev/null +++ b/src/general-info/release-20f.txt @@ -0,0 +1,51 @@ +========================== 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! diff --git a/src/i18n/locale/cmucl.pot b/src/i18n/locale/cmucl.pot index 896d902af..3d53de085 100644 --- a/src/i18n/locale/cmucl.pot +++ b/src/i18n/locale/cmucl.pot @@ -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 -- GitLab