list-member-find
Name
list-member-find -- Returns the index of an element in a list
Synopsis
(list-member-find element elementlist)
Description
Returns the index of element in the list elementlist. The
first element in a list has index 0.
Author
Norman Walsh, <ndw@nwalsh.com>
Source Code
(define (list-member-find element elementlist)
;; Returns the index of an element in a list
(let loop ((elemlist elementlist) (count 0))
(if (null? elemlist)
-1
(if (equal? element (car elemlist))
count
(loop (cdr elemlist) (+ count 1))))))