Parent Directory | Revision Log
|Links to HEAD:||(view) (annotate)|
Add function to load all unicode data into memory. This makes it easy to make an executable image that doesn't need unidata.bin around. (Should we do this for normal cores? It seems to add about 1 MB to the core size.) code/unidata.lisp: o Add LOAD-ALL-UNICODE-DATA to load all unicode data. o Add UNICODE-DATA-LOADED-P to check that unicode data has been loaded. code/print.lisp: o If unicode data is loaded, don't check for existence of *unidata-path*, because we don't need it. code/exports.lisp: o Export LOAD-ALL-UNICODE-DATA. general-info/release-20c.txt: o Update info
Add -unidata option to specify unidata.bin file. This change requires a cross-compile. Use boot-2011-04-01-cross.lisp as the cross-compile script. bootfiles/20b/boot-2011-04-01-cross.lisp: o New cross-compile bootstrap file lisp/lisp.c: o Recognize -unidata option and setup *UNIDATA-PATH* appropriately. code/commandline.lisp: o Add defswitch for unidata so we don't get complaints about unknown switch. code/unidata.lisp: o Rename +UNIDATA-PATH+ to *UNIDATA-PATH*, since it's not a constant anymore. o Update code to use new name. code/print.lisp: o Update code to use *UNIDATA-PATH* compiler/sparc/parms.lisp: o Add *UNIDATA-PATH* to list of static symbols. o Add back in spare-9 and spare-8 static symbols since we need to do a cross-compile for this change anyway. compiler/x86/parms.lisp: o Add *UNIDATA-PATH* to list of static symbols. o Reorder the static symbols in a more logical arrangment so that the spare symbols are at the end. i18n/local/cmucl.pot: o Update
Change uses of _"foo" to (intl:gettext "foo"). This is because slime may get confused with source locations if the reader macros are installed.
Remove _N"" reader macro from docstrings when possible.
PRINC-TO-STRING should bind *PRINT-READABLY* to NIL. code/print.lisp: o Add optional *PRINT-READABLY* argument to STRINGIFY-OBJECT. o Update PRINC-TO-STRING with new docstring and call STRINGIFY-OBJECT with *PRINT-READABLY* bound to NIL. general-info/release-20b.txt: o Update
code/print.lisp: o WITH-STANDARD-IO-SYNTAX needs to use the standard pprint dispatch table. general-info/release-20b.txt: o Update
Merge intl-branch 2010-03-18 to HEAD. To build, you need to use boot-2010-02-1 as the bootstrap file. You should probably also use the new -P option for build.sh to generate and update the po files while building.
Restart internalization work. This new branch starts with code from the intl-branch on date 2010-02-12 18:00:00+0500. This version works and LANG=en@piglatin bin/lisp works (once the piglatin translation is added).
Mark translatable strings; update cmucl.pot and ko/cmucl.po accordingly.
Add (intl:textdomain "cmucl") to the files to set the textdomain.
The character attributes for | and ` were set incorrectly which caused the '|\|| and '|`| to be printed incorrectly. (Bug reported by A.M.Raportirenko, cmucl-imp, 2009/10/02.)
Treat Unicode symbol characters like characters without case so they can be printed without quotes. (Not sure if we should include all symbols. Maybe just math symbols?)
Merge Unicode work to trunk. From label unicode-utf16-extfmt-2009-06-11.
The othercase-attribute is only for Unicode, so conditionalize it's use to unicode.
In REINIT-CHAR-ATTRIBUTES, signal a continuable error if we can't find unidata.bin.
Support printing symbols with Unicode letters that have no case like Hangul. code/unidata.lisp: o Add +UNICODE-CATEGORY-OTHER+ to represent Unicode category Lo. code/print.lisp: o New attribute OTHERCASE-ATTRIBUTE for Unicode category Lo. o Update ATTRIBUTE-NAMES to include new attribute. o In SYMBOL-QUOTEP, adjust letter-attribute to include othercase-attribute as appropriate. o In REINIT-CHAR-ATTRIBUTES, initialize character attributes to include Unicode characters with category Lo.
Import Paul's new routines for storing and accessing the Unicode data. i18n/NameAliases.txt: o New file: Unicode NameAliases tools/build-unidata.lisp: o New file: Reads UnicodeData.txt and NameAliases.txt and creates unidata.bin that is accessed by Lisp to obtain unicode information. code/unidata.lisp: o New file: Lisp interface to unidata.bin code/char.lisp: o Updated to use the new interface code/print.lisp: o Can't set up characer-attributes array with full Unicode data at startup because the search-list isn't set up yet. Hence, only initialize part of the array, and use an *after-save-initializations* function to fill array with Unicode data after the search-list has been initialized. compiler/srctran.lisp: o Update deftransforms to use the new interface. tools/make-main-dist.sh: o Copy unidata.bin into the distribution. tools/worldbuild.lisp: o Load unidata.lisp tools/worldcom.lisp: o Compile unidata.lisp
o Update character-attributes table with data from *unicode-data* so the printer can do the right thing for unicode characters. o Add a function do the same thing. (May be removed later?)
Sync to utf16 branch, tag unicode-utf16-sync-label-2009-03-16.
Sync to CVS HEAD, tag label-2009-03-16. But don't sync Config.FreeBSD_gencgc, Config.x86_freebsd, FreeBSD-os.c, and FreeBSD-os.h. Let Alex sync those later. The result seems to work as expected on Solaris and x86/linux. Darwin (ppc or x86) untested.
Remove all references to SCALE-EXPONENT and friends. They've been replaced by ACCURATE-SCALE-EXPONENT.
Merge format fixes from HEAD. This fixes the following issues: o (format nil "~5f" 1d-10) prints out too many zeroes.
(format nil "~5f" 1d-10) was printing out way too many zeroes, exceeding the specified width. I think the correct answer is ".0000". So, add a parameter, allow-overflow-p, to FLONUM-TO-STRING to allow the width constraint to be exceeded. This defaults to T. FLONUM-TO-STRING looks at this and decides whether or not to print out all the leading zeroes or not. In FIXED-FORMAT-AUX, set allow-overflow-p to NIL so we don't exceed the width. I wish there were another way to do this, but I can't think of one right now. All print tests pass, and add the following test: (format nil "~5F" 1d-10) -> ".0000" print.lisp: o Change FLONUM-TO-STRING to use keyword parameters instead of optional parameters. o Add :ALLOW-OVERFLOW-P, defaulting to T. o Use :ALLOW-OVERFLOW-P to determine if all the leading zeroes should be printed or not. format.lisp: o Update calls to FLONUM-TO-STRING to use keywords parameters. o In FIXED-FORMAT-AUX, set :ALLOW-OVERFLOW-P to NIL
Trac ticket #13. Basically caused by a change of exponent due rounding of the number for printing. 0.999999 might get printed as 1.000. The original number had an exponent of -1, but the printed number has an exponent of 0, and we need to account for this. code/print.lisp: o Modify FLONUM-TO-STRING to take into account of the actual and printed exponent of the number. Return an extra value to indicate if rounding has the exponent to change. code/format.lisp: o Use the new return value from FLONUM-TO-STRING to tell us if we need to adjust the printed exponent to account for the rounding change. All print tests still pass, and we add the following tests: (assert (string= (format nil "~11,3,2,0,'*,,'EE" .99) " 0.990E+00")) (assert (string= (format nil "~11,3,2,0,'*,,'EE" .999) " 0.999E+00")) (assert (string= (format nil "~11,3,2,0,'*,,'EE" .9999) " 0.100E+01")) (assert (string= (format nil "~11,3,2,0,'*,,'EE" .0000999) " 0.999E-04")) (assert (string= (format nil "~11,3,2,0,'*,,'EE" .00009999) " 0.100E-03")) (assert (string= (format nil "~11,3,2,,'*,,'EE" .00009999) " 9.999E-05")) (assert (string= (format nil "~11,3,2,,'*,,'EE" .000099999) " 1.000E-04"))
For ~w,dF, don't print out too man leading digits if the number is less than 10^(-d) (approximately). Previously, we'd print out m leading digits if the number were 10^(-m) even if d < m. Additional tests: (assert (string= (format nil "~,3F" 0.000001) "0.000"))
Was failing to print enough digits for things like (format nil "~9,,,-2E" 1.2345689d-3). This change also allows us to get rid of one other call to flonum-to-string, so printing should be faster now. Some additional tests: (assert (string= (format nil "~9,,,-2E" 1.2345689d3) ".00123d+6")) (assert (string= (format nil "~9,,,-2E" -1.2345689d3) "-.0012d+6")) (assert (string= (format nil "~9,,,-2E" 1.2345689d-3) ".00123d+0")) (assert (string= (format nil "~9,,,-2E" -1.2345689d-3) "-.0012d+0"))
o Incorrect number of digits were printed for ~wF. o If FMIN is given, print out the digits, even if we're out of room. (This is so ~E will print at least 1 digit due to a bad choice in scale factor.) The following tests all pass. (assert (string= (format nil "~9,3,2,0,'%G" 0.0314159) "0.314e-01")) (assert (string= (format nil "~9,3,2,-2,'%@e" 3.14159) "+.003e+03")) (assert (string= (format nil "~6,2,1,'*F" 3.14159) " 31.42")) (assert (string= (format nil "~9,0,6f" 3.14159) " 3141590.")) (assert (string= (format nil "~9,4,,-7E" pi) ".00000003d+8")) (assert (string= (format nil "~9,4,,-5E" pi) ".000003d+6")) (assert (string= (format nil "~5,4,,7E" pi) "3141600.d-6")) (assert (string= (format nil "~11,4,,3E" pi) " 314.16d-2")) (assert (string= (format nil "~11,4,,5E" pi) " 31416.d-4")) (assert (string= (format nil "~11,4,,0E" pi) " 0.3142d+1")) (assert (string= (format nil "~9,,,-1E" pi) ".03142d+2")) (assert (string= (format nil "~,,,-2E" pi) "0.003141592653589793d+3")) (assert (string= (format nil "~,,,2E" pi) "31.41592653589793d-1")) (assert (string= (format nil "~E" pi) "3.141592653589793d+0")) (assert (string= (format nil "~9,5,,-1E" pi) ".03142d+2")) (assert (string= (format nil "~11,5,,-1E" pi) " 0.03142d+2")) (assert (string= (format nil "~G" pi) "3.141592653589793 ")) (assert (string= (format nil "~9,5G" pi) "3.1416 ")) (assert (string= (format nil "|~13,6,2,7E|" pi) "| 3141593.d-06|")) (assert (string= (format nil "~9,3,2,0,'%E" pi) "0.314d+01")) (assert (string= (format nil "~9,0,6f" pi) " 3141593.")) (assert (string= (format nil "~6,2,1,'*F" pi) " 31.42")) (assert (string= (format nil "~6,2,1,'*F" (* 100 pi)) "******")) (assert (string= (format nil "~9,3,2,-2,'%@E" pi) "+.003d+03")) (assert (string= (format nil "~10,3,2,-2,'%@E" pi) "+0.003d+03")) (assert (string= (format nil "~15,3,2,-2,'%,'=@E" pi) "=====+0.003d+03")) (assert (string= (format nil "~9,3,2,-2,'%E" pi) "0.003d+03")) (assert (string= (format nil "~8,3,2,-2,'%@E" pi) "%%%%%%%%")) (assert (string= (format nil "~g" 1e0) "1. ")) ;(assert (string= (format nil "~g" 1.2d40) "12000000000000000000000000000000000000000. ")) (assert (string= (format nil "~e" 0) "0.0e+0")) (assert (string= (format nil "~e" 0d0) "0.0d+0")) (assert (string= (format nil "~9,,4e" 0d0) "0.0d+0000")) (assert (string= (format nil "~E" 1.234567890123456789d4) "1.2345678901234567d+4")) (assert (string= (format nil "~20E" (expt 2d0 120)) "1.32922799578492d+36")) (assert (string= (format nil "~21,8E" (expt 2d0 120)) " 1.32922800d+36")) (assert (string= (format nil "~11f" 1.23456789123456789d-3) ".0012345679")) ;; From CLH 22.3.11 (defun test-f (x) (format nil "~6,2F|~6,2,1,'*F|~6,2,,'?F|~6F|~,2F|~F" x x x x x x)) (assert (string= (test-f 3.14159) " 3.14| 31.42| 3.14|3.1416|3.14|3.14159")) (assert (string= (test-f -3.14159) " -3.14|-31.42| -3.14|-3.142|-3.14|-3.14159" )) (assert (string= (test-f 100.0) "100.00|******|100.00| 100.0|100.00|100.0")) (assert (string= (test-f 1234.0) "1234.00|******|??????|1234.0|1234.00|1234.0")) (assert (string= (test-f 0.006) " 0.01| 0.06| 0.01| 0.006|0.01|0.006")) (defun test-e (x) (format nil "~9,2,1,,'*E|~10,3,2,2,'?,,'$E|~ ~9,3,2,-2,'%@E|~9,2E" x x x x)) (assert (string= (test-e 3.14159) " 3.14e+0| 31.42$-01|+.003e+03| 3.14e+0")) (assert (string= (test-e -3.14159) " -3.14e+0|-31.42$-01|-.003e+03| -3.14e+0")) (assert (string= (test-e 1100.0) " 1.10e+3| 11.00$+02|+.001e+06| 1.10e+3")) (assert (string= (test-e 1100.0d0) " 1.10d+3| 11.00$+02|+.001d+06| 1.10d+3")) (assert (string= (test-e 1.1e13) "*********| 11.00$+12|+.001e+16| 1.10e+13")) (assert (string= (test-e 1.1d120) "*********|??????????|%%%%%%%%%|1.10d+120")) (defun test-scale (k) (format nil "~&Scale factor ~2D: |~13,6,2,VE|" (- k 5) (- k 5) 3.14159)) (assert (string= (test-scale 0) "Scale factor -5: | 0.000003e+06|")) (assert (string= (test-scale 1) "Scale factor -4: | 0.000031e+05|")) (assert (string= (test-scale 2) "Scale factor -3: | 0.000314e+04|")) (assert (string= (test-scale 3) "Scale factor -2: | 0.003142e+03|")) (assert (string= (test-scale 4) "Scale factor -1: | 0.031416e+02|")) (assert (string= (test-scale 5) "Scale factor 0: | 0.314159e+01|")) (assert (string= (test-scale 6) "Scale factor 1: | 3.141590e+00|")) (assert (string= (test-scale 7) "Scale factor 2: | 31.41590e-01|")) (assert (string= (test-scale 8) "Scale factor 3: | 314.1590e-02|")) (assert (string= (test-scale 9) "Scale factor 4: | 3141.590e-03|")) (assert (string= (test-scale 10) "Scale factor 5: | 31415.90e-04|")) (assert (string= (test-scale 11) "Scale factor 6: | 314159.0e-05|")) (assert (string= (test-scale 12) "Scale factor 7: | 3141590.e-06|"))
Fix a format regression. (format nil "~21E" (expt 2d0 120)) was printing 1.0d+36. It should have printed far more digits. The previous fixes weren't quite right. We can't just adjust the scale factor with the size of the number. The wrong number of digits gets printed. So FLONUM-TO-STRING takes an extra parameter to indicate the exponent (base 10) of the number. This is used to compensate for the output of FLONUM-TO-DIGITS so that we have the right number of digits. (FLONUM-TO-STRING was assuming FLONUM-TO-DIGITS was called with a scaled number, but we weren't.) print.lisp: o FLONUM-TO-STRING takes extra parameter for the exponent (base 10) of the number---basically what ACCURATE-SCALE-EXPONENT would return. o Add FIXUP-FLONUM-TO-DIGITS to compensate the exponent returned by FLONUM-TO-DIGITS by the exponent of the number. o Some rearrange of the code to get the right number of digits printed under this new scheme. format.lisp: o Keep the exponent of the number and the scaled exponent separate so FLONUM-TO-STRING knows the real exponent. o FORMAT-GENERAL-AUX uses ACCURATE-SCALE-EXPONENT now instead of LISP:SCALE-EXPONENT. With these changes, the following tests all pass: (assert (string= (format nil "~9,3,2,0,'%G" 0.0314159) "0.314e-01")) (assert (string= (format nil "~9,3,2,-2,'%@e" 3.14159) "+.003e+03")) (assert (string= (format nil "~6,2,1,'*F" 3.14159) " 31.42")) (assert (string= (format nil "~9,0,6f" 3.14159) " 3141590.")) (assert (string= (format nil "~9,4,,-7E" pi) ".00000003d+8")) (assert (string= (format nil "~9,4,,-5E" pi) ".000003d+6")) (assert (string= (format nil "~5,4,,7E" pi) "3141600.d-6")) (assert (string= (format nil "~11,4,,3E" pi) " 314.16d-2")) (assert (string= (format nil "~11,4,,5E" pi) " 31416.d-4")) (assert (string= (format nil "~11,4,,0E" pi) " 0.3142d+1")) (assert (string= (format nil "~9,,,-1E" pi) ".03142d+2")) (assert (string= (format nil "~,,,-2E" pi) "0.003141592653589793d+3")) (assert (string= (format nil "~,,,2E" pi) "31.41592653589793d-1")) (assert (string= (format nil "~E" pi) "3.141592653589793d+0")) (assert (string= (format nil "~9,5,,-1E" pi) ".03142d+2")) (assert (string= (format nil "~11,5,,-1E" pi) " 0.03142d+2")) (assert (string= (format nil "~G" pi) "3.141592653589793 ")) (assert (string= (format nil "~9,5G" pi) "3.1416 ")) (assert (string= (format nil "|~13,6,2,7E|" pi) "| 3141593.d-06|")) (assert (string= (format nil "~9,3,2,0,'%E" pi) "0.314d+01")) (assert (string= (format nil "~9,0,6f" pi) " 3141593.")) (assert (string= (format nil "~6,2,1,'*F" pi) " 31.42")) (assert (string= (format nil "~6,2,1,'*F" (* 100 pi)) "******")) (assert (string= (format nil "~9,3,2,-2,'%@E" pi) "+.003d+03")) (assert (string= (format nil "~10,3,2,-2,'%@E" pi) "+0.003d+03")) (assert (string= (format nil "~15,3,2,-2,'%,'=@E" pi) "=====+0.003d+03")) (assert (string= (format nil "~9,3,2,-2,'%E" pi) "0.003d+03")) (assert (string= (format nil "~8,3,2,-2,'%@E" pi) "%%%%%%%%")) (assert (string= (format nil "~g" 1e0) "1. ")) (assert (string= (format nil "~g" 1.2d40) "12000000000000000000000000000000000000000. ")) (assert (string= (format nil "~e" 0) "0.0e+0")) (assert (string= (format nil "~e" 0d0) "0.0d+0")) (assert (string= (format nil "~9,,4e" 0d0) "0.0d+0000")) (assert (string= (format nil "~E" 1.234567890123456789d4) "1.2345678901234567d+4")) (assert (string= (format nil "~20E" (expt 2d0 120)) "1.32922799578492d+36")) (assert (string= (format nil "~21,8E" (expt 2d0 120)) " 1.32922800d+36")) (let (x) (dotimes (k 13 x) (setq x (cons (format nil "~%Scale factor ~2D: |~13,6,2,VE|" (- k 5) (- k 5) 3.14159) x))))
Remove incorrect comment.
o Make the implementation of the log approximation the same in accurate-scale-exponent and flonum-to-digits. o Minor clean up of scale in both places.
print.lisp: o Add *POWERS-OF-TEN* for use in scaling. o Implement the fast log scaling from Burger and Dybvig's paper. Scaling is very noticeably faster for large and small numbers; it is somewhat slower for intermediate numbers near 1. (Should we test for this case?) format.lisp: o Implement an accurate scaling routine, based on the scale routine in FLONUM-TO-DIGITS. o Use the new scaling routine in FORMAT-EXP-AUX. This should fix Trac Ticket #12.
Print the identity when printing out weak pointers.
This large checkin merges the double-double float support to HEAD. The merge is from the tag "double-double-irrat-end". The double-double branch is now obsolete. The code should build without double-double support (tested on sparc) as well as build with double-double support (tested also on sparc).
Adjust SCALE-EXPONENT to support double-double-float. Split the original into a version for double-double-float and double-float. This works better, but still needs some work.
Tell FLOAT-FORMAT-NAME about DOUBLE-DOUBLE-FLOAT so the printer can print double-double-float infinities and NaNs.
Add basic support for reading and printing double-double-floats. I think this needs to be built from a binary that already has basic double-double support. That is, you need to compile these changes with a binary built from the double-double-branch. (It may work to cross-compile this from the 2006-06 snapshot, but I did not try it.) Reading double-double-floats appears to work. PRINT appears to work. However, formatted output of double-double-floats may not be accurate because SCALE-EXPONENT still only supports double-floats. code/bignum.lisp: o Add support for coercing a BIGNUM to a DOUBLE-DOUBLE-FLOAT. code/float.lisp: o Add support for converting a RATIO to a DOUBLE-DOUBLE-FLOAT. This is needed to be able to read a double-double-float correctly. o INTEGER-DECODE-DOUBLE-DOUBLE-FLOAT seems to be buggy. Use a new version that works but probably conses more than is necessary and is probably slower than necessary. This is needed to print out DOUBLE-DOUBLE-FLOATs correctly. o Add DECODE-DOUBLE-DOUBLE-FLOAT while we're at it. o Add SCALE-DOUBLE-DOUBLE-FLOAT. This is also needed for printing. o Disable %DOUBLE-DOUBLE-FLOAT. There's already an implementation in float-tran. (We really should move the float-tran version to here.) code/format.lisp: o Tell printer to use #\w when printing double-double-floats. code/irrat.lisp: o The deftransform for ABS is working, so use that instead of the hack. code/numbers.lisp: o Update FLOAT-CONTAGION to support mixing rationals with double-double-floats. code/print.lisp: o Recognize double-double-floats for printing. Use "w" as the exponent marker for double-double floats. o Very minor change to FLONUM-TO-DIGITS to support double-double-floats. code/reader.lisp: o Tell the reader that #\w and #\W are exponent markers for double-double-float numbers by giving them the secondary attribute constituent-expt. o Tell the reader to creat double-double-floats when reading such numbers.
Add basic support for kernel:double-double-float type. The primitive type is there, and basic arithmetic operations work as well as PRINT. But many things do not work: No reader, formatted output, many mixed type arithmetic operations, special functions are just double-float values, coerced to double-double-float. compiler/generic/interr.lisp: o Add new error compiler/generic/new-genesis.lisp: o Dump double-double-float objects (barely tested) compiler/generic/primtype.lisp: o Tell compiler about the new primitive type double-double-float. compiler/generic/vm-fndb.lisp: o Make double-double-float-p a known function. compiler/generic/vm-type.lisp: o Update FLOAT-FORMAT-NAME to include double-double-float compiler/generic/vm-typetran.lisp: o Tell compiler about double-double-float type predicate. compiler/sparc/float.lisp: o Add necessary vops to move double-double-float args, store and load double-double-floats to/from the double-double-stack, double-double-reg moves, box and unbox double-double-floats, move double-double-floats to and from args o Add necessary vops to create a double-double-float and to extract the high and low parts out of a double-double-float. compiler/sparc/parms.lisp: o Define double-double-float-digits compiler/sparc/type-vops.lisp: o Define double-double-float type vop o Adjust number hierarchy to include double-double-float compiler/sparc/vm.lisp: o Define the necessary storage class and storage base for the double-double-reg and double-double-stack. lisp/gencgc.c: o Tell GC about double-double-float objects. lisp/purify.c: o Tell purify about double-double-float objects. code/class.lisp: o Add the new double-double-float class. code/exports.lisp: o Add the necessary symbols to the various packages. (This is important to get right otherwise there's confusion on what symbol really represents double-double-float stuff.) code/float.lisp: o Implement some of the necessary functions to support double-double-float. code/hash-new.lisp: o Hash double-double-floats by xor'ing the hashes of each double-float part. (Is that good enough?) code/irrat.lisp: o Implement the special functions by calling the double-float versions and coercing the result to a double-double-float. This is needed to get type-derivation working, but the precise value isn't that important right now. We'll have to implement them later. code/kernel.lisp: o Make make-double-double-float, double-double-hi, and double-double-lo known functions. code/lispinit.lisp: o Register the :double-double float feature. code/load.lisp: o Add FOP for reading double-double-float values from fasls. (Barely tested, if at all.) code/numbers.lisp: o Implement basic arithmetic operations for double-double-floats. This needs quite a bit of work to clean up, but most things work. code/pred.lisp: o Tell the type system about double-double-float type. code/print.lisp: o Add very rudimentary printing for double-double-float. Basically copied from code written by Richard Fateman, with permission. code/seq.lisp: o Tell coerce how to coerce things to a double-double-float. code/type.lisp: o Tell type system about the new float format double-double-float and how numeric contagion works with double-double-float. code/dump.lisp: o Tell dumper how to dump double-double-float values to a fasl. compiler/float-tran.lisp: o Add appropriate deftransforms to handle conversion of things to double-double-float and from from double-double-float to other float types. o The basic implmentation of double-double-float arithmetic is also here. o Add deftransforms to tell the compiler how to do basic arithmetic and comparisions on double-double-float numbers. compiler/srctran.lisp: o Fix a bug in interval-range-info when :low is 0dd0 and :high is 0. We weren't returning the right value, which confuses interval-div, which caused an infinite loop because we couldn't split the numerator into positive and negative parts. o Tell other parts about double-double-float.
code/format.lisp: o Add an additional case where we want to print out a trailing zero: There's no width constraint and the previous character was a decimal point, so the fraction to be printed is zero. code/print.lisp: o Honor the d option if we run out of room so (format nil "~,2f" 0.001) produces "0.00", not "0.001".
CLHS 188.8.131.52.3 says at least one digit must be printed after the decimal point. Make it so.
Handle circularity detection in logical blocks better. (Ported from sbcl.)
Merge code from main branch of 2005-12-17 to ppc gencgc branch. Still doesn't work of course.
No functional changes. Just clean up the code a little.
o CLHS 184.108.40.206 (~E) says prin1 omits the plus sign of the exponent if it is non-negative. Adjust PRINT-FLOAT-EXPONENT accordingly. o OUTPUT-FLOAT-AUX prints out 1d23 as "1.0d23". This differs from how FORMAT ~E prints out that number. Adjust OUTPUT-FLOAT-AUX to match what ~E does. (Are there other cases that we're missing?)
Merge float printer fixes from HEAD.
(format nil "~9,,,-7E" pi) was not printing any significant digits. Make sure the position arg to flonum-to-string is non-negative in this case.
Some fixes for floating-point printing bugs reported by Bruno Haible, cmucl-imp, on or around 2005/06/13. Some useful tests: (format nil "~9,3,2,0,'%G" 0.0314159) Expected: "0.314e-01" (format nil "~9,3,2,-2,'%@e" 3.14159) Expected: "+.003E+03" (format nil "~6,2,1,'*F" 3.14159) Expected: " 31.42" (format nil "~9,0,6f" 3.14159) Expected: " 3141590." (let (x) (dotimes (k 13 x) (setq x (cons (format nil "~%Scale factor ~2D: |~13,6,2,VE|" (- k 5) (- k 5) 3.14159) x)))) (" Scale factor 7: | 3141590.e-06|" " Scale factor 6: | 314159.0e-05|" " Scale factor 5: | 31415.90e-04|" " Scale factor 4: | 3141.590e-03|" " Scale factor 3: | 314.1590e-02|" " Scale factor 2: | 31.41590e-01|" " Scale factor 1: | 3.141590e+00|" " Scale factor 0: | 0.314159e+01|" " Scale factor -1: | 0.031416e+02|" " Scale factor -2: | 0.003142e+03|" " Scale factor -3: | 0.000314e+04|" " Scale factor -4: | 0.000031e+05|" " Scale factor -5: | 0.000003e+06|") code/format.lisp: o If the scale factor (k) is negative, the min number of digits to print is 1, not (- 1 k) because that prints too many if the field is too short. Setting fmin to fdig is ok if k >= 0. (See scale factor test above.) o If flonum-to-string returns with a trailing decimal point, we don't need to decrement spaceleft because that deletes a white-space character. (See first scale factor 7 test above.) code/print.lisp: o We need to adjust the number of digits to be printed to include the scale factor. See tests above.
Merge snapshot-2005-05 to this branch.
Add a few comments on what FLONUM-TO-DIGITS does.
Add a simple printer for scavenger hooks for gencgc. (Without gencgc, there's already a scavenger hook printer.)
Fix some floating point printing bugs. Based on the version in sbcl. (format nil "~G" 1d23) prints "100000000000000000000000. " instead of "099999999999999990000000. ".
As reported by Rolf Wester, cmucl-help, 2004-12-06, 1d23 was causing an error. o Fix the logic error in scale in flonum-to-digits, where the test for high-ok was wrong. o Take the opportunity to eliminate some common subexpressions to reduce computation and consing of bignums.
Weak pointers can also be circular, so check for that too. Bug noted by Bruno Haible, cmucl-imp, 2004-10-07.
Borrow SBCL's ARRAY-READABLY-PRINTABLE-P function and use it to determine if an array can be printed readably.
The CLHS entry for *PRINT-LENGTH* says If an object to be recursively printed has components and is at a level equal to or greater than the value of *print-level*, then the object is printed as ``#''. Adjust the default structure printer and %print-unreadable-object to do this. This fixes the PRINT-LEVEL.2, PRINT-LEVEL.6, PRINT-LEVEL.8, and PRINT-LEVEL.9. test failures.
PRIN1 and "~F" sometimes produces different printed results due to differences in rounding for the range of numbers where PRIN1 uses the same style of output as ~F. This is due to how PRIN1 uses FLONUM-TO-DIGITS to produce the result, but ~F was using FLOAT-STRING. Hack it so FLONUM-TO-STRING calls FLONUM-TO-DIGITS when possible.
Fix bug where (FORMAT NIL "~2f" 1234567.1) returns "1000000." instead "1234567." We just test to see if the width is large enough to hold the number. If not, increase the width so that float-string will produce enough digits.
Implement a much faster and much less consy bignum printer and a faster bignum reader. Contributed by Mark Wooding on cmucl-imp, May 24, 2004.
Oops. FLONUM-TO-STRING is still used by FORMAT. (Should replace this with FLONUM-TO-DIGITS someday?)
Fix up printing of symbols. Passes Paul Dietz's symbol printing tests, now. (Based on SBCL's fixes.)
Fix up printing of symbols with :capitalize.
o Fix typo in output-ratio that was causing incorrect output when *print-radix* was T. If *print-base* were 16, the output would be #xr<...>. o Comment out old float printer routines for now.
Oops. Remove unused code. Add a couple of comments.
o Fix the float printer to print correctly: (float -54965272/1000000000000000000) was printing as -5.496527e-11 but should be -5.4965272e-11 o Fix the float reader to read correctly, without roundoff: 4.0058643e+8 was incorrectly read as 12518325, 1 (integer-decode-float results). It should be 12518326,1. o Fix the float reader to read floats correctly with unusual values of *read-base*: (let ((*read-base* 2)) (read-from-string "-4.3e+7")) used to return a symbol instead of a float. This changes ported from SBCL.
More ANSI test fixes: o FILE-STRING-LENGTH can be used on BROADCAST-STREAM's where the result is 1. o Graphic characters are not printed using the character name (hence #\space is printed #\ ) o Make INPUT-STREAM-P and OUTPUT-STREAM-P work correctly on synonym streams. o MAKE-STRING-INPUT-STREAM was not accepting NIL for the optional END argument. o Close string-input streams. (We weren't before.)
* src/code/print.lisp (output-array-guts): Parts of the output went to the wrong stream. From Robert Macomber on cmucl-imp.
Remove package nicknames USER from COMMON-LISP-USER. Add a new package COMMON-LISP which LISP uses, so that COMMON-LISP no longer has the non-ANSI nickname LISP. To bootstrap, use boot13.lisp as target:bootstrap.lisp with pmai's build scripts, and do a full compile. * src/bootfiles/18e/boot13.lisp: Change for all the package changes. * src/code/exports.lisp: New package common-lisp, which lisp uses. * src/tools/worldload.lisp: * src/tools/setup.lisp: Use cl-user instead of user. Use lisp:: instead of cl::. * src/tools/worldcom.lisp: * src/tools/snapshot-update.lisp: * src/tools/pclcom.lisp: * src/tools/mk-lisp: * src/tools/hemcom.lisp: * src/tools/config.lisp: * src/tools/comcom.lisp: * src/tools/clxcom.lisp: * src/tools/clmcom.lisp: * src/pcl/defsys.lisp: * src/motif/lisp/initial.lisp: * src/interface/initial.lisp: * src/hemlock/lispmode.lisp (setup-lisp-mode): Use cl-user instead of user. * src/code/save.lisp (assert-user-package): * src/code/print.lisp (%with-standard-io-syntax): Find cl-user package instead of user. * src/code/package.lisp (package-locks-init): Add lisp. (package-init): Don't add user nickname to cl-user. * src/code/ntrace.lisp (*trace-encapsulate-package-names*): Add common-lisp. * src/code/hash.lisp (toplevel): * src/code/hash-new.lisp (toplevel): Use in-package :lisp instead of :common-lisp. * src/code/float-trap.lisp (sigfpe-handler): Don't qualify floating-point-inexact with ext:. * src/pcl/simple-streams/strategy.lisp (sc): * src/pcl/simple-streams/null.lisp (null-read-char): * src/pcl/simple-streams/internal.lisp (allocate-buffer) (free-buffer): * src/pcl/simple-streams/impl.lisp (%check, %read-line) (%peek-char, %read-byte): * src/pcl/simple-streams/file.lisp (open-file-stream) (device-close): * src/pcl/simple-streams/classes.lisp (simple-stream) (device-close): * src/pcl/macros.lisp (toplevel): * src/pcl/braid.lisp (lisp::sxhash-instance): * src/pcl/env.lisp (toplevel): * src/compiler/generic/objdef.lisp (symbol-hash): * src/code/stream.lisp (read-sequence, write-sequence): * src/code/macros.lisp (defmacro, deftype): * src/code/eval.lisp (interpreted-function): * src/code/defstruct.lisp (defstruct): * src/code/debug.lisp (debug-eval-print): Use lisp:: instead of cl::.
o Was not properly printing out, readably, zero-dimensional arrays like (make-array '(0 0 0)). o Read wasn't reading in things like #3a() properly Bugs noted by Paul Dietz. Fixes from Gerd Moellmann.
o Correct some spelling mistakes o Fix a few typos in code. o Delete a few unused symbols from various places o Use something better than %%RWSEQ-EOF%% for the eof marker. o Add target-foreign-linkage vars for the PPC and HPPA ports to aid cross-compilation. (The values are very likely wrong, but they're not used yet.) Based on a larger patch from Eric Marsden.
Checked in Brian Spilsbury's experimental Unicode, locales, and dialect support patchset. This lives on its own branch, so that people can play with it and tweak it, without disturbing 18e release engineering on the main branch. Bootstrapping has only been tried on LINKAGE_TABLE x86/Linux builds. A working cross-compile script is checked in under bootfiles/19a/boot1-cross-unicode.lisp. The script still leaves you with some interactive errors, on the cross compile, which you should answer with 2. See the mailing list for more information.
Mega commit to bring RELENG_18 branch in sync with HEAD in preparation for release tagging 18d.
o Slight rewrite of output-float and output-float-aux to reduce some gratuitous consing caused by coercion at runtime of the ANSI mandated free format boundaries from ratios to appropriate floats. The coercions now happen at compile-time, and documentation is also improved. o Elided duplicate case clause for ratios in output-ugly-object.
Fixed bug reported by Erik Naggum on comp.lang.lisp, where printing of bit-vectors breaks, because of the printer respecting printer control variables like radix and base, where they shouldn't be, especially since the corresponding reader doesn't expect this.
Add support for ANSI specified :print-function and :print-object defstruct options while preserving previous behaviour. ANSI processing is enabled by ext:*ansi-defstruct-options-p* which must be NIL while compiling CMUCL, PCL, CLX, HEMLOCK to avoid flushing defined print-functions. This switch is turned ON when worldload builds a core with PCL in it.
o Fix output-character to escape the char-name. Reworking quote-string to not write the delimiting quotes so that is can be used by output-character.
o Correct the pretty printing by print-unreadable-object. Only attempt to print pretty when the stream is a pretty-stream (and when *print-pretty*) to ensure that all output goes to the same stream.
o Have print-unreadable-object respect *print-pretty*.
This set of revisions brings the RELENG_18 branch up to HEAD in preparation for an 18c release.
Make keywords print out readably independent of the package when read back by always using the colon prefix; from Raymond Toy.
Add support for printing and reading arrays with arbitrary element-types. These are output in the format #A(<element-type> <dims> <contents>). A random-state can now be printed readably.
This set of changes removes nearly all references to the dylan language. It is a benign revision as no structures are redefined. At some later point the definitions in compiler/objdef could be removed, perhaps in sync with some other type change.
Minor updates from the main branch.
Fix for attempts to print specialized arrays readably. From Ray Toy.
This (huge) revision brings the RELENG_18 branch up to the current HEAD. Note code/unix-glib2.lisp not yet included -- not sure it is ready to go.
Restore the in-synonym-of, out-synonym-of, with-in-stream, and with-out-stream macros incorrectly replaced in the recent Gray stream changes.
Gray streams support: * Rename the 'stream structure class to sys:lisp-stream. * Add a new none hierarchical 'stream built-in class which inherits from: instance, t. * Hack in the new stream class as a mixin for the structure base lisp-stream class which now inherits from: stream, structure-object, instance, t. * Add a new 'fundamental-stream standard-class which includes 'stream as a mixin, and add PCL hacks to allow this to be redefined after PCL is loaded to be (defclass fundamental-stream (standard-object stream) ...). * Add appropriate support to the base stream functions to dispatch to the Gray stream functions for the handling of fundamental-streams. Some of the lisp-streams encapsulating CLOS streams still need a little work.
Fix a recently introduced bug in the handling of denomalized floats in scale-exponent.
Bind *print-readably* to NIL in PRINC. Spotted by Sam Steingold.
Allocate a new digit-string on each call to float-string. This can be reentered via a GC or an interrupt and could lead to corrupt FP output. Patch suggested by Raymond Toy.
Allocate a new digit-string on each call to float-string. This can be reentered via a GC or an interrupt and could lead to corrupt FP output. Patch suggested by Raymond Toy.
Fix bogus simple-vector arg type in sub-output-array-guts.
Fix headed boilerplate.
In OUTPUT-INSTANCE, check for the layout being invalid before calling the print function, since the print function might error.
Update to new DEFINE-CONDITION syntax.
Change output-instance to use SLOT-CLASS instead of BASIC-STRUCTURE-CLASS. Remove Dylan hack, since it should now be able to use slot-classes.
Fix compiler warnings.
Bulletproof output-instance a bit.
Removed hack for printing byte-code objects, now that they have a debug-info object.
unqualify print-object, since it is from LISP now.
Changed output-instance to use %print-dylan-instance to print dylan instances.
Added PRINT-NOT-READABLE condition and made people use it.
If debug-info for a code object is a string, print it (for byte code) instead of assuming a debug-info.
Use ~C instead of ~A when printing float exponent marker so that print-readably doesn't mess things up.
PCL:PRINT-OBJECT has two args.
Fix arg order to print-unreadable-object use in output-instance.
Updated OUTPUT-INSTANCE to handle funcallable instances & to look for funcallable-structure print functions. Changed funcallable-instance branch of OUTPUT-OBJECT to just call OUTPUT-INSTANCE.
new structure branch & tuning, see new_struct
fix structure-pointer-type => instance-pointer-type
fix args to write-string. ..
instancep => %instancep
New structure hax.
Changed (code-header-ref component vm:code-debug-info-slot) to (%code-debug-info component).
Changed several uses of %primitive to eqv functions now that eqv functions exist.
Added a #.vm:dylan-function-header-type branch to OUTPUT-FUNCTION. Also added a T branch that prints "Unknown Function" so we get some output when we stumble across unknown functions.
Fixed quote-string to stop at the fill pointer for strings with fill pointers.
Printpcircle fixes w/o byte-functions.
Fixed OUTPUT-SYMBOL to no longer call CHECK-FOR-CIRCULARITY now that OUTPUT-OBJECT does it for us. This was causing gensyms to print as #1=#1# when *PRINT-CIRCLE* was T.
Changed circularity detection and depth abbreviation around. OUTPUT-OBJECT now does all circularity detection and DESCEND-INTO only does depth abbreviation. Also OUTPUT-STRUCTURE no longer descends into the object, under the assumption that the structure printer will either actually check the depth argument or use PPRINT-LOGICAL-BLOCK or DESCEND-INTO.
Added support for byte-code compiled functions.
Seperated out the stuff to print symbol names into KERNEL:OUTPUT-SYMBOL- NAME so that other people can access the case frobbing aspect of symbol printing without having make a symbol.
Added support for FDEFN objects. Detect LRAs and CODE-COMPONENTs by type tests, instead of using GET-TYPE.
PRINT-UNREADABLE-OBJECT returns NIL, not #\>
Changed FLONUM-TO-STRING to consider widths < 1 to be 1 to prevent infinite looping in those cases.
Specify stream when printing unbound marker.
Added support for READTABLE-CASE in symbol printing. Added some missing array type declarations in SYMBOL-QUOTEP. The behavior when *PRINT-CASE* is :CAPITALIZE and *PRINT-ESCAPE* is NIL is now slightly different than before.
Fixed PPRINT to call OUT-SYNONYM-OF on it's stream argument so that it will actually work for the ``streams'' T and NIL.
Fixed OUTPUT-VECTOR to not consider *PRINT-ARRAY* in string printing.
Oops, had the argument order backwards in a use of output-structure so it was trying to print the stream to the structure instead of print the structure to the stream.
Fixed spelling of descend (was decend). Added magic to output-structure to notice if the user structure printer also tried to do depth abbrevs and circularity detection, and blow it off 'cause we've already done it.
Added doc strings for pretty-printer defvars. Added a decend-into for print-vector. Added an export for *print-pprint-dispatch*.
Flushed uses of DOSTRING, because the definition went away. Exported *CURRENT-LEVEL*, *PRETTY-PRINTER*, OUTPUT-OBJECT, OUTPUT-UGLY-OBJECT, CHECK-FOR-CIRCULARITY, HANDLE-CIRCULARITY, WITH-CIRCULARITY-DETECTION, DECEND-INTO, and PUNT-IF-TOO-LONG from the KERNEL package and added doc strings for them.
Significant rewrite to support *print-readably* at all and to better support and *print-circle*, *print-level*, and *print-length*.
Fixed output-weak-pointer to print to the supplied stream instead of *standard-output* when the pointer has been broken.
Changed BASE-CHARACTER to BASE-CHAR
PRINT-BIGNUM tables need to be 37 long, since bases go up to 36.
Added noise to output-random to check to see if code components have :bogus-lra for their debug-info. If they do, then just print something to that effect, don't try to compiled-debug-info-name the thing.
Merged Simon Leinen's fix to OUTPUT-SYMBOL. This amounted to deleting an incorrect and questionably optimal optimization of printing package qualifiers.
Changed OUTPUT-RANDOM to print the name of code objects and the value of value cells.
New file header with RCS header FILE-COMMENT.
Fixed funcallable instance printing.
Changed random object printing to call PCL::PRINT-OBJECT on funcallable instances.
Use the magic function structure-ref instead of the %primitive.
Added explicit initial-elements to uses of make-array where we needed the initial element to be nil.
Make the termination-form for dostring optional, because it's not always supplied.
Fixed output-structure to use structure-ref instead of svref.
Added support for printing denorms, infinities and NaNs. Added DEFVARs for *print-readably* and *read-eval* so that the new code could use them as appropriate. Old code still needs to be fixed to use these vars. In FLONUM-TO-STRING, use FLOAT-PRECISION to find out the actual precision for denorms, and adjust the args to FLOAT-STRING accordingly. This is so that we don't print more digits than the real precision. Currently this case will only happen through FORMAT, since normal printing uses SCALE-EXPONENT for denorms. Hacked up SCALE-EXPONENT a bunch to work for denorms. Fixed an outright bug that would happen if the (* 10.0) loop even ran more than once. Added additional special-casing for denorms so that the EXPT won't overflow.
Put interpreted function printing back in the printer after William thoughtfully merged it out.
Fixed some residual character bits lossage that was causing #\a to print as #\\a.
Moved MIPS branch onto trunk; no merge necessary.
oops, left of the stream arg to write-string, so it went to standard-output instead of where it was supposed to go.
Fixed up float printing stuff for new obj format. In addition to flushing gratuitous format dependencies, I also cleaned up the free format printing stuff a bit. The sign on 0 is now printed.
Added temporary version of output-float that just prints its type.
Fixed get-header-type to be get-type. Bind *print-radix* to t before calling output-integer instead of printing the radix in output-random. This way, we don't get two radix markers if someone else has set *print-radix* to t.
Enhanced output-random to be able to deal with strange objects better.
Special-case printing of code pointers, so that we don't choke on internal code pointers.
Fixed print-bignum to calculate the value for *base-power* correctly.
Rewrote print-bignum to not make assumptions about the size of fixnums and to just call truncate instead of bignum-fixnum-truncate-inplace, 'cause that hasn't existed sence the perq days.
Fixed bug in weak pointer print method.
Added print method for weak pointers.
Check for system-area-pointers, and print their value inside #<...>. ,
Initial MIPS cut.
Fixed missing stream arg in OUTPUT-RANDOM.
FIxed paren error in output-random.
Fixed merge lossage. Removed FUNCALLABLE-INSTANCE check in LIST branch of OUTPUT-OBJECT, since funcallable instances won't be lists (and haven't been in the current system for quite a while.)
/usr1/lisp/ncode/print.lisp, 29-Nov-89 18:44:35, Edit by Chiles. Changed print-string-stream to *print-string-stream*. Changed previous-case to *previous-case*. Added some locality to global variables. Rewrote DOSTRING. Documented some stuff. Made WRITE, PRIN1, PRINT, PRINC, etc. call OUT-SYNONYM-OF. Made the following internal printing functions take a stream argument: output-object quote-string output-symbol output-list output-integer output-float output-ration output-complex output-structure output-character output-vector output-array output-random Since these used to assume they were outputting to *standard-output*, and the entry point into the file would set this up, the system suffered serious correctness and termination problems. T and Nil were handled incorrectly for getting at *terminal-io*, and if a printign routine had been given a synonym stream referring output to '*standard-output*, the stream methods looped forever trying to find the destination stream. Removed the definition for MISC-TYPE-CODE.
Changed OUTPUT-STRUCTURE to use INFO TYPE PRINTER.
Changed OUTPUT-FUNCTION-OBJECT of interpreted functions whose name is NIL to print the lambda with bounded depth.
This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, select a symbolic revision name using the selection box, or choose 'Use Text Field' and enter a numeric revision.
|Powered by ViewVC 1.1.5|