Jeffrey D. Ullman, "Elements of ML Programming", 1994 の翻訳書。子曰く『やりなさい!』。
Mac で走る 関数型言語 (佐原さんの ソフトウェア ページを参照) としては、Concurrent Clean System 1.3.2. とかあって、これのデモ動かしてると面白いんだけど、日本語で読める文献があるものとなると、 やっぱ ML (Standard ML of New Jersey) ですかね〜。
ベル研 にある新しい版 110 は Mac 版はなくて、それより古い版 93 だと Mac 用のもあるんだけど、 G3 カード差した 8500 だと動かないんだな、これが。MC68020 には MPU が要るよとか言って。
で、ようやく見つけたのが、
- Moscow ML for the Apple Macintosh
- Moscow ML implements the Core language of Standard ML (SML), as defined in the 1997 Definition of
Standard ML, and supports most required parts of the new SML Basis Library. Moscow ML also provides
a simple subset of the Standard ML Modules language, restricted to signatures and non-nested structures.
It supports separate compilation and the generation of stand-alone executables.
で、この本ですが、 ML ってズッコい。例えば相互再帰のとこ p.76 なんか、なんでこんなに簡単に書けちゃうの? 記述もコンパクトだし、リストでホイホイ操作しちゃうし。あ、それから用語も用例も Lisp の匂いがするような気がするんだけど気のせい? (ワタシは Lisper ではないので判断停止)
fun
take(L) =
if L = nil then nil
else hd(L)::skip(tl(L))
and
skip(L) =
if L = nil then nil
else take(tl(L));
これってウロボロスだよね〜。
その後の情報
- Standard ML of New Jersey 93 は SoftwareFPU を入れれば動くことが判明。
- SML/NJ 110 は "Should be ready for beta testing by the end of the year. You will need
MacOS 8.6 or 9.0."。
- Jeffrey D. Ullman, "Elements of ML Programming", は、すでに新しい 97 対応版が出版されている。邦訳は?