diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2017-02-20 00:05:25 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2017-02-20 00:05:25 -0800 |
commit | 8ffbc2df0fde83082610149d24e594c1cd879f4a (patch) | |
tree | a2be9aad5101c5e450ad141d15c514bc9c2a2963 /mularg.scm | |
download | slib-8ffbc2df0fde83082610149d24e594c1cd879f4a.tar.gz slib-8ffbc2df0fde83082610149d24e594c1cd879f4a.zip |
Import Upstream version 2a6upstream/2a6
Diffstat (limited to 'mularg.scm')
-rw-r--r-- | mularg.scm | 10 |
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 -))) |