[Top][All Lists]

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

[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.6-33-gbcf87e

From: Mark H Weaver
Subject: [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.6-33-gbcf87e3
Date: Mon, 08 Oct 2012 04:41:25 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

The branch, stable-2.0 has been updated
       via  bcf87e35e17741c279b755b0804776cdc8ee5828 (commit)
      from  ebd363161ef533833fc48c3389075bf4db7ebe17 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit bcf87e35e17741c279b755b0804776cdc8ee5828
Author: Mark H Weaver <address@hidden>
Date:   Mon Oct 8 00:37:09 2012 -0400

    Don't simplify 'equal?' to 'not' or 'null?'.
    * module/language/tree-il/primitives.scm (*primitive-expand-table*):
      Don't simplify 'equal?' to 'not' or 'null?', but only to 'eq?'.
    * test-suite/tests/tree-il.test ("primitives"): Adjust tests.


Summary of changes:
 module/language/tree-il/primitives.scm |   25 ++++++++-----------------
 test-suite/tests/tree-il.test          |    8 ++++----
 2 files changed, 12 insertions(+), 21 deletions(-)

diff --git a/module/language/tree-il/primitives.scm 
index 0c5b085..c3cd8c6 100644
--- a/module/language/tree-il/primitives.scm
+++ b/module/language/tree-il/primitives.scm
@@ -498,23 +498,14 @@
                (define (maybe-simplify a b)
                  (and (const? a)
                       (let ((v (const-exp a)))
-                        (cond
-                         ((eq? #f v)
-                          (make-application src (make-primitive-ref #f 'not)
-                                            (list b)))
-                         ((eq? '() v)
-                          (make-application src (make-primitive-ref #f 'null?)
-                                            (list b)))
-                         ((or (eq? #t v)
-                              (eq? #nil v)
-                              (symbol? v)
-                              (and (integer? v)
-                                   (exact? v)
-                                   (<= v most-positive-fixnum)
-                                   (>= v most-negative-fixnum)))
-                          (make-application src (make-primitive-ref #f 'eq?)
-                                            (list a b)))
-                         (else #f)))))
+                        (and (or (memq v '(#f #t () #nil))
+                                 (symbol? v)
+                                 (and (integer? v)
+                                      (exact? v)
+                                      (<= v most-positive-fixnum)
+                                      (>= v most-negative-fixnum)))
+                             (make-application src (make-primitive-ref #f 'eq?)
+                                               (list a b))))))
                (or (maybe-simplify a b) (maybe-simplify b a)))
               (else #f)))
diff --git a/test-suite/tests/tree-il.test b/test-suite/tests/tree-il.test
index 0a53037..008eb83 100644
--- a/test-suite/tests/tree-il.test
+++ b/test-suite/tests/tree-il.test
@@ -87,12 +87,12 @@
 (with-test-prefix "primitives"
-   (apply (primitive equal?) (toplevel x) (const #f))
-   (apply (primitive not) (toplevel x)))
+   (apply (primitive equal?) (const #f) (toplevel x))
+   (apply (primitive eq?) (const #f) (toplevel x)))
-   (apply (primitive equal?) (toplevel x) (const ()))
-   (apply (primitive null?) (toplevel x)))
+   (apply (primitive equal?) (const ()) (toplevel x))
+   (apply (primitive eq?) (const ()) (toplevel x)))
    (apply (primitive equal?) (const #t) (lexical x y))

GNU Guile

reply via email to

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