home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 2 / RISC_DISC_2.iso / pd_share / program / language / scm / !Scm / slib / mulapply < prev    next >
Encoding:
Text File  |  1994-02-26  |  324 b   |  12 lines

  1. ;;;; "multapply.scm" Redefine APPLY take more than 2 arguments.
  2.  
  3. (define two-arg:apply apply)
  4. (define apply
  5.   (lambda args
  6.     (two-arg:apply (car args) (apply:append-to-last (cdr args)))))
  7.  
  8. (define (apply:append-to-last lst)
  9.   (if (null? (cdr lst))
  10.       (car lst)
  11.       (cons (car lst) (apply:append-to-last (cdr lst)))))
  12.