summaryrefslogtreecommitdiff
path: root/docs/pod
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2008-10-19 17:48:21 +0000
committerPaul Buetow <paul@buetow.org>2008-10-19 17:48:21 +0000
commit3d7b35bb37c066489546751e100c2c2b823ccba3 (patch)
treea507be11afc3c55807e254ce5b24c5412367aa46 /docs/pod
parentd4657a5d7029ea66d19a5d238a9dd6bf75fe5bb0 (diff)
refs and syms
Diffstat (limited to 'docs/pod')
-rw-r--r--docs/pod/fype.1.gzbin6311 -> 6475 bytes
-rw-r--r--docs/pod/fype.html26
-rw-r--r--docs/pod/fype.man43
-rw-r--r--docs/pod/fype.pod26
-rw-r--r--docs/pod/fype.tex34
-rw-r--r--docs/pod/fype.txt26
6 files changed, 147 insertions, 8 deletions
diff --git a/docs/pod/fype.1.gz b/docs/pod/fype.1.gz
index e39eee0..64bebfb 100644
--- a/docs/pod/fype.1.gz
+++ b/docs/pod/fype.1.gz
Binary files differ
diff --git a/docs/pod/fype.html b/docs/pod/fype.html
index 02c30c4..6400295 100644
--- a/docs/pod/fype.html
+++ b/docs/pod/fype.html
@@ -38,7 +38,7 @@
</ul>
<li><a href="#variables">VARIABLES</a></li>
- <li><a href="#synonyms_to_variables_identifiers">SYNONYMS TO VARIABLES/IDENTIFIERS</a></li>
+ <li><a href="#synonyms">SYNONYMS</a></li>
<li><a href="#built_in_functions">BUILT IN FUNCTIONS</a></li>
<ul>
@@ -311,7 +311,7 @@ not.</p>
<p>
</p>
<hr />
-<h1><a name="synonyms_to_variables_identifiers">SYNONYMS TO VARIABLES/IDENTIFIERS</a></h1>
+<h1><a name="synonyms">SYNONYMS</a></h1>
<p>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:</p>
<pre>
my foo = &quot;foo&quot;;
@@ -321,6 +321,28 @@ not.</p>
# The synonym variable should now also set to &quot;bar&quot;
assert &quot;bar&quot; == bar;</pre>
<p>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.</p>
+<pre>
+ # Create a new procedure baz
+ proc baz { say &quot;I am baz&quot;; }</pre>
+<pre>
+ # Make a synonym baz, and undefine baz
+ my bay = \baz;</pre>
+<pre>
+ undef baz;</pre>
+<pre>
+ # bay still has a reference of the original procedure baz
+ bay; # this prints aut &quot;I am baz&quot;</pre>
+<p>The <strong>syms</strong> keyword gives you the total number of synonyms pointing to a specific value:</p>
+<pre>
+ my foo = 1;
+ say syms foo; # Prints 1</pre>
+<pre>
+ my baz = \foo;
+ say syms foo; # Prints 2
+ say syms baz; # Prints 2</pre>
+<pre>
+ undef baz;
+ say syms foo; # Prints 1</pre>
<p>
</p>
<hr />
diff --git a/docs/pod/fype.man b/docs/pod/fype.man
index 42daf43..36f3ef2 100644
--- a/docs/pod/fype.man
+++ b/docs/pod/fype.man
@@ -129,7 +129,7 @@
.\" ========================================================================
.\"
.IX Title "FYPE 1"
-.TH FYPE 1 "2008-10-19" "Fype v0.1-devel Build 9219" "The Fype Users Manual Page"
+.TH FYPE 1 "2008-10-19" "Fype v0.1-devel Build 9240" "The Fype Users Manual Page"
.SH "NAME"
\&\fBFype\fR is \fBF\fRor \fBY\fRour \fBP\fRrogram \fBE\fRxecution
.PP
@@ -345,8 +345,8 @@ not.
\& say foo;
\& }
.Ve
-.SH "SYNONYMS TO VARIABLES/IDENTIFIERS"
-.IX Header "SYNONYMS TO VARIABLES/IDENTIFIERS"
+.SH "SYNONYMS"
+.IX Header "SYNONYMS"
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:
.PP
.Vb 3
@@ -361,6 +361,43 @@ Each variable can have as many synonyms as wished. A synonym is another name to
.Ve
.PP
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.
+.PP
+.Vb 2
+\& # Create a new procedure baz
+\& proc baz { say "I am baz"; }
+.Ve
+.PP
+.Vb 2
+\& # Make a synonym baz, and undefine baz
+\& my bay = \ebaz;
+.Ve
+.PP
+.Vb 1
+\& undef baz;
+.Ve
+.PP
+.Vb 2
+\& # bay still has a reference of the original procedure baz
+\& bay; # this prints aut "I am baz"
+.Ve
+.PP
+The \fBsyms\fR keyword gives you the total number of synonyms pointing to a specific value:
+.PP
+.Vb 2
+\& my foo = 1;
+\& say syms foo; # Prints 1
+.Ve
+.PP
+.Vb 3
+\& my baz = \efoo;
+\& say syms foo; # Prints 2
+\& say syms baz; # Prints 2
+.Ve
+.PP
+.Vb 2
+\& undef baz;
+\& say syms foo; # Prints 1
+.Ve
.SH "BUILT IN FUNCTIONS"
.IX Header "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 arguments. The types inside the () specify the return types.
diff --git a/docs/pod/fype.pod b/docs/pod/fype.pod
index 2773c4e..1e29a6d 100644
--- a/docs/pod/fype.pod
+++ b/docs/pod/fype.pod
@@ -219,7 +219,7 @@ not.
say foo;
}
-=head1 SYNONYMS TO VARIABLES/IDENTIFIERS
+=head1 SYNONYMS
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:
@@ -232,6 +232,30 @@ Each variable can have as many synonyms as wished. A synonym is another name to
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.
+ # 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"
+
+The B<syms> keyword gives you the total number of synonyms pointing to a specific value:
+
+ my foo = 1;
+ say syms foo; # Prints 1
+
+ my baz = \foo;
+ say syms foo; # Prints 2
+ say syms baz; # Prints 2
+
+ undef baz;
+ say syms foo; # Prints 1
+
+
=head1 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 arguments. The types inside the () specify the return types.
diff --git a/docs/pod/fype.tex b/docs/pod/fype.tex
index 19fa9f2..8bdd585 100644
--- a/docs/pod/fype.tex
+++ b/docs/pod/fype.tex
@@ -272,7 +272,7 @@ not.
say foo;
}
\end{verbatim}
-\section{SYNONYMS TO VARIABLES/IDENTIFIERS\label{SYNONYMS_TO_VARIABLES_IDENTIFIERS}\index{SYNONYMS TO VARIABLES/IDENTIFIERS}}
+\section{SYNONYMS\label{SYNONYMS}\index{SYNONYMS}}
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:
@@ -290,6 +290,38 @@ Each variable can have as many synonyms as wished. A synonym is another name to
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.
+\begin{verbatim}
+ # Create a new procedure baz
+ proc baz { say "I am baz"; }
+\end{verbatim}
+\begin{verbatim}
+ # Make a synonym baz, and undefine baz
+ my bay = \baz;
+\end{verbatim}
+\begin{verbatim}
+ undef baz;
+\end{verbatim}
+\begin{verbatim}
+ # bay still has a reference of the original procedure baz
+ bay; # this prints aut "I am baz"
+\end{verbatim}
+
+
+The \textbf{syms} keyword gives you the total number of synonyms pointing to a specific value:
+
+\begin{verbatim}
+ my foo = 1;
+ say syms foo; # Prints 1
+\end{verbatim}
+\begin{verbatim}
+ my baz = \foo;
+ say syms foo; # Prints 2
+ say syms baz; # Prints 2
+\end{verbatim}
+\begin{verbatim}
+ undef baz;
+ say syms foo; # Prints 1
+\end{verbatim}
\section{BUILT IN FUNCTIONS\label{BUILT_IN_FUNCTIONS}\index{BUILT IN FUNCTIONS}}
diff --git a/docs/pod/fype.txt b/docs/pod/fype.txt
index 5c8b9b6..4e82ce6 100644
--- a/docs/pod/fype.txt
+++ b/docs/pod/fype.txt
@@ -205,7 +205,7 @@ VARIABLES
say foo;
}
-SYNONYMS TO VARIABLES/IDENTIFIERS
+SYNONYMS
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:
@@ -221,6 +221,30 @@ SYNONYMS TO VARIABLES/IDENTIFIERS
normal variables but can be also used for function and procedure names
etc.
+ # 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"
+
+ The syms keyword gives you the total number of synonyms pointing to a
+ specific value:
+
+ my foo = 1;
+ say syms foo; # Prints 1
+
+ my baz = \foo;
+ say syms foo; # Prints 2
+ say syms baz; # Prints 2
+
+ undef baz;
+ say syms foo; # Prints 1
+
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