From Newsgroup: comp.lang.lisp
(defun find-indices (list test)
(loop for element in list
for index from 1
when (funcall test element) collect index))
Gauche Scheme
(define (find-indices xs test)
(filter-map
(lambda (x i) (and (test x) i))
xs
(lrange 1)))
(find-indices '(3 4 6 7) odd?)
===>
(1 4)
--- Synchronet 3.21d-Linux NewsLink 1.2