diff --git a/documentation/18.07/eiffel/Tutorials/Mini-HowTo/Iterate-on-a-LIST-and-removing-object.wiki b/documentation/18.07/eiffel/Tutorials/Mini-HowTo/Iterate-on-a-LIST-and-removing-object.wiki index fd59f2fa..52e4097a 100644 --- a/documentation/18.07/eiffel/Tutorials/Mini-HowTo/Iterate-on-a-LIST-and-removing-object.wiki +++ b/documentation/18.07/eiffel/Tutorials/Mini-HowTo/Iterate-on-a-LIST-and-removing-object.wiki @@ -1,13 +1,13 @@ -[[Property:modification_date|Fri, 07 Sep 2018 12:13:00 GMT]] +[[Property:modification_date|Mon, 10 Sep 2018 09:06:41 GMT]] [[Property:publication_date|Fri, 07 Sep 2018 12:13:00 GMT]] [[Property:uuid|78393BBA-9B1E-4523-9881-3D83CEB6A952]] [[Property:weight|3000]] [[Property:title|Removing object while iterating on a LIST]] -If you already have the object that you want to remove from the `LIST` you can easily use `prune` and `prune_all`. But if you want to remove objects while iterating on that `LIST`, depending on criteria on the objects contained in the `LIST`, here what you can do. +If you already have the object that you want to remove from the `LIST` you can easily use `prune` and `prune_all`. But if you want to remove objects while iterating on that `LIST`, depending on criteria on the objects contained in the `LIST`, here is what you can do. First of all, if you think about removing an object while iterating, I do not recommend using an `across` loop. If you iterate on the list using a `from until loop end`, just remember to use the `LIST.forth` only when you do not use `LIST.remove`. -For example, let's say we have class `MY_CLASS` with an attribute `has_stopped` and that I want to remove every object of a `LIST` that has this attribute set to `True`. Here what the code will look like. +For example, let's say we have class `MY_CLASS` with an attribute `has_stopped` and that I want to remove every object of a `LIST` that has this attribute set to `True`. Here is what the code will look like. removing_stopped (a_list: LIST [MY_CLASS])