Objヤバイ
# type foo = { count : int };;
type foo = { count : int; }
# let x = { count = 4 };;
val x : foo = {count = 4}
# Obj.set_field (Obj.repr x) 0 (Obj.repr 8);;
- : unit = ()
# x;;
- : foo = {count = 8}
うぎゃ。Obj.set_field (Obj.repr x) 4 (Obj.repr 8) とかやったりすると何が起こるか想像もつかない。凄い。