summary refs log tree commit diff
path: root/examples/5.src
diff options
context:
space:
mode:
Diffstat (limited to 'examples/5.src')
-rw-r--r--examples/5.src13
1 files changed, 9 insertions, 4 deletions
diff --git a/examples/5.src b/examples/5.src
index 573ee6a..d9a8dad 100644
--- a/examples/5.src
+++ b/examples/5.src
@@ -1,8 +1,13 @@
-let print_input = (input) => {
-	print(input);
-	return input;
+let foo = () => {
+	let x = 1;
+	print(x);
+	return x;
 };
 
 let main = () => {
-	return print_input(7);
+	let x = 2;
+	/* As you see, the language supports variable scopes */
+	foo();
+	print(x);
+	return x;
 };