subsequence-position

Returns the position where a pattern appears in a sequence.

Searches big for a subsequence that is element-for-element equal to pattern, as determined by the test argument.

test is applied to elements of successive subsequences of big and corresponding elements of the pattern to determine whether a match has occurred.  If a subsequence is found, subsequence-position returns the index at which the subsequence starts; otherwise, it returns #f.  If there is more than one match, count determines which subsequence is selected.  A count of 1 (the default) indicates that the first match should be returned.

subsequence-position ("Ralph Waldo Emerson", "Waldo")
⇒ 6

Exported from

Modifiers

open

Arguments

bigAn instance of <sequence>.
patternAn instance of <sequence>.
test:An instance of <function>.  The default is ==.
count:An instance of <integer>.  The default is 1.

Values

indexAn instance of type-union(<integer>, <false>).
Returns the position where a pattern appears in a sequence.
The common-dylan module.
Whenever possible, we have tried to keep the Dylan module pristine and unextended, preferring to add our extensions to separate modules or libraries.
The class of collections whose keys are consecutive integers starting from zero.
The class of objects that can be applied to arguments.
Compares two objects for identity.
The class of integers.