load and compile-file fail to represent line division as newline on windows

Bug #720517 reported by Mark David
30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
McCLIM
New
Undecided
Unassigned
SBCL
Triaged
High
Unassigned

Bug Description

1. A very clear description of the requirements and associated problems is in CLtL2, section 2.2.2. "Line Divisions", online here:

http://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node23.html

2. Write the following code into a Lisp file in a plain text editor (e.g., Notepad) on Windows and then LOAD the resulting file.

(format t "~:c" (char "
" 0)) ; Should print Newline

It should print Newline. Otherwise, it's a bug. On SBCL it prints Return.

3. MINGW32_NT-5.1 MHD-PC 1.0.11(0.46/3/2) 2009-05-12 18:47 i686 unknown

4. *features*
(:SWANK :DEBUGGING :ASDF :ANSI-CL :COMMON-LISP :SBCL :SB-DOC :SB-TEST :SB-LDB
 :SB-PACKAGE-LOCKS :SB-UNICODE :SB-EVAL :SB-SOURCE-LOCATIONS
 :IEEE-FLOATING-POINT :X86 :WIN32 :GENCGC :STACK-GROWS-DOWNWARD-NOT-UPWARD
 :C-STACK-IS-CONTROL-STACK :COMPARE-AND-SWAP-VOPS :UNWIND-TO-FRAME-AND-CALL-VOP
 :RAW-INSTANCE-INIT-VOPS :STACK-ALLOCATABLE-CLOSURES :STACK-ALLOCATABLE-VECTORS
 :STACK-ALLOCATABLE-LISTS :STACK-ALLOCATABLE-FIXED-OBJECTS :ALIEN-CALLBACKS
 :CYCLE-COUNTER :INLINE-CONSTANTS :LINKAGE-TABLE :OS-PROVIDES-DLOPEN
 :OS-PROVIDES-PUTWC)

Tags: os-windows
Mark David (mhd-yv)
summary: - load and compile-file fail to represent line division not represented as
- newline on windows
+ load and compile-file fail to represent line division as newline on
+ windows
Revision history for this message
Nikodemus Siivola (nikodemus) wrote :

While hairs can be endlessly split on if this is strictly required or not, the fact remains that we _do_ want it to work in SBCL.

Not marking as a duplicate of #310185 to make it clear that this can be considered a defect -- not just a wishlist item.

Marking as High-importance, since if someone needs to work with a codebase containing CRLFs, this is extremely annoying to work around.

Changed in sbcl:
importance: Undecided → High
status: New → Triaged
Mark David (mhd-yv)
description: updated
Stas Boukarev (stassats)
tags: added: os-windows
Revision history for this message
Dmitry Solomennikov (dmitrys) wrote :

I checked on sbcl 1.4.2, both x86 and x86_64, both under MinGW and standalone.
It successfully prints Newline, same as on Mac OS X.

Looks like it is fixed already.

Revision history for this message
Stas Boukarev (stassats) wrote :

It hasn't been fixed, your file just has Unix-style line endings.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.