[C--] Bug in Lua-ML

Michael Ekstrand <[email protected]> Wed, 17 Mar 2010 13:50:38 -0500
Newsgroups gmane.comp.lang.c--
Message-ID <[email protected]>
I have found today a small bug in Lua-ML -- the record Project function
attempts to project the value as both the key and the value, rather than
correctly projecting the key for the first element of the resulting
list.  I have pasted below a patch which fixes this.

Posting here was the only feedback mechanism I could locate on the C--
projects page; if there is another venue that would be better for
reporting Lua-ML bugs, please let me know.

Thanks,
- Michael

Index: luavalue.nw
===================================================================
--- luavalue.nw.orig	2005-05-13 18:28:40.000000000 -0500
+++ luavalue.nw	2010-03-17 09:53:03.000000000 -0500
@@ -470,7 +470,7 @@
 let projectRecord ty v = match v with
 | Table t ->
     let rec addpairs (k, v) =
-      (string.project v, ty.project v) ::
+      (string.project k, ty.project v) ::
       try addpairs (Luahash.next t k) with Not_found -> [] in
     (try addpairs (Luahash.first t) with Not_found -> [])
 | _ -> raise (Projection (v, "table (as record)"))

_______________________________________________
Cminusminus mailing list
[email protected]
https://lists.eecs.harvard.edu/mailman/listinfo/cminusminus