david135 / mosh-scheme

Automatically exported from code.google.com/p/mosh-scheme
Other
0 stars 0 forks source link

wrong handling of named characters in string output ports #183

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run the program:

#!r6rs
(import (rnrs))

(let-values (((port getter) (open-string-output-port)))
  (display #\tab port)
  (write (getter))
  (newline))

What is the expected output? What do you see instead?
It should print "\t".  It prints "x9;", that is the leading \ is missing.

What version of the product are you using? On what operating system?
Commit dbe442800118fec45e06f975b0e27aee92e8cd92.  i686-pc-linux-gnu.

Original issue reported on code.google.com by mrc....@gmail.com on 6 Jan 2011 at 9:45

GoogleCodeExporter commented 9 years ago

Original comment by hige...@gmail.com on 6 Jan 2011 at 12:56

GoogleCodeExporter commented 9 years ago

Original comment by hige...@gmail.com on 6 Jan 2011 at 12:56

GoogleCodeExporter commented 9 years ago
> (display #\tab port)
should be (put-char port #\tab) here.
But i had registered Issue 186 because DISPLAY should behave
like as you think.

Original comment by oku...@gmail.com on 9 Jan 2011 at 1:19

GoogleCodeExporter commented 9 years ago
Fixed 
https://github.com/higepon/mosh/commit/301fec9454bb46b78b2d2ffc13de609e7444aa65

Original comment by hige...@gmail.com on 9 Jan 2011 at 1:55

GoogleCodeExporter commented 9 years ago
With Mosh R6RS scheme interpreter, version 0.2.6 (revision master 2011/01/31 
20:40:07 mosh-0.2.5-402-gf225d2b) there is still something wrong:

$ vicare-script proof.sps
"\a\b\v\f"
$ petite-script proof.sps
"\a\b\v\f"
$ mosh-script proof.sps
"x7;x8;xB;xC;"

$ cat proof.sps
#!r6rs
(import (rnrs))

(let-values (((port getter) (open-string-output-port)))
  (display #\alarm port)
  (display #\backspace port)
  (display #\vtab port)
  (display #\page port)
  (write (getter)))
(newline)

Original comment by mrc....@gmail.com on 2 Feb 2011 at 6:32

GoogleCodeExporter commented 9 years ago
Thanks your help.
Fixed and added tests.

https://github.com/higepon/mosh/commit/e328044a3f485bdf8b7a1348a45f2a0f663e76fc

Original comment by hige...@gmail.com on 2 Feb 2011 at 11:12