Among the Code Snippets, "Add with alternating signs" can be improved by replacing the principal procedure, given currently by the following macro definition:
(define-macro (+-)
(let (signs (cons 1 (series 1 -1 (- (length (args)) 1))))
(apply 'add (map 'mul (map eval (args)) signs))))
by a function which does the same thing:
(define (+-)
(let (signs (cons 1 (series 1 -1 (- (length (args)) 1))))
(apply add (map mul signs (args)))))
In addition to shortening the punchline, the function version will execute faster. Please let me know if I missed anything. Thanks! --Rick
Thanks Rick, I updated: http://newlisp.org/index.cgi?Tips_and_Tricks
Lutz