Re: sequence fracturing
- Posted by jeremy (admin) Sep 14, 2009
- 1322 views
useless said...
In the following:
include std/search.e sequence list = "ABCABAB" s = find_all('A',list) -- s is {1,4,6} return list[s] -- crashes here
Obviously, that is a useless bit of code, but it illustrates the problem. Can this be made to not crash, but to return as if i typed out list[1], list[4], list[6], or looped thru s? It just seems this should work.
You can modify your code slightly...
include std/search.e include std/sequence.e sequence list = "ABCABAB" s = find_all('A',list) -- s is {1,4,6} return extract(list, s))
Jeremy