RosettaCodeData/Task/Search-a-list/Lang5/search-a-list.lang5
Ingy döt Net db842d013d A-M baby
2013-04-10 21:29:02 -07:00

9 lines
283 B
Text

: haystack(*) ['rosetta 'code 'search 'a 'list 'lang5 'code] find-index ;
: find-index
2dup eq length iota swap select swap drop
length if swap drop
else drop " is not in haystack" 2 compress "" join
then ;
: ==>search apply ;
['hello 'code] 'haystack ==>search .