From be839900419c7a74c4a46efd279d0ca16b35dc1f Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 15 May 2008 23:28:07 +0000 Subject: Moved stuff into trunk. --- examples/functions.fy | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 examples/functions.fy (limited to 'examples/functions.fy') diff --git a/examples/functions.fy b/examples/functions.fy new file mode 100644 index 0000000..15856a0 --- /dev/null +++ b/examples/functions.fy @@ -0,0 +1,25 @@ +#* + * Examples of how to use functions + *# + +func foo { + say 1 + a * 3 + b; + + func bar { + say "Hello i am nested"; + } + + bar; # Calling nested +} + +my a = 2, b = 4; # Create global variables +foo; +assert 0 == (defined bar); # bar is not available anymore + +func baz { + say "I am baz"; + undef baz; +} + +baz; # Baz deletes itself +assert 0 == (defined baz); # baz is not available anymore -- cgit v1.2.3