Searches within a deque.
position
behaves differently for arrays and strings:
-
If
haystack
is an array,needle
must be a callable value. We return the index of the first element in the array for which(needle elem)
returns a value other than#n
or#f
. If there is no such element, we return#n
. -
If
haystack
is a string,needle
can be either a character (in which case the index of the first matching character is returned) or a non-empty string (in which case the starting index of the first matching substring is returned).
When from
is specified, it must be an integer index, which acts as the starting point
for the search.