with ASN1_Iterators.Iterable_Integer, ASN1_Iterators.Iterable_SeqOF, Ada.Text_IO; use ASN1_Iterators, Ada.Text_IO; procedure test_new_iterators is package MyInt is new ASN1_Iterators.Iterable_Integer (5, 10); It: MyInt.Instance; Iter: MyInt.Iterator := It.Iterate; C: MyInt.Cursor; -- SEQUENCE OF package MySeqOf is new ASN1_Iterators.Iterable_SeqOF (3, 5, MyInt.Custom_Iterator); ItSO : MySeqOf.Instance; IterSO : MySeqOf.Iterator := ItSO.Iterate; CSO : MySeqOf.Cursor; begin Put_Line ("Hello"); Put_Line ("With 'for each of':"); for each of It loop Put_Line (each'img); end loop; Put_Line ("With 'for each in':"); for each in It.Iterate loop Put_Line (It.Element (each)'Img); end loop; -- With manual iterators: Put_Line ("With manual iterators:"); C := Iter.First; while MyInt.Has_Element (C) loop Put_Line (It.Element (C)'Img); C := Iter.Next (C); end loop; Put_Line ("SeqOF manual iterators:"); CSO := IterSO.First; while MySeqOf.Has_Element (CSO) loop Put_Line ("Element"); -- ItSO.Element (CSO)'Img); CSO := IterSO.Next (CSO); end loop; end;