From d4657a5d7029ea66d19a5d238a9dd6bf75fe5bb0 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 19 Oct 2008 00:24:01 +0000 Subject: jo --- examples/all-examples.txt | 33 +++++++++++++++++++++++++++++++++ src/build.h | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/examples/all-examples.txt b/examples/all-examples.txt index bdf199f..b438de3 100644 --- a/examples/all-examples.txt +++ b/examples/all-examples.txt @@ -296,6 +296,39 @@ assert 0 == (say defined bar); +#* + * Examples of how to use synonyms + *# + +# Create a variable foo, and bar is a synonym for foo +my foo = "foo"; +my bar = \foo; + +# Reset the value of foo +foo = "bar"; + +# The synonym variable should now also set to "bar" +assert "bar" == say bar; + +# Create a new procedure baz +proc baz { + say "I am baz"; +} + +# Make a synonym baz, and undefine baz +my bay = \baz; +undef baz; + +# bay still has a reference of the original procedure baz +bay; # this prints aut "I am baz" + +assert 0 == defined baz; +assert 1 == defined bay; + +# This removes the procedure from memory +undef bay; + + #* * Examples how to convert types *# diff --git a/src/build.h b/src/build.h index 4e73ee5..61eb78f 100644 --- a/src/build.h +++ b/src/build.h @@ -35,7 +35,7 @@ #ifndef BUILD_H #define BUILD_H -#define BUILDNR 9233 +#define BUILDNR 9235 #define OS_FREEBSD #endif -- cgit v1.2.3