Issue PRINTING-SPACE
Issue: PRINTING-SPACE
Forum: Editorial
References: character printing
Category: CLARIFICATION/CHANGE
Edit history: 2004-07-20, Version 1 by Bruno Haible
Status: For CLiki consideration
- Problem Description:
- CLHS specifies that when the space character is printed, it prints as "#\ ". This is not what most CL implementations have traditionally done, and brings problems because spaces at the end of line are considered redundant and removed by some text editors.
- Proposal (PRINTING-SPACE:TRADITIONAL):
- Change the behavior of character printing such that invisible graphic characters such as space can be printed by name.
- Test case:
- (prin1-to-string #\space) => "#\\Space"
- Rationale:
- Traditional CL behaviour.
- Current practice:
- (write #\Space :escape t :pretty nil) writes "#\Space" in CLISP 2.32 and CMUCL release-18e-branch. SBCL 0.8.8.20 and CLISP CVS were changed to write "#\ " instead.
- Cost to Implementors:
- None.
- Cost to Users:
- None.
- Cost of Non-Adoption:
- User confusion. Malformed Lisp code when an editor has removed a space at end of line.
- Benefits:
- Aesthetics:
- Discussion:
- Bruno Haible's says: ANSI CL 2.1.3 and the Glossary define Space to be a graphic character.
(This is unlike ISO C 99, where space is non-graphic but printable.)
I'm against introducing an additional category "printable character",
because that complicates the standard.
I agree that 22.1.3.2 should treat the space character differently.
- Kalle Olavi Niemitalo? says: There already is a category of
"printing"
characters, according to the Glossary.
This page is linked from: Proposed ANSI Revisions and Clarifications
CLiki pages can be edited by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively