aboutsummaryrefslogtreecommitdiffstats
path: root/mularg.scm
diff options
context:
space:
mode:
Diffstat (limited to 'mularg.scm')
-rw-r--r--mularg.scm10
1 files changed, 10 insertions, 0 deletions
diff --git a/mularg.scm b/mularg.scm
new file mode 100644
index 0000000..3d62cf4
--- /dev/null
+++ b/mularg.scm
@@ -0,0 +1,10 @@
+;;; "mularg.scm" Redefine - and / to take more than 2 arguments.
+
+(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 -)))