aboutsummaryrefslogtreecommitdiffstats
path: root/mularg.scm
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:29 -0800
committerBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:29 -0800
commit8466d8cfa486fb30d1755c4261b781135083787b (patch)
treec8c12c67246f543c3cc4f64d1c07e003cb1d45ae /mularg.scm
parent87b82b5822ca54228cfa6df29be3ad9d4bc47d16 (diff)
downloadslib-8466d8cfa486fb30d1755c4261b781135083787b.tar.gz
slib-8466d8cfa486fb30d1755c4261b781135083787b.zip
Import Upstream version 3a1upstream/3a1
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 -)))