newline and println on windows

29 views
Skip to first unread message

David Powell

unread,
Jun 30, 2010, 7:39:54 AM6/30/10
to clo...@googlegroups.com

I raised a ticket a while ago regarding newline and println on Windows.

http://www.assembla.com/spaces/clojure/tickets/300-newline-should-output-
platform-specific-newline-sequence

Currently these functions always output ASCII 10 line feeds. I believe that
they should output the platform default line-endings as Java does, so on
Windows they would output ASCII 13 10.

http://java.sun.com/j2se/1.4.2/docs/api/java/io/BufferedWriter.html

If you are currently writing code like (println "hello world\r"), in order to
work around the situation on Windows, then you will need to remove that work-
around, but I'd think that that is pretty unlikely. The patch wouldn't affect
the behaviour of code such as (print "hello world\r\n").

Any opposition?

--
Dave

Shawn Hoover

unread,
Jun 30, 2010, 10:14:17 AM6/30/10
to clo...@googlegroups.com
I never had a need for it, but I don't see a reason to oppose either. I tested your patch with cmd.exe, cygwin bash, and emacs modes, and it worked fine. The only thing that messed up was the swank-clojure REPL, showing ^M in any lines that were printed with println, but I think the swank-clojure server could bind the proposed var back to \n and all would be well.

Reply all
Reply to author
Forward
0 new messages