From 982e35bd0bd9bc9b55c0f898556c3e1831141258 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 19 Oct 2008 00:12:57 +0000 Subject: synonyms work --- README | 16 ++++++++++++++++ docs/help.txt | 2 +- docs/pod/fype.1.gz | Bin 6105 -> 6311 bytes docs/pod/fype.html | 14 ++++++++++++++ docs/pod/fype.man | 18 +++++++++++++++++- docs/pod/fype.pod | 13 +++++++++++++ docs/pod/fype.tex | 18 ++++++++++++++++++ docs/pod/fype.txt | 16 ++++++++++++++++ docs/stats.txt | 6 +++--- docs/version.txt | 2 +- examples/synonyms.fy | 32 ++++++++++++++++++++++++++++++++ fype | Bin 425663 -> 425827 bytes src/build.h | 2 +- src/core/interpret.c | 21 +++++++++++++++++++-- src/core/symbol.c | 3 +++ src/core/symbol.h | 2 ++ tmp/test.fy | 31 ++++++++++++++++++++++++++++++- 17 files changed, 186 insertions(+), 10 deletions(-) create mode 100644 examples/synonyms.fy diff --git a/README b/README index 66a9695..5c8b9b6 100644 --- a/README +++ b/README @@ -205,6 +205,22 @@ VARIABLES say foo; } +SYNONYMS TO VARIABLES/IDENTIFIERS + Each variable can have as many synonyms as wished. A synonym is another + name to access the content of a specific variable. Here is an example of + how to use synomyms: + + my foo = "foo"; + my bar = \foo; + foo = "bar"; + + # The synonym variable should now also set to "bar" + assert "bar" == bar; + + Synonyms can be used for all kind of identifiers. It's not limited to + normal variables but can be also used for function and procedure names + etc. + BUILT IN FUNCTIONS In Fype, operators are built in functions as well. The difference is, that they may be written in infix notation instead in front of the diff --git a/docs/help.txt b/docs/help.txt index ad6748e..0e73284 100644 --- a/docs/help.txt +++ b/docs/help.txt @@ -1,4 +1,4 @@ -Fype v0.1-devel Build 9215 +Fype v0.1-devel Build 9219 Copyright by Paul C. Buetow (2005 - 2008) -e Executes given code string (see synopses) -h Prints this help diff --git a/docs/pod/fype.1.gz b/docs/pod/fype.1.gz index e05d4c5..e39eee0 100644 Binary files a/docs/pod/fype.1.gz and b/docs/pod/fype.1.gz differ diff --git a/docs/pod/fype.html b/docs/pod/fype.html index b88a1b4..02c30c4 100644 --- a/docs/pod/fype.html +++ b/docs/pod/fype.html @@ -38,6 +38,7 @@
  • VARIABLES
  • +
  • SYNONYMS TO VARIABLES/IDENTIFIERS
  • BUILT IN FUNCTIONS