diff options
Diffstat (limited to 'libtnsl/box/iterator.tnsl')
-rw-r--r-- | libtnsl/box/iterator.tnsl | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/libtnsl/box/iterator.tnsl b/libtnsl/box/iterator.tnsl new file mode 100644 index 0000000..13b9ef9 --- /dev/null +++ b/libtnsl/box/iterator.tnsl @@ -0,0 +1,40 @@ +/## + Copyright 2021 Kyle Gunger + + Dual licensed under the CDDL 1.0 and BSD 3-Clause licenses. + + This file may only be used in accordance with one of the two + licenses. You should have received a copy of each license with + the source code. In the event that you did not recieve a copy + of the licenses, they may be found at the following URLs: + + CDDL 1.0: + https://opensource.org/licenses/CDDL-1.0 + + BSD 3-Clause: + https://opensource.org/licenses/BSD-3-Clause + + THIS SOFTWARE/SOURCE CODE IS PROVIDED "AS IS" WITH NO + WARRANTY, GUARANTEE, OR CLAIM OF FITNESS FOR ANY PURPOSE + EXPRESS OR IMPLIED +#/ + +# Interface for moving through a list +/; interface ForwardsIterator (type T) + + # Advance to the next element in the list + /; next [bool] + ;/ + + # Get the current element in the list + /; current [T] + ;/ +;/ + +# Interface for moving through a list forwards or backwards +/; interface TwoWayIterator (type T) extends ForwardsIterator(T) + + # Move to the previous element in the list + /; prev [bool] + ;/ +;/
\ No newline at end of file |