From d734e724684b3f0aaa4fa48f5e2a723b2a8f5944 Mon Sep 17 00:00:00 2001 From: Joe Marshall Date: Sat, 21 Jan 2012 17:10:56 -0800 Subject: [PATCH] Relocate a top-level variable. --- src/runtime/scomb.scm | 99 +------------------------------------------ src/sf/object.scm | 93 ++++++++++++++++++++++++++++++++++++++++ src/sf/sf.pkg | 2 - 3 files changed, 94 insertions(+), 100 deletions(-) diff --git a/src/runtime/scomb.scm b/src/runtime/scomb.scm index 7c730f087..10dbccea5 100644 --- a/src/runtime/scomb.scm +++ b/src/runtime/scomb.scm @@ -28,101 +28,7 @@ USA. ;;; package: (runtime scode-combinator) (declare (usual-integrations)) - -(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? - )))) + ;;;; 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) diff --git a/src/sf/object.scm b/src/sf/object.scm index 05c6be3dd..dc671e9be 100644 --- a/src/sf/object.scm +++ b/src/sf/object.scm @@ -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) diff --git a/src/sf/sf.pkg b/src/sf/sf.pkg index 2468fc75e..e2f4c7e16 100644 --- a/src/sf/sf.pkg +++ b/src/sf/sf.pkg @@ -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?)) -- 2.25.1