PLTのヘッダ

最近、Dr Schemeでフィアルを保存すると、

;; The first three lines of this file were inserted by DrScheme. They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-beginner-reader.ss" "lang")((modname a) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ())))

みたいなヘッダが付くことがあるようになったらしい。

さて、Dr Schemeで書いたスクリプトGaucheにロードするにはどうすれば良いか。

リーダーマクロってなかったっけ?

shiro (2008/02/01 02:53:08):
リーダーマクロはいずれつけるつもりですが、(略)

http://practical-scheme.net/wiliki/wiliki.cgi?Gauche%3A%24

無かった……org

んー。Rubyで書き換えてとりあえず最初の三行無視するようにすれば良さげだけど、どうしたもんかなぁ。

def sanitize(src)
  src.gsub(/^;;.*\n^;;.*\n^#reader.*\n/, '')
end

くらいで本当にうまく行くかどうか。

あとでやる。