iter-list.go: implemented the Typer interface

This commit is contained in:
Celestino Amoroso 2024-07-06 04:51:11 +02:00
parent fe5c8e9619
commit 0170baa0f5
2 changed files with 5 additions and 0 deletions

View File

@ -85,6 +85,10 @@ func (it *ListIterator) String() string {
return fmt.Sprintf("$(#%d)", l)
}
func (it *ListIterator) TypeName() string {
return "ListIterator"
}
func (it *ListIterator) HasOperation(name string) bool {
yes := name == resetName || name == indexName || name == countName
return yes

View File

@ -22,6 +22,7 @@ const (
)
type Iterator interface {
Typer
Next() (item any, err error) // must return io.EOF after the last item
Current() (item any, err error)
Index() int