1. sequence fracturing
- Posted by useless Sep 14, 2009
- 1310 views
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.
useless
2. Re: sequence fracturing
- Posted by DerekParnell (admin) Sep 14, 2009
- 1276 views
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.
This is one of the things we planned for v4.1. along with
R = S[1,4,6] R = S[1 .. 4, 6 .. 7, 5]
3. Re: sequence fracturing
- Posted by jeremy (admin) Sep 14, 2009
- 1320 views
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