samrushing / irken-compiler

Irken is a statically typed variant of Scheme. Or a lisp-like variant of ML.

Home Page:http://nightmare.com/rushing/irken.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Duplicate field names in record literals.

samrushing opened this issue · comments

{a=1 b=2 a=3} makes it all the way to the C compiler before failing.

The type signature for %rextend is accidentally using a "free extension" sig.

Sam says this is fixed with a patch he applied and hasn't hit the mainline yet.

@@ -533,14 +536,16 @@
       '%rmake       -> (:scheme '() (arrow (rproduct (rdefault (rabs)))
'()))
       '%ensure-heap -> (:scheme '() (arrow undefined-type (LIST int-type)))
       '%rextend     -> (match params with
-                        (sexp:symbol label)
-                        -> (let ((plabel (make-label label)))
-                             (:scheme (LIST T0 T1 T2)
-                                      (arrow (rproduct (rlabel plabel
(rpre T2) T1))
-                                             (LIST
-                                              (rproduct (rlabel plabel
T0 T1))
-                                              T2))))
-                        _ -> (prim-error name))
+                         (sexp:symbol label)
+                         -> (let ((plabel (make-label label)))
+                              ;; forall('a,'b).({lab=(abs) 'a} 'b ->
{lab=(pre 'b) 'a})
+                              (:scheme (LIST T0 T1)
+                                       (arrow (rproduct (rlabel plabel
(rpre T1) T0))
+                                              (LIST
+                                               (rproduct (rlabel plabel
(rabs) T0))
+                                               T1)))
+                              )
+                         _ -> (prim-error name))