{"action":"created","issue":{"url":"https://api.github.com/repos/t-sin/inquisitor/issues/20","labels_url":"https://api.github.com/repos/t-sin/inquisitor/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/t-sin/inquisitor/issues/20/comments","events_url":"https://api.github.com/repos/t-sin/inquisitor/issues/20/events","html_url":"https://github.com/t-sin/inquisitor/issues/20","id":105964990,"number":20,"title":"改行コードがcrlfだとsbclでread-lineの末尾にcrが紛れる問題","user":{"login":"cxxxr","id":13656378,"avatar_url":"https://avatars.githubusercontent.com/u/13656378?v=3","gravatar_id":"","url":"https://api.github.com/users/cxxxr","html_url":"https://github.com/cxxxr","followers_url":"https://api.github.com/users/cxxxr/followers","following_url":"https://api.github.com/users/cxxxr/following{/other_user}","gists_url":"https://api.github.com/users/cxxxr/gists{/gist_id}","starred_url":"https://api.github.com/users/cxxxr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cxxxr/subscriptions","organizations_url":"https://api.github.com/users/cxxxr/orgs","repos_url":"https://api.github.com/users/cxxxr/repos","events_url":"https://api.github.com/users/cxxxr/events{/privacy}","received_events_url":"https://api.github.com/users/cxxxr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-09-11T08:22:29Z","updated_at":"2015-09-11T13:29:38Z","closed_at":null,"body":"ライブラリを使う側でsbclとその他に分けて\r\nsbclならread-lineで得た文字列の末尾を除去しないといけません\r\nこれはinquisitor側でした方がいいと思います\r\n\r\nひとつめはwith-open-fileをinquisitor側でサポートしてgray-streamsを使う方法を考えました\r\nこのやり方だと万事うまくいきそうですがsbclのcrlfのためだけにこれをするのは冗長で実装が面倒です\r\n\r\nふたつめはwith-open-fileと一緒にdo-read-lineもinquisitor側でサポートします\r\n\r\n    (with-input-file ((in external-format) path ...)\r\n      (do-read-line ((string eof-p) in external-format)\r\n        ...))\r\n\r\nこうすると末尾のcrの除去を裏に隠せます\r\n\r\n変数external-formatを明示的に書いた理由は\r\nライブラリを使う側でファイルの保存時に文字コードを保つために必要だからです\r\nsbclなら改行コードも考慮する必要があるのでふたつ目の方法だとdo-print-line\r\nひとつ目の方法だと定義したstreamクラスのスロットににencodingとend-of-lineを入れておく必要があります"},"comment":{"url":"https://api.github.com/repos/t-sin/inquisitor/issues/comments/139546111","html_url":"https://github.com/t-sin/inquisitor/issues/20#issuecomment-139546111","issue_url":"https://api.github.com/repos/t-sin/inquisitor/issues/20","id":139546111,"user":{"login":"t-sin","id":4403863,"avatar_url":"https://avatars.githubusercontent.com/u/4403863?v=3","gravatar_id":"","url":"https://api.github.com/users/t-sin","html_url":"https://github.com/t-sin","followers_url":"https://api.github.com/users/t-sin/followers","following_url":"https://api.github.com/users/t-sin/following{/other_user}","gists_url":"https://api.github.com/users/t-sin/gists{/gist_id}","starred_url":"https://api.github.com/users/t-sin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/t-sin/subscriptions","organizations_url":"https://api.github.com/users/t-sin/orgs","repos_url":"https://api.github.com/users/t-sin/repos","events_url":"https://api.github.com/users/t-sin/events{/privacy}","received_events_url":"https://api.github.com/users/t-sin/received_events","type":"User","site_admin":false},"created_at":"2015-09-11T13:29:38Z","updated_at":"2015-09-11T13:29:38Z","body":"うわあ、ほんとだflexi-streams…。というか[win32:codepageが使えるのがLispWorks for Windowsのみ](http://weitz.de/flexi-streams/#external-formats)というだけでも不安しかない…。コードページと言ってもどのコードページなのかも謎ですが。Shift JISもどきのCP932なのか、何なのか。\r\n\r\nExternal-formatの丸めこみは、inquisitorで責任を持ちます。\r\nだけど、うーん、inquisitor.streamパッケージ誕生かな…？\r\n\r\nbabelのbabel-streamsでなんとかなりませんかね。ぼくは使ったことがないのでまだなんとも言えませんが…。"}}