;;; 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
(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)
;; 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)
"usicon"
"tables")
(parent ())
- (import (runtime scode-combinator)
- combination/constant-folding-operators)
(export ()
sf:enable-argument-deletion?
sf:enable-constant-folding?))