Created
April 28, 2013 08:45
-
-
Save fetburner/5476312 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module IntRef = struct | |
type t = int ref | |
let compare a b = | |
(* Obj.magic注意!無理やりintにしてアドレスを得ている *) | |
let a_address : int = Obj.magic a in | |
let b_address : int = Obj.magic b in | |
(* Pervasivesを付けるのは趣味 *) | |
Pervasives.compare a_address b_address | |
end | |
(* 物理的等価性を見るint refの集合 *) | |
module IntRefSet = Set.Make (IntRef) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment