aboutsummaryrefslogtreecommitdiffstats
path: root/mulapply.scm
diff options
context:
space:
mode:
Diffstat (limited to 'mulapply.scm')
-rw-r--r--mulapply.scm22
1 files changed, 11 insertions, 11 deletions
diff --git a/mulapply.scm b/mulapply.scm
index 4f0853c..6c58959 100644
--- a/mulapply.scm
+++ b/mulapply.scm
@@ -1,5 +1,5 @@
; "mulapply.scm" Redefine APPLY take more than 2 arguments.
-;Copyright (C) 1991 Aubrey Jaffer
+;Copyright (C) 1991, 2003 Aubrey Jaffer
;
;Permission to copy this software, to modify it, to redistribute it,
;to distribute modified versions, and to use it for any purpose is
@@ -8,7 +8,7 @@
;1. Any copy made of this software must include this copyright notice
;in full.
;
-;2. I have made no warrantee or representation that the operation of
+;2. I have made no warranty or representation that the operation of
;this software will be error-free, and I am under no obligation to
;provide any services, by way of maintenance, update, or otherwise.
;
@@ -16,13 +16,13 @@
;material, there shall be no use of my name in any advertising,
;promotional, or sales literature without prior written consent in
;each case.
-
-(define two-arg:apply apply)
+;@
(define apply
- (lambda args
- (two-arg:apply (car args) (apply:append-to-last (cdr args)))))
-
-(define (apply:append-to-last lst)
- (if (null? (cdr lst))
- (car lst)
- (cons (car lst) (apply:append-to-last (cdr lst)))))
+ (letrec ((apply-2 apply)
+ (append-to-last
+ (lambda (lst)
+ (if (null? (cdr lst))
+ (car lst)
+ (cons (car lst) (append-to-last (cdr lst)))))))
+ (lambda args
+ (apply-2 (car args) (append-to-last (cdr args))))))