From bc448b70cb83cce046e65fb4f69a28a84a53ff49 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Sat, 7 Aug 2021 08:04:33 -0400 Subject: Begin filling out spec + Add initial spec markdowns + Update copyright for libtnsl --- libtnsl/src/box/iterator.tnsl | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 libtnsl/src/box/iterator.tnsl (limited to 'libtnsl/src/box/iterator.tnsl') diff --git a/libtnsl/src/box/iterator.tnsl b/libtnsl/src/box/iterator.tnsl new file mode 100644 index 0000000..9fb3d6d --- /dev/null +++ b/libtnsl/src/box/iterator.tnsl @@ -0,0 +1,40 @@ +/## + Copyright 2021 Kyle Gunger + + Dual licenced under the CDDL 1.0 and BSD 3-Clause licences. + + This file may only be used in accordance with one of the two + licences. You should have recieved a copy of each licence with + the source code. In the event that you did not recieve a copy + of the licences, 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 + WARRENTY, 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 -- cgit v1.2.3