[MLton-commit] r5569

Matthew Fluet fluet at mlton.org
Wed May 23 07:04:15 PDT 2007


Allow nested indirect types in FFI.
----------------------------------------------------------------------

U   mlton/branches/on-20050822-x86_64-branch/mlton/elaborate/elaborate-core.fun

----------------------------------------------------------------------

Modified: mlton/branches/on-20050822-x86_64-branch/mlton/elaborate/elaborate-core.fun
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlton/elaborate/elaborate-core.fun	2007-05-20 21:13:16 UTC (rev 5568)
+++ mlton/branches/on-20050822-x86_64-branch/mlton/elaborate/elaborate-core.fun	2007-05-23 14:04:14 UTC (rev 5569)
@@ -772,17 +772,17 @@
                            Tycon.equals (c, c')),
                 fn {ctype, name, ...} => {ctype = ctype, name = name})
 
-      fun toUnaryCType (t: t): {ctype: CType.t, name: string} option =
+      and toUnaryCType (t: t): {ctype: CType.t, name: string} option =
          case deConOpt t of
             NONE => NONE
           | SOME (c, ts) =>
                if List.exists (unary, fn c' => Tycon.equals (c, c'))
                   andalso 1 = Vector.length ts
-                  andalso isSome (toNullaryCType (Vector.sub (ts, 0)))
+                  andalso isSome (toCType (Vector.sub (ts, 0)))
                   then SOME {ctype = CType.objptr, name = "Objptr"}
                   else NONE
 
-      fun toCType (ty: t): {ctype: CType.t, name: string} option =
+      and toCType (ty: t): {ctype: CType.t, name: string} option =
          case toNullaryCType ty of
             NONE => toUnaryCType ty
           | SOME {ctype, name} => SOME {ctype = ctype, name = name}




More information about the MLton-commit mailing list