2006-09-18から1日間の記事一覧

RTTI

実行する時とかに -dinstr オプションをつけるとバイトコードが出るそうです。 let _ = print_int 12345; ()みたいなコードは、 i@u ~/test/ocaml> gcaml -dinstr pr_test.ml const 12345 push getglobal Pervasives! getfield 30 apply 1 const 0a return 1…

G'Caml 学習帳

なんかやはり enum は print できないとダメですよね!ということで MetaOCaml は中一までだったかもと思ったとか。http://d.hatena.ne.jp/sumii/20060918/1158537612#c1158545128 type a = A type b = B of int let _ = Gprint.eprint "aaaa"; Gprint.eprin…

MetaOCaml 学習帳

OCaml は小学生までかなぁと思ったので立派な中二になるべく。とりあえず unless でも書いてみる。 let unless cond no = if not cond then no else .< () >. let _ = .! (unless true .<print_string "hello true\n">.); .! (unless false .<print_string "hello false\n">.);読みにくいなぁ。ちょっとした構文拡張に使</print_string></print_string>…

なにかあれば下記メールアドレスへ。
shinichiro.hamaji _at_ gmail.com
shinichiro.h