#| -*-Scheme-*-
-$Id: usiexp.scm,v 1.5 1995/08/18 18:17:37 adams Exp $
+$Id: usiexp.scm,v 1.6 1995/08/29 14:56:39 adams Exp $
Copyright (c) 1988-1995 Massachusetts Institute of Technology
(global-ref/make name)
operands))
(if-not-expanded))))))
-
+
+ (define (make-global-operator spec)
+ (if (symbol? spec)
+ (let ((arity
+ (procedure-arity
+ (environment-lookup system-global-environment spec))))
+ `(,spec . ,(global-operator spec (car arity) (cdr arity))))
+ `(,(car spec) . ,(apply global-operator spec))))
\f
(define usual-integrations/expansion-alist
`((%record? . ,%record?-expansion)
(eighth . ,eighth-expansion)
(exact-integer? . ,exact-integer?-expansion)
(exact-rational? . ,exact-rational?-expansion)
- (expt . ,(global-operator 'EXPT 2))
(fifth . ,fifth-expansion)
(first . ,first-expansion)
(fix:<= . ,fix:<=-expansion)
(int:integer? . ,exact-integer?-expansion)
(list . ,list-expansion)
(make-string . ,make-string-expansion)
- (memq . ,(global-operator 'MEMQ 2))
;;(modulo . ,modulo-expansion)
(negative? . ,negative?-expansion)
(complex? . ,complex?-expansion)
(second . ,second-expansion)
(seventh . ,seventh-expansion)
(sixth . ,sixth-expansion)
- (sqrt . ,(global-operator 'SQRT 1))
(string->symbol . ,string->symbol-expansion)
(symbol? . ,symbol?-expansion)
(third . ,third-expansion)
(weak-pair? . ,weak-pair?-expansion)
(with-values . ,call-with-values-expansion)
(zero? . ,zero?-expansion)
+ ,@(map make-global-operator usual-integrations/global-operators)
))
usual-integrations/expansion-alist)
(set! usual-integrations/expansion-alist
(usual-integrations/make-expansion-alist))
unspecific)
+
+(define usual-integrations/global-operators
+ '(;; <name>: use binding in system-global-environment to obtain arity
+ ;; (<name> #!optional min-arity max-arity): as specified (for use for
+ ;; names that might not be bound when SF is loaded)
+ ACOS
+ ASIN
+ ATAN
+ COS
+ EXP
+ EXPT
+ FOR-EACH
+ LOG
+ MEMQ
+ SIN
+ SQRT
+ TAN
+ ))
\f
;;;; Hooks and utilities for user defined reductions and expanders