()
| 579 | } |
| 580 | |
| 581 | func ExampleList_Iterator_reverse() { |
| 582 | l := NewList[string]() |
| 583 | l = l.Append("foo") |
| 584 | l = l.Append("bar") |
| 585 | l = l.Append("baz") |
| 586 | |
| 587 | itr := l.Iterator() |
| 588 | itr.Last() |
| 589 | for !itr.Done() { |
| 590 | i, v := itr.Prev() |
| 591 | fmt.Println(i, v) |
| 592 | } |
| 593 | // Output: |
| 594 | // 2 baz |
| 595 | // 1 bar |
| 596 | // 0 foo |
| 597 | } |
| 598 | |
| 599 | func ExampleListBuilder_Append() { |
| 600 | b := NewListBuilder[string]() |