The most recent topic is about string containing #\x0 (or #\null).
poll: invalid item #315 from 5th ballotThe #315 is about the following code won't raise any error.
(string-set! s i #\null)For me, it seems totally fine. But for them, or even Unicode world, it's not fine. Really?
Well, either way the above expression on Sagittarius will be totally fine for any time. So, I don't have any intension to change current behaviour.
The reason I'm writing this article is I found a curious experience in the topic. How does the following code work on R6RS implementations? Original was about Chicken and Gambit.
(import (rnrs)) (define file (string #\a #\x0 #\b)) (when (file-exists? file) (delete-file file)) (let ((o (open-file-output-port file))) (put-bytevector o (string->utf8 "hello")) (close-port o))The file is definitely invalid file path.
The results are like this;
Implementation | Result |
---|---|
Chez | Made 'a' file |
Larceny | Made 'a' file |
Mosh | Made 'a' file |
Racket | Raised an error |
Sagittarius | Made 'a' file |
Ypsilon | Made 'a' file |
No comments:
Post a Comment