Add support for nested functions with the same name in different contexts
[fur] / examples / 31_nested_functions_same_name.fur
diff --git a/examples/31_nested_functions_same_name.fur b/examples/31_nested_functions_same_name.fur
new file mode 100644 (file)
index 0000000..3cbeb0c
--- /dev/null
@@ -0,0 +1,18 @@
+def get_incrementer(n) do
+  def foo(m) do
+    m + n
+  end
+
+  foo
+end
+
+def get_multiplier(n) do
+  def foo(m) do
+    m * n
+  end
+
+  foo
+end
+
+print(get_incrementer(2)(3), '\n')
+print(get_multiplier(2)(3), '\n')