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:


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