summary refs log tree commit diff
path: root/lib/slice.fnl
diff options
context:
space:
mode:
authordozens2024-05-29 19:26:41 -0600
committerdozens2024-06-02 21:44:17 -0600
commit7c07d6e6ececbf73e18a639e00b3690d4827e12a (patch)
tree7d948da1b634d100feb32215dd5d263c5b01ab8b /lib/slice.fnl
parentf265d24c0cacb92c7f7db19f364a155d87938184 (diff)
tests
Diffstat (limited to 'lib/slice.fnl')
-rw-r--r--lib/slice.fnl5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/slice.fnl b/lib/slice.fnl
new file mode 100644
index 0000000..4f0de0f
--- /dev/null
+++ b/lib/slice.fnl
@@ -0,0 +1,5 @@
+(fn slice [t start stop]
+  (fcollect [i start (or stop (length t))]
+    (. t i)))
+
+{: slice}