Relocate a top-level variable.
authorJoe Marshall <eval.apply@gmail.com>
Sun, 22 Jan 2012 01:10:56 +0000 (17:10 -0800)
committerJoe Marshall <eval.apply@gmail.com>
Sun, 22 Jan 2012 01:10:56 +0000 (17:10 -0800)
src/runtime/scomb.scm
src/sf/object.scm
src/sf/sf.pkg

index 7c730f087d1e0d2855623c8c7a67c290e9337724..10dbccea584de406d63bbed920fd9efc0f8ae42b 100644 (file)
@@ -28,101 +28,7 @@ USA.
 ;;; package: (runtime scode-combinator)
 
 (declare (usual-integrations))
-\f
-(define (initialize-package!)
-  (set! combination/constant-folding-operators
-       (map (lambda (name)
-              (make-primitive-procedure name #t))
-            '(
-              &*
-              &+
-              &-
-              &/
-              -1+
-              1+
-              ASCII->CHAR
-              CELL?
-              CHAR->ASCII
-              CHAR->INTEGER
-              CHAR-ASCII?
-              CHAR-BITS
-              CHAR-CODE
-              CHAR-DOWNCASE
-              CHAR-UPCASE
-              COMPILED-CODE-ADDRESS->BLOCK
-              COMPILED-CODE-ADDRESS->OFFSET
-              DIVIDE-FIXNUM
-              EQ?
-              EQUAL-FIXNUM?
-              FIXNUM-AND
-              FIXNUM-ANDC
-              FIXNUM-LSH
-              FIXNUM-NOT
-              FIXNUM-OR
-              FIXNUM-QUOTIENT
-              FIXNUM-REMAINDER
-              FIXNUM-XOR
-              FLONUM-ABS
-              FLONUM-ACOS
-              FLONUM-ADD
-              FLONUM-ASIN
-              FLONUM-ATAN
-              FLONUM-ATAN2
-              FLONUM-CEILING
-              FLONUM-CEILING->EXACT
-              FLONUM-COS
-              FLONUM-DIVIDE
-              FLONUM-EQUAL?
-              FLONUM-EXP
-              FLONUM-EXPT
-              FLONUM-FLOOR
-              FLONUM-FLOOR->EXACT
-              FLONUM-GREATER?
-              FLONUM-LESS?
-              FLONUM-LOG
-              FLONUM-MULTIPLY
-              FLONUM-NEGATE
-              FLONUM-NEGATIVE?
-              FLONUM-POSITIVE?
-              FLONUM-ROUND
-              FLONUM-ROUND->EXACT
-              FLONUM-SIN
-              FLONUM-SQRT
-              FLONUM-SUBTRACT
-              FLONUM-TAN
-              FLONUM-TRUNCATE
-              FLONUM-TRUNCATE->EXACT
-              FLONUM-ZERO?
-              GCD-FIXNUM
-              GREATER-THAN-FIXNUM?
-              INDEX-FIXNUM?
-              INTEGER->CHAR
-              LESS-THAN-FIXNUM?
-              MAKE-CHAR
-              MAKE-NON-POINTER-OBJECT
-              MINUS-FIXNUM
-              MINUS-ONE-PLUS-FIXNUM
-              MULTIPLY-FIXNUM
-              NEGATIVE-FIXNUM?
-              NEGATIVE?
-              NOT
-              NULL?
-              OBJECT-TYPE
-              OBJECT-TYPE?
-              ONE-PLUS-FIXNUM
-              PAIR?
-              PLUS-FIXNUM
-              POSITIVE-FIXNUM?
-              POSITIVE?
-              PRIMITIVE-PROCEDURE-ARITY
-              ;; STRING->SYMBOL is a special case.  Strings can
-              ;; be side-effected, but it is useful to be able to
-              ;; constant fold this primitive anyway.
-              STRING->SYMBOL
-              STRING-LENGTH
-              ZERO-FIXNUM?
-              ZERO?
-              ))))
+
 \f
 ;;;; Sequence
 
@@ -246,9 +152,6 @@ USA.
 
 (define-guarantee combination "SCode combination")
 
-;; TODO(jmarshall): Remove or relocate this.
-(define combination/constant-folding-operators)
-
 (define (make-combination operator operands)
 
   (define-integrable (%make-combination-0 operator)
index 05c6be3dd06c3c01eb8e12bc92dafaa6fecdf0ad..dc671e9be990b76ad3cd78f90c949f270e51d24f 100644 (file)
@@ -350,6 +350,99 @@ USA.
 
 ;; Foldable operators primitives that are members of
 ;; combination/constant-folding-operators
+(define combination/constant-folding-operators
+  (map (lambda (name)
+        (make-primitive-procedure name #t))
+       '(
+        &*
+        &+
+        &-
+        &/
+        -1+
+        1+
+        ASCII->CHAR
+        CELL?
+        CHAR->ASCII
+        CHAR->INTEGER
+        CHAR-ASCII?
+        CHAR-BITS
+        CHAR-CODE
+        CHAR-DOWNCASE
+        CHAR-UPCASE
+        COMPILED-CODE-ADDRESS->BLOCK
+        COMPILED-CODE-ADDRESS->OFFSET
+        DIVIDE-FIXNUM
+        EQ?
+        EQUAL-FIXNUM?
+        FIXNUM-AND
+        FIXNUM-ANDC
+        FIXNUM-LSH
+        FIXNUM-NOT
+        FIXNUM-OR
+        FIXNUM-QUOTIENT
+        FIXNUM-REMAINDER
+        FIXNUM-XOR
+        FLONUM-ABS
+        FLONUM-ACOS
+        FLONUM-ADD
+        FLONUM-ASIN
+        FLONUM-ATAN
+        FLONUM-ATAN2
+        FLONUM-CEILING
+        FLONUM-CEILING->EXACT
+        FLONUM-COS
+        FLONUM-DIVIDE
+        FLONUM-EQUAL?
+        FLONUM-EXP
+        FLONUM-EXPT
+        FLONUM-FLOOR
+        FLONUM-FLOOR->EXACT
+        FLONUM-GREATER?
+        FLONUM-LESS?
+        FLONUM-LOG
+        FLONUM-MULTIPLY
+        FLONUM-NEGATE
+        FLONUM-NEGATIVE?
+        FLONUM-POSITIVE?
+        FLONUM-ROUND
+        FLONUM-ROUND->EXACT
+        FLONUM-SIN
+        FLONUM-SQRT
+        FLONUM-SUBTRACT
+        FLONUM-TAN
+        FLONUM-TRUNCATE
+        FLONUM-TRUNCATE->EXACT
+        FLONUM-ZERO?
+        GCD-FIXNUM
+        GREATER-THAN-FIXNUM?
+        INDEX-FIXNUM?
+        INTEGER->CHAR
+        LESS-THAN-FIXNUM?
+        MAKE-CHAR
+        MAKE-NON-POINTER-OBJECT
+        MINUS-FIXNUM
+        MINUS-ONE-PLUS-FIXNUM
+        MULTIPLY-FIXNUM
+        NEGATIVE-FIXNUM?
+        NEGATIVE?
+        NOT
+        NULL?
+        OBJECT-TYPE
+        OBJECT-TYPE?
+        ONE-PLUS-FIXNUM
+        PAIR?
+        PLUS-FIXNUM
+        POSITIVE-FIXNUM?
+        POSITIVE?
+        PRIMITIVE-PROCEDURE-ARITY
+        ;; STRING->SYMBOL is a special case.  Strings can
+        ;; be side-effected, but it is useful to be able to
+        ;; constant fold this primitive anyway.
+        STRING->SYMBOL
+        STRING-LENGTH
+        ZERO-FIXNUM?
+        ZERO?
+        )))
 
 (define (foldable-combination? operator operands)
   (and (constant? operator)
index 2468fc75e841f198435674d2d467e03142963a34..e2f4c7e169d34f6eaa0cf105792a48e0da6401ff 100644 (file)
@@ -36,8 +36,6 @@ USA.
          "usicon"
          "tables")
   (parent ())
-  (import (runtime scode-combinator)
-          combination/constant-folding-operators)
   (export ()
           sf:enable-argument-deletion?
           sf:enable-constant-folding?))