title: Iterate TObjectList
body: <p>i have ObjectList container and i want to add an internal 
  iterator (Visitor Pattern) in fact i'm attempting to determine
  duplicates in my List..</p>
  
  <p>a sample: <a href="http://pastebin.com/pjeWq2uN" rel="nofollow">http://pastebin.com/pjeWq2uN</a></p>
  
  <p>this code to provide an insight of what i'm trying to achieve..</p>
  
  <pre><code>TFindDuplicatesMethod = procedure(s1, s2: string) of object;
  
  TPersonList = class(TObjectList)
  public
    procedure Iterate(pMethode: TFindDuplicatesMethod)
  end;
  
  procedure TPersonList.Iterate(pMethode: TFindDuplicatesMethod)
  var
    i: Integer;
  begin
    for i := 0 to Count - 1 do
    pMethode(TMyClass(Items[i]).S1, {But i don't have the second parameter because
                                 it comes from outside of PersonList Ex: OpenDialog.Files[i]})
  end;
  
  function FindDuplicate(S1, S2: string): Boolean;
  begin
    Result := False;
    if S1 = S2 then
    Result := True;
  end;
  
  begin
    Files.Iterate(FindDuplicates(S1, S2));
  end;
  </code></pre>
  
  <p>i'm wondering how OOP solve such problem.</p>
  
  <p>thank's in advance...</p>