aboutsummaryrefslogtreecommitdiff
path: root/p99/p02.neb
diff options
context:
space:
mode:
Diffstat (limited to 'p99/p02.neb')
-rw-r--r--p99/p02.neb8
1 files changed, 8 insertions, 0 deletions
diff --git a/p99/p02.neb b/p99/p02.neb
new file mode 100644
index 0000000..317674e
--- /dev/null
+++ b/p99/p02.neb
@@ -0,0 +1,8 @@
+; P02 - Find the last two elements of a list.
+
+(def a (list "a" "b" "c" "d"))
+
+; slice takes the index (1-based) to begin
+; and, optionally, the length of the slice
+; (when missing, will grab until the end)
+(print (->string (slice a (- (length a) 1))))