List_Iterator#(string string) s; // Object s is a
list-of-string iterator
class List_Iterator#(parameter type type T);
class List#(parameter type type T);
for
( List_Iterator#(int int)
p = lst.start; p.neq(lst.finish); p.next )
$display( p.data );
function
void add_sort( List#(byte
byte) L, byte
byte value );
for
( List_Iterator#( byte byte) p = L.start; p.neq(L.finish) ; p.next )
if
( p.data
> value ) begin
lst.insert( p, value ); // Add to sorted list (ascending order)
return;
end
endfunction