t3x.org / sketchy / library / map-car.html
SketchyLISP
Reference
  Copyright (C) 2007
Nils M Holm

map-car

Conformance: SketchyLISP Core

Purpose: Map a function over a list.

Arguments:
F - function to apply
A - list

Implementation:

(define (map-car f a)
  (letrec
    ((mapc
       (lambda (a r)
         (cond ((null? a) (reverse r))
           (else (mapc (cdr a)
                       (cons (f (car a)) r)))))))
    (mapc a '())))

Example:

:l lib/minus.scm -
(map-car - '(1 2 3)) 
=> (-1 -2 -3)

See also:
map, member, list?.