ITERABLE does not have do_while. ITERATOR does.
You can set a LINEAR_ITERATOR to have a_list as its target and then iterate on it as you like using the iterator.
You can also do the equivalent without any specific objects by using an across… loop.
-- BM
--
You received this message because you are subscribed to the Google Groups "Eiffel Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/eiffel-users/a168c672-d47a-4f7f-b4e8-a74f496c4cfdn%40googlegroups.com.
Dear Bill,
Again if you simply want to iterate on a list you don’t need any specific library mechanisms (other than the property that list classes inherit from ITERABLE). Just use “across”:
across a_list as l until nc loop whatever end
where nc is the negation of the “while” condition.
If you want to use a richer set of iterators then you can use the iterator classes. Lists and such are not iterators, so the corresponding classes do not have do_while etc. You can iterate *on* a list by using a distinct “iterator object”, which has the ability to perform all kinds of iteration schemes on any list (not just one). It chooses its victim at any particular stage by setting it to be its “target”, and then it can iterate on it to its heart’s content.
In other words `do_while’ is not performed by the list but on the list, *by* another object. (Actually that’s not in other words, it’s in the same words, just pushing the point.)
With best regards,
-- Bertrand Meyer
To view this discussion on the web visit https://groups.google.com/d/msgid/eiffel-users/6372b398-1a46-452c-aa90-d8621ed6fc6dn%40googlegroups.com.
Exactly.
To view this discussion on the web visit https://groups.google.com/d/msgid/eiffel-users/df87eb21-ee82-4053-90f7-2ff370807022n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/eiffel-users/df87eb21-ee82-4053-90f7-2ff370807022n%40googlegroups.com.