guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 08/10: Skip tests that don't work under letrectification


From: Andy Wingo
Subject: [Guile-commits] 08/10: Skip tests that don't work under letrectification
Date: Sun, 18 Aug 2019 17:12:20 -0400 (EDT)

wingo pushed a commit to branch master
in repository guile.

commit 25be9f9c31c79f26e1a46c2d4802fdfac0bec6e2
Author: Andy Wingo <address@hidden>
Date:   Sun Aug 18 10:27:33 2019 +0200

    Skip tests that don't work under letrectification
    
    * test-suite/tests/srfi-64-test.scm: Skip a couple of tests that have
      unspecified result due to eq? being unspecified on procedures.
    * module/language/tree-il/letrectify.scm (letrectify): Add a comment.
---
 module/language/tree-il/letrectify.scm | 13 ++++++++++++-
 test-suite/tests/srfi-64-test.scm      | 18 ++++++++++--------
 2 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/module/language/tree-il/letrectify.scm 
b/module/language/tree-il/letrectify.scm
index 0802a72..8842025 100644
--- a/module/language/tree-il/letrectify.scm
+++ b/module/language/tree-il/letrectify.scm
@@ -166,7 +166,18 @@
   (define (residualize src mod name var expr)
     (let ((lexical (make-lexical-ref src name var)))
       (match expr
-        ;; Eta-expand so that we don't introduce functions-as-values.
+        ;; Eta-expand references to declarative procedure definitions so
+        ;; that adding these bindings to the module doesn't cause
+        ;; otherwise "well-known" (in the sense of closure conversion)
+        ;; procedures to become not well-known.
+        ;;
+        ;; Note, this means that eq? will always return #f when
+        ;; comparing a value to a <lexical-ref> of a declarative
+        ;; procedure definition, because the residualized reference is a
+        ;; fresh value (the <lambda> literal we return here).  This is
+        ;; permitted by R6RS as procedure equality is explicitly
+        ;; unspecified, but if it's an irritation in practice, we could
+        ;; disable this transformation.
         (($ <lambda> src1 meta
             ($ <lambda-case> src2 req #f rest #f () syms body #f))
          (let* ((syms (map gensym (map symbol->string syms)))
diff --git a/test-suite/tests/srfi-64-test.scm 
b/test-suite/tests/srfi-64-test.scm
index 3cd67d0..264c86f 100644
--- a/test-suite/tests/srfi-64-test.scm
+++ b/test-suite/tests/srfi-64-test.scm
@@ -666,18 +666,20 @@
 (test-end)
 
 (test-begin "8.2. test-runner-simple")
-(test-assert "8.2.1. default on-test hook"
-             (eq? (test-runner-on-test-end (test-runner-simple))
-                  test-on-test-end-simple))
-(test-assert "8.2.2. default on-final hook"
-             (eq? (test-runner-on-final (test-runner-simple))
-                  test-on-final-simple))
+;; Procedure equality is explicitly unspecified by R6RS.
+;; (test-assert "8.2.1. default on-test hook"
+;;              (eq? (test-runner-on-test-end (test-runner-simple))
+;;                   test-on-test-end-simple))
+;; (test-assert "8.2.2. default on-final hook"
+;;              (eq? (test-runner-on-final (test-runner-simple))
+;;                   test-on-final-simple))
 (test-end)
 
 (test-begin "8.3. test-runner-factory")
 
-(test-assert "8.3.1. default factory"
-             (eq? (test-runner-factory) test-runner-simple))
+;; Procedure equality is explicitly unspecified by R6RS.
+;; (test-assert "8.3.1. default factory"
+;;              (eq? (test-runner-factory) test-runner-simple))
 
 (test-assert "8.3.2. settable factory"
              (with-factory-saved



reply via email to

[Prev in Thread] Current Thread [Next in Thread]