Jonathan S. Shapiro wrote:
> The difference in our cases is that it is possible for two structures
> that do NOT have any inheritance (row extension) relationship to exist
> simultaneously in the same scope, where both structures have a field
> named "f".
>   
Actually, row-types in OCaml do indeed work like that.

let a = object method x = 0 method y = 0 end
let b = object method z = 1 method x = 0 method y = 0 end
let test_eq e f =
  (e#x = f#x) && (e#y = f#y)
let res = test_eq a b
(* Output:
val a : < x : int; y : int > = <obj>
val b : < x : int; y : int; z : int > = <obj>
val test_eq : < x : 'a; y : 'b; .. > -> < x : 'a; y : 'b; .. > -> bool = 
<fun>
val res : bool = true
*)

PKE.

-- 
Pål-Kristian Engstad ([EMAIL PROTECTED]), 
Lead Graphics & Engine Programmer,
Naughty Dog, Inc., 1601 Cloverfield Blvd, 6000 North,
Santa Monica, CA 90404, USA. Ph.: (310) 633-9112.

"It is better to have 100 functions operate on one data structure
 than 10 functions [each operate] on 10 data structures." -- NN


_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to