From ... From: Erik Naggum Subject: Wish list item: , in integers made readable Date: 2000/05/19 Message-ID: <3167733463524161@naggum.no>#1/1 X-Deja-AN: 625408980 mail-copies-to: never Content-Type: text/plain; charset=us-ascii X-Complaints-To: newsmaster@eunet.no X-Trace: oslo-nntp.eunet.no 958744670 8792 195.0.192.66 (19 May 2000 13:57:50 GMT) Organization: Naggum Software; vox: +47 8800 8879; fax: +47 8800 8601; http://www.naggum.no Mime-Version: 1.0 User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.6 NNTP-Posting-Date: 19 May 2000 13:57:50 GMT Newsgroups: comp.lang.lisp Ada has one good thing about numeric constants: They may contain _ (underscore) to make them more readable. Common Lisp can print numbers that look even nicer, with a , (comma) grouping digits, but it can't read them back in, again. This annoyed me today, as I was gawking at a whole bunch of large integers that had to be readable. So I made , non-terminating. (set-macro-char #\, (get-macro-char #\,) t) This meant 123,456,789 read back as the symbol named "123,456,789" which is almost exactly half as useful as what I had in mind. So I hacked the function that I thought made the wrong decision about numberhood of this string. The rest of the system was not amused, so I had to delete the commas from the input at a fairly low level, but that's not too satisfactory, as it's common in some cultures to use dot or space, not comma, for grouping (silly Europeans!), and parse-integer could really use some more options. Like a cancer my wish list item grew, so here's the condensed and sanitized version of with wish list item: I'd like integers printed with internal commas for grouping to be readable as if the commas were absent. This requires the comma to be a non-terminating macro character, which _could_ cause problems with space-deficient legacy code. It would be nice if more of the system would grok human-readable numbers, and I would be positively thrilled if write and friends would do grouping, not just format. Unfortunately, this requires rather low-level changes to most Common Lisp implementations, so I'm asking for reactions and suggestions. #:Erik -- If this is not what you expected, please alter your expectations.