aboutsummaryrefslogtreecommitdiff
path: root/src/content/chapter0_basics/lesson17_lists/code.gleam
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/chapter0_basics/lesson17_lists/code.gleam')
-rw-r--r--src/content/chapter0_basics/lesson17_lists/code.gleam16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/content/chapter0_basics/lesson17_lists/code.gleam b/src/content/chapter0_basics/lesson17_lists/code.gleam
new file mode 100644
index 0000000..646ad6e
--- /dev/null
+++ b/src/content/chapter0_basics/lesson17_lists/code.gleam
@@ -0,0 +1,16 @@
+import gleam/io
+
+pub fn main() {
+ let ints = [1, 2, 3]
+
+ io.debug(ints)
+
+ // Immutably prepend
+ io.debug([-1, 0, ..ints])
+
+ // Uncomment this to see the error
+ // io.debug(["zero", ..ints])
+
+ // The original lists are unchanged
+ io.debug(ints)
+}