summaryrefslogtreecommitdiffstats
path: root/mularg.scm
diff options
context:
space:
mode:
Diffstat (limited to 'mularg.scm')
-rw-r--r--mularg.scm20
1 files changed, 8 insertions, 12 deletions
diff --git a/mularg.scm b/mularg.scm
index e0ad203..4bfac03 100644
--- a/mularg.scm
+++ b/mularg.scm
@@ -1,14 +1,10 @@
;;; "mularg.scm" Redefine - and / to take more than 2 arguments.
-(define two-arg:/ /)
-(define two-arg:- -)
-(define / /)
-(define - -)
-(let ((maker
- (lambda (op)
- (lambda (d1 . ds)
- (cond ((null? ds) (op d1))
- ((null? (cdr ds)) (op d1 (car ds)))
- (else (for-each (lambda (d) (set! d1 (op d1 d))) ds) d1))))))
- (set! / (maker /))
- (set! - (maker -)))
+(define (mul:argumentizer op)
+ (lambda (d1 . ds)
+ (cond ((null? ds) (op d1))
+ ((null? (cdr ds)) (op d1 (car ds)))
+ (else (for-each (lambda (d) (set! d1 (op d1 d))) ds) d1))))
+;@
+(define / (let ((/ /)) (mul:argumentizer /)))
+(define - (let ((- -)) (mul:argumentizer -)))