Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- signature print_position =
- sig
- type position
- val print = position -> ()
- end
- datatype position2D =
- Position2D of real * real;
- datatype position3D =
- Position3D of real * real * real;
- structure Pos2D : print_position =
- struct
- type position = position2D
- val print pos = print("Position2D[" ^ Real.toString(#1 pos) ^ "," ^ Real.toString(#2 pos) ^ "]\n");
- end
- structure Pos3D : print_position =
- struct
- type position = position3D
- val print pos = print("Position3D[" ^ Real.toString(#1 pos) ^ "," ^ Real.toString(#2 pos) ^ "," ^ Real.toString(#3 pos) ^ "]\n");
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement