summaryrefslogtreecommitdiff
path: root/doc/colm/1_04_functions.adoc
diff options
context:
space:
mode:
Diffstat (limited to 'doc/colm/1_04_functions.adoc')
-rw-r--r--doc/colm/1_04_functions.adoc25
1 files changed, 25 insertions, 0 deletions
diff --git a/doc/colm/1_04_functions.adoc b/doc/colm/1_04_functions.adoc
new file mode 100644
index 00000000..262a206b
--- /dev/null
+++ b/doc/colm/1_04_functions.adoc
@@ -0,0 +1,25 @@
+Functions
+=========
+
+The 'FizzBuzz' example gave us an good overview.
+
+== Arguments 'by reference'
+
+We can also pass parameters by reference.
+This enables us to change the variable with in the function.
+
+[source,chapel]
+./reference.lm
+----
+include::code/reference.lm[]
+----
+
+Compiling and running would give us:
+
+----
+in global global
+in SA global
+in SA sa
+in global sa
+----
+