Welcome to the CHICKEN Scheme pasting service

map-match added by iterrogo on Wed Aug 13 19:39:30 2014

(define (map-match func list)
  (if (null? list)
      '()
      (cons (apply func (car list))
            (map-match func (cdr list)))))

(map-match
 (lambda (link-path text)
   `(li (a (@ (href ,link-path)) ,text)))
 '(("/projects" "my projects") (("/essays" "stuff I write"))))

; => ((li (a (@ (href "/projects")) "my projects")
;     (li (a (@ (href "/essays")) "stuff I write"))

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
What does `(string? 42)' produce?
Visually impaired? Let me spell it for you (wav file) download WAV