Wade Humeniuk wrote:
(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 0)))
(find-indices '(-9 0 3 4 5) odd?)
'(0 2 4)
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)