inheritance tree
ExtendableList
class definition
An ExtendableList instance provides the feature list, which is a list whose tail is unbound. The list is a stateless data structure. However, new list elements can be added at the tail of the list.
This datastructure is similar to a Port. The difference is that (i) the tail is not protected (no read-only variable) and (ii) the resulting stream can be closed, thus transforming the stream into a proper list.
NB: adding new list elements is a stateful operation (the binding of the internal attribute tail is changed), but the state is completely encapsulated in this data structure.
class ExtendableList (Inheritance-free)
prop locking
feat !ExtendableListType list
attr tail
- add(X)
Adds X to an extendable list in constant time. X becomes an element at the tail of List.
- addList(L)
- close()
Binds the tail of an extendable list to nil and that way 'closing' the list.
- init()
- put(X)
Alias for method add (Oz types like Dictionary define put instead of add).
end