summaryrefslogtreecommitdiffstats
path: root/mularg.scm
blob: e0ad20398a2632ea7bc38b54a3f5c65604cb42f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
;;; "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 -)))