summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2008-10-18 22:47:31 +0000
committerPaul Buetow <paul@buetow.org>2008-10-18 22:47:31 +0000
commitcb1450b796eff3c8830616e2e9a3d83d4dfb4900 (patch)
tree1ed2b992f9b082cf82913abeaff8c208ecab67dd /docs
parenta35ace22b374005c65bda8302761d24f75280170 (diff)
backdowngrade
Diffstat (limited to 'docs')
-rw-r--r--docs/header.txt2
-rw-r--r--docs/help.txt2
-rw-r--r--docs/pod/fype.1.gzbin6302 -> 6105 bytes
-rw-r--r--docs/pod/fype.html191
-rw-r--r--docs/pod/fype.man157
-rw-r--r--docs/pod/fype.pod142
-rw-r--r--docs/pod/fype.tex154
-rw-r--r--docs/pod/fype.txt392
-rw-r--r--docs/stats.txt4
-rw-r--r--docs/version.txt2
10 files changed, 458 insertions, 588 deletions
diff --git a/docs/header.txt b/docs/header.txt
index 651e6e9..d673a17 100644
--- a/docs/header.txt
+++ b/docs/header.txt
@@ -1,5 +1,5 @@
File: ${FILE}
-A simple interpreter
+A simple interpreter
WWW : http://fype.buetow.org
E-Mail : fype@dev.buetow.org
diff --git a/docs/help.txt b/docs/help.txt
index 66881ef..b99470f 100644
--- a/docs/help.txt
+++ b/docs/help.txt
@@ -1,4 +1,4 @@
-Fype v0.1-devel Build 9640
+Fype v0.1-devel Build 9213
Copyright by Paul C. Buetow (2005 - 2008) <fype@dev.buetow.org>
-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 29ae39d..e05d4c5 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 47397a4..b88a1b4 100644
--- a/docs/pod/fype.html
+++ b/docs/pod/fype.html
@@ -20,24 +20,23 @@
<li><a href="#parsing___code_generation">PARSING / CODE GENERATION</a></li>
<li><a href="#requirements">REQUIREMENTS</a></li>
<li><a href="#getting_started">GETTING STARTED</a></li>
+ <li><a href="#data_types">DATA TYPES</a></li>
+ <ul>
+
+ <li><a href="#the_basic_data_types">The basic data types</a></li>
+ <li><a href="#explicit_type_conversions">Explicit type conversions</a></li>
+ </ul>
+
<li><a href="#syntax">SYNTAX</a></li>
<ul>
<li><a href="#comments">Comments</a></li>
<li><a href="#statements">Statements</a></li>
- <li><a href="#parenthesis">Parenthesis</a></li>
+ <li><a href="#paranthesis">Paranthesis</a></li>
<li><a href="#scopeing">Scopeing</a></li>
<li><a href="#control_statements">Control statements</a></li>
</ul>
- <li><a href="#data_types">DATA TYPES</a></li>
- <ul>
-
- <li><a href="#the_basic_data_types">The basic data types</a></li>
- <li><a href="#explicit_type_conversions">Explicit type conversions</a></li>
- <li><a href="#more_functions_for_data_types">More functions for data types</a></li>
- </ul>
-
<li><a href="#variables">VARIABLES</a></li>
<li><a href="#built_in_functions">BUILT IN FUNCTIONS</a></li>
<ul>
@@ -133,81 +132,6 @@ TODO file of the source distribution of Fype!</p>
<p>
</p>
<hr />
-<h1><a name="syntax">SYNTAX</a></h1>
-<p>
-</p>
-<h2><a name="comments">Comments</a></h2>
-<p>Text from a <strong>#</strong> character until the end of the current line is considered being a comment. Multi line comments may start with an <strong>#*</strong> and and with an <strong>*#</strong> anywhere. Exceptions are if those signs are inside of strings.</p>
-<p>
-</p>
-<h2><a name="statements">Statements</a></h2>
-<p>A Fype program is a list of statements. Each keyword, expression or function call is part of a statement. Each statement is ended with a semicolon. Example:</p>
-<pre>
- my bar = 3, foo = 1 + 2;
- say foo;
- exit foo - bar;</pre>
-<p>
-</p>
-<h2><a name="parenthesis">Parenthesis</a></h2>
-<p>All parenthesis of function calls are optional. They help to make the code better readable. They also help to force precedences of expressions.</p>
-<p>
-</p>
-<h2><a name="scopeing">Scopeing</a></h2>
-<p>A new scope starts with an { and ends with an }. An exception is a procedure, which does not use its own scope (see later in this manual). Control statements and functions support scopeings. Here is a small example how to use scopes:</p>
-<pre>
- my foo = 1;</pre>
-<pre>
- {
- # Prints out 1
- put defined foo;
- {
- my bar = 2;</pre>
-<pre>
- # Prints out 1
- put defined bar;
- }</pre>
-<pre>
- # Prints out 0
- put defined bar;</pre>
-<pre>
- my baz = 3;
- }</pre>
-<pre>
- # Prints out 0
- say defined bar;</pre>
-<p>
-</p>
-<h2><a name="control_statements">Control statements</a></h2>
-<p>Fype knows the following control statements:</p>
-<dl>
-<dt><strong><a name="item_if__3cexpression_3e__7b__3cstatements_3e__7d">if <em>&lt;expression</em>&gt; { <em>&lt;statements</em>&gt; }</a></strong>
-
-<dd>
-<p>Runs the statements if the expression evaluates to a true value.</p>
-</dd>
-</li>
-<dt><strong><a name="item_ifnot__3cexpression_3e__7b__3cstatements_3e__7d">ifnot <em>&lt;expression</em>&gt; { <em>&lt;statements</em>&gt; }</a></strong>
-
-<dd>
-<p>Runs the statements if the expression evaluates to a false value.</p>
-</dd>
-</li>
-<dt><strong><a name="item_while__3cexpression_3e__7b__3cstatements_3e__7d">while <em>&lt;expression</em>&gt; { <em>&lt;statements</em>&gt; }</a></strong>
-
-<dd>
-<p>Runs the statements as long as the the expression evaluates to a true value.</p>
-</dd>
-</li>
-<dt><strong><a name="item_until__3cexpression_3e__7b__3cstatements_3e__7d">until <em>&lt;expression</em>&gt; { <em>&lt;statements</em>&gt; }</a></strong>
-
-<dd>
-<p>Runs the statements as long as the the expression evaluates to a false value.</p>
-</dd>
-</li>
-</dl>
-<p>
-</p>
-<hr />
<h1><a name="data_types">DATA TYPES</a></h1>
<p>Fype uses auto type conversion. However, if you want to know what's going on you may take a look at the provided basic datatypes.</p>
<p>
@@ -217,25 +141,19 @@ TODO file of the source distribution of Fype!</p>
<dt><strong><a name="item_integer"><em>integer</em></a></strong>
<dd>
-<p>(Internal name TT_INTEGER)</p>
+<p>Specifies an integer number</p>
</dd>
</li>
<dt><strong><a name="item_double"><em>double</em></a></strong>
<dd>
-<p>(Internal name TT_DOUBLE)</p>
+<p>Specifies a double number</p>
</dd>
</li>
<dt><strong><a name="item_string"><em>string</em></a></strong>
<dd>
-<p>(Internal name TT_STRING)</p>
-</dd>
-</li>
-<dt><strong><a name="item_array"><em>array</em></a></strong>
-
-<dd>
-<p>(Internal name TT_ARRAY)</p>
+<p>Specifies a string</p>
</dd>
</li>
<dt><strong><a name="item_number"><em>number</em></a></strong>
@@ -266,47 +184,98 @@ TODO file of the source distribution of Fype!</p>
<p>
</p>
<h2><a name="explicit_type_conversions">Explicit type conversions</a></h2>
-<p>The data types inside the brackets are only showing the return types of each function.</p>
<dl>
<dt><strong><a name="item__28integer_29_integer_any">(<em>integer</em>) <strong>integer</strong> <em>any</em></a></strong>
<dd>
-<p>Converts any type to an integer.</p>
+<p>Converts any type to an integer</p>
</dd>
</li>
<dt><strong><a name="item__28double_29_double_any">(<em>double</em>) <strong>double</strong> <em>any</em></a></strong>
<dd>
-<p>Converts any type to a double.</p>
+<p>Converts any type to a double</p>
</dd>
</li>
<dt><strong><a name="item__28string_29_string_any">(<em>string</em>) <strong>string</strong> <em>any</em></a></strong>
<dd>
-<p>Converts any type to a string.</p>
-</dd>
-</li>
-<dt><strong><a name="item__28array_29_array_any">(<em>array</em>) <strong>array</strong> <em>any</em></a></strong>
-
-<dd>
-<p>Converts any type to an array. This function is not yet implemented.</p>
+<p>Converts any type to a string</p>
</dd>
</li>
</dl>
<p>
</p>
-<h2><a name="more_functions_for_data_types">More functions for data types</a></h2>
+<hr />
+<h1><a name="syntax">SYNTAX</a></h1>
+<p>
+</p>
+<h2><a name="comments">Comments</a></h2>
+<p>Text from a <strong>#</strong> character until the end of the current line is considered being a comment. Multi line comments may start with an <strong>#*</strong> and and with an <strong>*#</strong> anywhere. Exceptions are if those signs are inside of strings.</p>
+<p>
+</p>
+<h2><a name="statements">Statements</a></h2>
+<p>A Fype program is a list of statements. Each keyword, expression or function call is part of a statement. Each statement is ended with a semicolon. Example:</p>
+<pre>
+ my bar = 3, foo = 1 + 2;
+ say foo;
+ exit foo - bar;</pre>
+<p>
+</p>
+<h2><a name="paranthesis">Paranthesis</a></h2>
+<p>All paranthesis of function calls are optional. They help to make the code better readable. They also help to force precedences of expressions.</p>
+<p>
+</p>
+<h2><a name="scopeing">Scopeing</a></h2>
+<p>A new scope starts with an { and ends with an }. An exception is a procedure, which does not use its own scope (see later in this manual). Control statements and functions support scopeings. Here is a small example how to use scopes:</p>
+<pre>
+ my foo = 1;</pre>
+<pre>
+ {
+ # Prints out 1
+ put defined foo;
+ {
+ my bar = 2;</pre>
+<pre>
+ # Prints out 1
+ put defined bar;
+ }</pre>
+<pre>
+ # Prints out 0
+ put defined bar;</pre>
+<pre>
+ my baz = 3;
+ }</pre>
+<pre>
+ # Prints out 0
+ say defined bar;</pre>
+<p>
+</p>
+<h2><a name="control_statements">Control statements</a></h2>
+<p>Fype knows the following control statements:</p>
<dl>
-<dt><strong><a name="item__28string_29_type_any">(<em>string</em>) <strong>type</strong> <em>any</em></a></strong>
+<dt><strong><a name="item_if__3cexpression_3e__7b__3cstatements_3e__7d">if <em>&lt;expression</em>&gt; { <em>&lt;statements</em>&gt; }</a></strong>
<dd>
-<p>Returns the name of the current type. Examples:</p>
+<p>Runs the statements if the expression evaluates to a true value.</p>
</dd>
+</li>
+<dt><strong><a name="item_ifnot__3cexpression_3e__7b__3cstatements_3e__7d">ifnot <em>&lt;expression</em>&gt; { <em>&lt;statements</em>&gt; }</a></strong>
+
<dd>
-<pre>
- my foo = 1;
- put type foo; # Prints &quot;TT_INTEGER&quot;
- put type 1.2; # Prints &quot;TT_DOUBLE&quot;</pre>
+<p>Runs the statements if the expression evaluates to a false value.</p>
+</dd>
+</li>
+<dt><strong><a name="item_while__3cexpression_3e__7b__3cstatements_3e__7d">while <em>&lt;expression</em>&gt; { <em>&lt;statements</em>&gt; }</a></strong>
+
+<dd>
+<p>Runs the statements as long as the the expression evaluates to a true value.</p>
+</dd>
+</li>
+<dt><strong><a name="item_until__3cexpression_3e__7b__3cstatements_3e__7d">until <em>&lt;expression</em>&gt; { <em>&lt;statements</em>&gt; }</a></strong>
+
+<dd>
+<p>Runs the statements as long as the the expression evaluates to a false value.</p>
</dd>
</li>
</dl>
@@ -611,7 +580,7 @@ keyword in order to check if a procedure has been defined or not.</p>
</p>
<hr />
<h1><a name="see_also">SEE ALSO</a></h1>
-<p><code>awk(1)</code> <code>cc(1)</code>
+<p><code>awk(1)</code> <code>cc(1)</code> <code>make(1)</code>
</p>
diff --git a/docs/pod/fype.man b/docs/pod/fype.man
index 1be72ec..b3d89bf 100644
--- a/docs/pod/fype.man
+++ b/docs/pod/fype.man
@@ -129,7 +129,7 @@
.\" ========================================================================
.\"
.IX Title "FYPE 1"
-.TH FYPE 1 "2008-09-16" "Fype v0.1-devel Build 9269" "The Fype Users Manual Page"
+.TH FYPE 1 "2008-09-06" "Fype v0.1-devel Build 9208" "The Fype Users Manual Page"
.SH "NAME"
\&\fBFype\fR is \fBF\fRor \fBY\fRour \fBP\fRrogram \fBE\fRxecution
.PP
@@ -201,6 +201,43 @@ Run a .fy file:
.Ve
.PP
See the ./examples subdir of the Fype source distribution for examples! See also fype \-h for a list of all options.
+.SH "DATA TYPES"
+.IX Header "DATA TYPES"
+Fype uses auto type conversion. However, if you want to know what's going on you may take a look at the provided basic datatypes.
+.Sh "The basic data types"
+.IX Subsection "The basic data types"
+.IP "\fIinteger\fR" 4
+.IX Item "integer"
+Specifies an integer number
+.IP "\fIdouble\fR" 4
+.IX Item "double"
+Specifies a double number
+.IP "\fIstring\fR" 4
+.IX Item "string"
+Specifies a string
+.IP "\fInumber\fR" 4
+.IX Item "number"
+May be an integer or a double number
+.IP "\fIany\fR" 4
+.IX Item "any"
+May be of any type above
+.IP "\fIvoid\fR" 4
+.IX Item "void"
+No type
+.IP "\fIidentifier\fR" 4
+.IX Item "identifier"
+It's a variable name or a procedure name or a function name
+.Sh "Explicit type conversions"
+.IX Subsection "Explicit type conversions"
+.IP "(\fIinteger\fR) \fBinteger\fR \fIany\fR" 4
+.IX Item "(integer) integer any"
+Converts any type to an integer
+.IP "(\fIdouble\fR) \fBdouble\fR \fIany\fR" 4
+.IX Item "(double) double any"
+Converts any type to a double
+.IP "(\fIstring\fR) \fBstring\fR \fIany\fR" 4
+.IX Item "(string) string any"
+Converts any type to a string
.SH "SYNTAX"
.IX Header "SYNTAX"
.Sh "Comments"
@@ -215,9 +252,9 @@ A Fype program is a list of statements. Each keyword, expression or function cal
\& say foo;
\& exit foo - bar;
.Ve
-.Sh "Parenthesis"
-.IX Subsection "Parenthesis"
-All parenthesis of function calls are optional. They help to make the code better readable. They also help to force precedences of expressions.
+.Sh "Paranthesis"
+.IX Subsection "Paranthesis"
+All paranthesis of function calls are optional. They help to make the code better readable. They also help to force precedences of expressions.
.Sh "Scopeing"
.IX Subsection "Scopeing"
A new scope starts with an { and ends with an }. An exception is a procedure, which does not use its own scope (see later in this manual). Control statements and functions support scopeings. Here is a small example how to use scopes:
@@ -269,94 +306,39 @@ Runs the statements as long as the the expression evaluates to a true value.
.IP "until \fI<expression\fR> { \fI<statements\fR> }" 4
.IX Item "until <expression> { <statements> }"
Runs the statements as long as the the expression evaluates to a false value.
-.SH "DATA TYPES"
-.IX Header "DATA TYPES"
-Fype uses auto type conversion. However, if you want to know what's going on you may take a look at the provided basic datatypes.
-.Sh "The basic data types"
-.IX Subsection "The basic data types"
-.IP "\fIinteger\fR" 4
-.IX Item "integer"
-(Internal name \s-1TT_INTEGER\s0)
-.IP "\fIdouble\fR" 4
-.IX Item "double"
-(Internal name \s-1TT_DOUBLE\s0)
-.IP "\fIstring\fR" 4
-.IX Item "string"
-(Internal name \s-1TT_STRING\s0)
-.IP "\fIarray\fR" 4
-.IX Item "array"
-(Internal name \s-1TT_ARRAY\s0)
-.IP "\fInumber\fR" 4
-.IX Item "number"
-May be an integer or a double number
-.IP "\fIany\fR" 4
-.IX Item "any"
-May be of any type above
-.IP "\fIvoid\fR" 4
-.IX Item "void"
-No type
-.IP "\fIidentifier\fR" 4
-.IX Item "identifier"
-It's a variable name or a procedure name or a function name
-.Sh "Explicit type conversions"
-.IX Subsection "Explicit type conversions"
-The data types inside the brackets are only showing the return types of each function.
-.IP "(\fIinteger\fR) \fBinteger\fR \fIany\fR" 4
-.IX Item "(integer) integer any"
-Converts any type to an integer.
-.IP "(\fIdouble\fR) \fBdouble\fR \fIany\fR" 4
-.IX Item "(double) double any"
-Converts any type to a double.
-.IP "(\fIstring\fR) \fBstring\fR \fIany\fR" 4
-.IX Item "(string) string any"
-Converts any type to a string.
-.IP "(\fIarray\fR) \fBarray\fR \fIany\fR" 4
-.IX Item "(array) array any"
-Converts any type to an array. This function is not yet implemented.
-.Sh "More functions for data types"
-.IX Subsection "More functions for data types"
-.IP "(\fIstring\fR) \fBtype\fR \fIany\fR" 4
-.IX Item "(string) type any"
-Returns the name of the current type. Examples:
-.Sp
-.Vb 3
-\& my foo = 1;
-\& put type foo; # Prints "TT_INTEGER"
-\& put type 1.2; # Prints "TT_DOUBLE"
-.Ve
.SH "VARIABLES"
.IX Header "VARIABLES"
Variables can be defined with the \fBmy\fR keyword. If you don't assign a value during declaration, then it's using the default integer value 0. Variables may be changed during program runtime. Variables may be deleted using the \fBundef\fR keyword! Example of defining variables:
-.Sp
+.PP
.Vb 2
\& my foo = 1 + 2;
\& say foo;
.Ve
-.Sp
+.PP
.Vb 3
\& my bar = 12, baz = foo;
\& say 1 + bar;
\& say bar;
.Ve
-.Sp
+.PP
.Vb 2
\& my baz;
\& say baz; # Will print out 0
.Ve
-.Sp
+.PP
You may use the \fBdefined\fR keyword to check if an identifier has been defined or
not.
-.Sp
+.PP
.Vb 3
\& ifnot defined foo {
\& say "No foo yet defined";
\& }
.Ve
-.Sp
+.PP
.Vb 1
\& my foo = 1;
.Ve
-.Sp
+.PP
.Vb 4
\& if defined foo {
\& put "foo is defined and has the value ";
@@ -368,7 +350,6 @@ not.
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.
.Sh "Math"
.IX Subsection "Math"
-.RS 4
.IP "(\fIany\fR) \fIany\fR \fB+\fR \fIany\fR" 4
.IX Item "(any) any + any"
Special string behavior: A string will get auto convertet into an \fIinteger\fR.
@@ -381,8 +362,6 @@ Special string behavior: A string will get auto convertet into an \fIinteger\fR.
.IP "(\fIany\fR) \fIany\fR \fB/\fR \fIany\fR" 4
.IX Item "(any) any / any"
Special string behavior: A string will get auto convertet into an \fIinteger\fR.
-.RE
-.RS 4
.Sh "Conditional"
.IX Subsection "Conditional"
.IP "(\fIinteger\fR) \fIany\fR \fB==\fR \fIany\fR" 4
@@ -400,8 +379,6 @@ Special string behavior: A string will get auto convertet into an \fIinteger\fR.
.IX Item "(integer) any > any"
.IP "(\fIinteger\fR) \fBnot\fR \fIany\fR" 4
.IX Item "(integer) not any"
-.RE
-.RS 4
.PD
.Sh "Definedness"
.IX Subsection "Definedness"
@@ -411,8 +388,6 @@ Returns 1 if \fIidentifier\fR has been defined. Returns 0 else.
.IP "(\fIinteger\fR) \fBundef\fR \fIidentifier\fR" 4
.IX Item "(integer) undef identifier"
Tries to undefine/delete the \fIidentifier\fR. Returns 1 if success, otherwise 0 is returned.
-.RE
-.RS 4
.Sh "Bitwise"
.IX Subsection "Bitwise"
.IP "(\fIinteger\fR) \fIany\fR \fB:<\fR \fIany\fR" 4
@@ -426,8 +401,6 @@ Tries to undefine/delete the \fIidentifier\fR. Returns 1 if success, otherwise 0
.IX Item "(integer) any or any"
.IP "(\fIinteger\fR) \fIany\fR \fBxor\fR \fIany\fR" 4
.IX Item "(integer) any xor any"
-.RE
-.RS 4
.PD
.Sh "Numeric"
.IX Subsection "Numeric"
@@ -446,8 +419,6 @@ This function always returns 1. The parameter is optional.
\& # Prints out 1, because foo is not defined
\& if yes { say no defined foo; }
.Ve
-.RE
-.RS 4
.Sh "System"
.IX Subsection "System"
.IP "(\fIvoid\fR) \fBend\fR" 4
@@ -482,8 +453,6 @@ Executes the garbage collector and returns the number of items freed! You may
wonder why most of the time it will return a value of 0! Fype tries to free not
needed memory asap. This may change in future versions in order to gain faster
execution of scripts!
-.RE
-.RS 4
.Sh "I/O"
.IX Subsection "I/O"
.IP "(\fIany\fR) \fBput\fR \fIany\fR" 4
@@ -495,25 +464,23 @@ Same as put, but also includes an ending newline
.IP "(\fIvoid\fR) \fBln\fR" 4
.IX Item "(void) ln"
Just prints a newline
-.RE
-.RS 4
.SH "SELF DEFINING PROCEDURES AND FUNCTIONS"
.IX Header "SELF DEFINING PROCEDURES AND FUNCTIONS"
.Sh "Procedures"
.IX Subsection "Procedures"
A procedure can be defined with the \fBproc\fR keyword and deleted with the \fBundef\fR keyword. A procedure does not return any value and does not support parameter passing. It's using already defined variables (e.g. global variables). A procedure does not have its own namespace. It's using the calling namespace. It is possible to define new variabes inside of a procedure in the current namespace.
-.Sp
+.PP
.Vb 4
\& proc foo {
\& say 1 + a * 3 + b;
\& my c = 6;
\& }
.Ve
-.Sp
+.PP
.Vb 1
\& my a = 2, b = 4;
.Ve
-.Sp
+.PP
.Vb 2
\& foo; # Run the procedure. Print out "11\en"
\& say c; # Print out "6\en";
@@ -524,12 +491,12 @@ It's possible to define procedures inside of procedures. Since procedures don't
have its own scope, nested procedures will be available to the current scope as
soon as the main procedure has run the first time. You may use the \fBdefined\fR
keyword in order to check if a procedure has been defined or not.
-.Sp
+.PP
.Vb 2
\& proc foo {
\& say "I am foo";
.Ve
-.Sp
+.PP
.Vb 5
\& undef bar;
\& proc bar {
@@ -537,13 +504,13 @@ keyword in order to check if a procedure has been defined or not.
\& }
\& }
.Ve
-.Sp
+.PP
.Vb 3
\& # Here bar would produce an error because
\& # the proc is not yet defined!
\& # bar;
.Ve
-.Sp
+.PP
.Vb 3
\& foo; # Here the procedure foo will define the procedure bar!
\& bar; # Now the procedure bar is defined!
@@ -552,18 +519,18 @@ keyword in order to check if a procedure has been defined or not.
.Sh "Functions"
.IX Subsection "Functions"
A function should be defined with the \fBfunc\fR keyword and deleted with the \fBundef\fR keyword. Function not yet return values (will be changed in future versions) and supports not yet parameter passing (will be changed in future versions). It's using local (lexical scoped) variables. If a certain variable does not exist It's using already defined variables (e.g. one scope above).
-.Sp
+.PP
.Vb 4
\& func foo {
\& say 1 + a * 3 + b;
\& my c = 6;
\& }
.Ve
-.Sp
+.PP
.Vb 1
\& my a = 2, b = 4;
.Ve
-.Sp
+.PP
.Vb 2
\& foo; # Run the procedure. Print out "11\en"
\& say c; # Will produce an error, because c is out of scoped!
@@ -571,19 +538,19 @@ A function should be defined with the \fBfunc\fR keyword and deleted with the \f
.Sh "Nested functions"
.IX Subsection "Nested functions"
Nested functions work the same way the nested procedures work, with the exception that nested functions will not be available any more after the function has been left!
-.Sp
+.PP
.Vb 4
\& func foo {
\& func bar {
\& say "Hello i am nested";
\& }
.Ve
-.Sp
+.PP
.Vb 2
\& bar; # Calling nested
\& }
.Ve
-.Sp
+.PP
.Vb 2
\& foo;
\& bar; # Will produce an error, because bar is out of scope!
@@ -596,4 +563,4 @@ Paul C. Buetow (http://paul.buetow.org)
The Fype Language (http://fype.buetow.org)
.SH "SEE ALSO"
.IX Header "SEE ALSO"
-\&\fIawk\fR\|(1) \fIcc\fR\|(1)
+\&\fIawk\fR\|(1) \fIcc\fR\|(1) \fImake\fR\|(1)
diff --git a/docs/pod/fype.pod b/docs/pod/fype.pod
index 6ec8061..2e41645 100644
--- a/docs/pod/fype.pod
+++ b/docs/pod/fype.pod
@@ -68,6 +68,62 @@ Run a .fy file:
See the ./examples subdir of the Fype source distribution for examples! See also fype -h for a list of all options.
+=head1 DATA TYPES
+
+Fype uses auto type conversion. However, if you want to know what's going on you may take a look at the provided basic datatypes.
+
+=head2 The basic data types
+
+=over
+
+=item I<integer>
+
+Specifies an integer number
+
+=item I<double>
+
+Specifies a double number
+
+=item I<string>
+
+Specifies a string
+
+=item I<number>
+
+May be an integer or a double number
+
+=item I<any>
+
+May be of any type above
+
+=item I<void>
+
+No type
+
+=item I<identifier>
+
+It's a variable name or a procedure name or a function name
+
+=back
+
+=head2 Explicit type conversions
+
+=over
+
+=item (I<integer>) B<integer> I<any>
+
+Converts any type to an integer
+
+=item (I<double>) B<double> I<any>
+
+Converts any type to a double
+
+=item (I<string>) B<string> I<any>
+
+Converts any type to a string
+
+=back
+
=head1 SYNTAX
=head2 Comments
@@ -82,9 +138,9 @@ A Fype program is a list of statements. Each keyword, expression or function cal
say foo;
exit foo - bar;
-=head2 Parenthesis
+=head2 Paranthesis
-All parenthesis of function calls are optional. They help to make the code better readable. They also help to force precedences of expressions.
+All paranthesis of function calls are optional. They help to make the code better readable. They also help to force precedences of expressions.
=head2 Scopeing
@@ -135,84 +191,6 @@ Runs the statements as long as the the expression evaluates to a false value.
=back
-=head1 DATA TYPES
-
-Fype uses auto type conversion. However, if you want to know what's going on you may take a look at the provided basic datatypes.
-
-=head2 The basic data types
-
-=over
-
-=item I<integer>
-
-(Internal name TT_INTEGER)
-
-=item I<double>
-
-(Internal name TT_DOUBLE)
-
-=item I<string>
-
-(Internal name TT_STRING)
-
-=item I<array>
-
-(Internal name TT_ARRAY)
-
-=item I<number>
-
-May be an integer or a double number
-
-=item I<any>
-
-May be of any type above
-
-=item I<void>
-
-No type
-
-=item I<identifier>
-
-It's a variable name or a procedure name or a function name
-
-=back
-
-=head2 Explicit type conversions
-
-The data types inside the brackets are only showing the return types of each function.
-
-=over
-
-=item (I<integer>) B<integer> I<any>
-
-Converts any type to an integer.
-
-=item (I<double>) B<double> I<any>
-
-Converts any type to a double.
-
-=item (I<string>) B<string> I<any>
-
-Converts any type to a string.
-
-=item (I<array>) B<array> I<any>
-
-Converts any type to an array. This function is not yet implemented.
-
-=back
-
-=head2 More functions for data types
-
-=over
-
-=item (I<string>) B<type> I<any>
-
-Returns the name of the current type. Examples:
-
- my foo = 1;
- put type foo; # Prints "TT_INTEGER"
- put type 1.2; # Prints "TT_DOUBLE"
-
=head1 VARIABLES
Variables can be defined with the B<my> keyword. If you don't assign a value during declaration, then it's using the default integer value 0. Variables may be changed during program runtime. Variables may be deleted using the B<undef> keyword! Example of defining variables:
@@ -445,7 +423,7 @@ A function should be defined with the B<func> keyword and deleted with the B<und
my a = 2, b = 4;
foo; # Run the procedure. Print out "11\n"
- say c; # Will produce an error, because c is out of scope!
+ say c; # Will produce an error, because c is out of scoped!
=head2 Nested functions
@@ -472,5 +450,5 @@ The Fype Language (http://fype.buetow.org)
=head1 SEE ALSO
-awk(1) cc(1)
+awk(1) cc(1) make(1)
diff --git a/docs/pod/fype.tex b/docs/pod/fype.tex
index b29ea4f..bcdea5f 100644
--- a/docs/pod/fype.tex
+++ b/docs/pod/fype.tex
@@ -94,6 +94,67 @@ Run a .fy file:
See the ./examples subdir of the Fype source distribution for examples! See also fype -h for a list of all options.
+\section{DATA TYPES\label{DATA_TYPES}\index{DATA TYPES}}
+
+
+Fype uses auto type conversion. However, if you want to know what's going on you may take a look at the provided basic datatypes.
+
+\subsection*{The basic data types\label{The_basic_data_types}\index{The basic data types}}
+\begin{description}
+
+\item[{\textit{integer}}] \mbox{}
+
+Specifies an integer number
+
+
+\item[{\textit{double}}] \mbox{}
+
+Specifies a double number
+
+
+\item[{\textit{string}}] \mbox{}
+
+Specifies a string
+
+
+\item[{\textit{number}}] \mbox{}
+
+May be an integer or a double number
+
+
+\item[{\textit{any}}] \mbox{}
+
+May be of any type above
+
+
+\item[{\textit{void}}] \mbox{}
+
+No type
+
+
+\item[{\textit{identifier}}] \mbox{}
+
+It's a variable name or a procedure name or a function name
+
+\end{description}
+\subsection*{Explicit type conversions\label{Explicit_type_conversions}\index{Explicit type conversions}}
+\begin{description}
+
+\item[{(\textit{integer}) \textbf{integer} \textit{any}}] \mbox{}
+
+Converts any type to an integer
+
+
+\item[{(\textit{double}) \textbf{double} \textit{any}}] \mbox{}
+
+Converts any type to a double
+
+
+\item[{(\textit{string}) \textbf{string} \textit{any}}] \mbox{}
+
+Converts any type to a string
+
+\end{description}
\section{SYNTAX\label{SYNTAX}\index{SYNTAX}}
\subsection*{Comments\label{Comments}\index{Comments}}
@@ -110,10 +171,10 @@ A Fype program is a list of statements. Each keyword, expression or function cal
say foo;
exit foo - bar;
\end{verbatim}
-\subsection*{Parenthesis\label{Parenthesis}\index{Parenthesis}}
+\subsection*{Paranthesis\label{Paranthesis}\index{Paranthesis}}
-All parenthesis of function calls are optional. They help to make the code better readable. They also help to force precedences of expressions.
+All paranthesis of function calls are optional. They help to make the code better readable. They also help to force precedences of expressions.
\subsection*{Scopeing\label{Scopeing}\index{Scopeing}}
@@ -174,93 +235,6 @@ Runs the statements as long as the the expression evaluates to a true value.
Runs the statements as long as the the expression evaluates to a false value.
\end{description}
-\section{DATA TYPES\label{DATA_TYPES}\index{DATA TYPES}}
-
-
-Fype uses auto type conversion. However, if you want to know what's going on you may take a look at the provided basic datatypes.
-
-\subsection*{The basic data types\label{The_basic_data_types}\index{The basic data types}}
-\begin{description}
-
-\item[{\textit{integer}}] \mbox{}
-
-(Internal name TT\_INTEGER)
-
-
-\item[{\textit{double}}] \mbox{}
-
-(Internal name TT\_DOUBLE)
-
-
-\item[{\textit{string}}] \mbox{}
-
-(Internal name TT\_STRING)
-
-
-\item[{\textit{array}}] \mbox{}
-
-(Internal name TT\_ARRAY)
-
-
-\item[{\textit{number}}] \mbox{}
-
-May be an integer or a double number
-
-
-\item[{\textit{any}}] \mbox{}
-
-May be of any type above
-
-
-\item[{\textit{void}}] \mbox{}
-
-No type
-
-
-\item[{\textit{identifier}}] \mbox{}
-
-It's a variable name or a procedure name or a function name
-
-\end{description}
-\subsection*{Explicit type conversions\label{Explicit_type_conversions}\index{Explicit type conversions}}
-
-
-The data types inside the brackets are only showing the return types of each function.
-
-\begin{description}
-
-\item[{(\textit{integer}) \textbf{integer} \textit{any}}] \mbox{}
-
-Converts any type to an integer.
-
-
-\item[{(\textit{double}) \textbf{double} \textit{any}}] \mbox{}
-
-Converts any type to a double.
-
-
-\item[{(\textit{string}) \textbf{string} \textit{any}}] \mbox{}
-
-Converts any type to a string.
-
-
-\item[{(\textit{array}) \textbf{array} \textit{any}}] \mbox{}
-
-Converts any type to an array. This function is not yet implemented.
-
-\end{description}
-\subsection*{More functions for data types\label{More_functions_for_data_types}\index{More functions for data types}}
-\begin{description}
-
-\item[{(\textit{string}) \textbf{type} \textit{any}}] \mbox{}
-
-Returns the name of the current type. Examples:
-
-\begin{verbatim}
- my foo = 1;
- put type foo; # Prints "TT_INTEGER"
- put type 1.2; # Prints "TT_DOUBLE"
-\end{verbatim}
\section{VARIABLES\label{VARIABLES}\index{VARIABLES}}
@@ -536,5 +510,5 @@ The Fype Language (http://fype.buetow.org)
\section{SEE ALSO\label{SEE_ALSO}\index{SEE ALSO}}
-awk(1) cc(1)
+awk(1) cc(1) make(1)
diff --git a/docs/pod/fype.txt b/docs/pod/fype.txt
index b6f6969..66a9695 100644
--- a/docs/pod/fype.txt
+++ b/docs/pod/fype.txt
@@ -75,6 +75,42 @@ GETTING STARTED
See the ./examples subdir of the Fype source distribution for examples!
See also fype -h for a list of all options.
+DATA TYPES
+ Fype uses auto type conversion. However, if you want to know what's
+ going on you may take a look at the provided basic datatypes.
+
+ The basic data types
+ *integer*
+ Specifies an integer number
+
+ *double*
+ Specifies a double number
+
+ *string*
+ Specifies a string
+
+ *number*
+ May be an integer or a double number
+
+ *any*
+ May be of any type above
+
+ *void*
+ No type
+
+ *identifier*
+ It's a variable name or a procedure name or a function name
+
+ Explicit type conversions
+ (*integer*) integer *any*
+ Converts any type to an integer
+
+ (*double*) double *any*
+ Converts any type to a double
+
+ (*string*) string *any*
+ Converts any type to a string
+
SYNTAX
Comments
Text from a # character until the end of the current line is considered
@@ -90,8 +126,8 @@ SYNTAX
say foo;
exit foo - bar;
- Parenthesis
- All parenthesis of function calls are optional. They help to make the
+ Paranthesis
+ All paranthesis of function calls are optional. They help to make the
code better readable. They also help to force precedences of
expressions.
@@ -139,270 +175,216 @@ SYNTAX
Runs the statements as long as the the expression evaluates to a
false value.
-DATA TYPES
- Fype uses auto type conversion. However, if you want to know what's
- going on you may take a look at the provided basic datatypes.
-
- The basic data types
- *integer*
- (Internal name TT_INTEGER)
-
- *double*
- (Internal name TT_DOUBLE)
-
- *string*
- (Internal name TT_STRING)
-
- *array*
- (Internal name TT_ARRAY)
-
- *number*
- May be an integer or a double number
-
- *any*
- May be of any type above
-
- *void*
- No type
-
- *identifier*
- It's a variable name or a procedure name or a function name
-
- Explicit type conversions
- The data types inside the brackets are only showing the return types of
- each function.
-
- (*integer*) integer *any*
- Converts any type to an integer.
-
- (*double*) double *any*
- Converts any type to a double.
-
- (*string*) string *any*
- Converts any type to a string.
-
- (*array*) array *any*
- Converts any type to an array. This function is not yet implemented.
-
- More functions for data types
- (*string*) type *any*
- Returns the name of the current type. Examples:
-
- my foo = 1;
- put type foo; # Prints "TT_INTEGER"
- put type 1.2; # Prints "TT_DOUBLE"
-
VARIABLES
- Variables can be defined with the my keyword. If you don't assign a
- value during declaration, then it's using the default integer value
- 0. Variables may be changed during program runtime. Variables may be
- deleted using the undef keyword! Example of defining variables:
+ Variables can be defined with the my keyword. If you don't assign a
+ value during declaration, then it's using the default integer value 0.
+ Variables may be changed during program runtime. Variables may be
+ deleted using the undef keyword! Example of defining variables:
- my foo = 1 + 2;
- say foo;
+ my foo = 1 + 2;
+ say foo;
- my bar = 12, baz = foo;
- say 1 + bar;
- say bar;
+ my bar = 12, baz = foo;
+ say 1 + bar;
+ say bar;
- my baz;
- say baz; # Will print out 0
+ my baz;
+ say baz; # Will print out 0
- You may use the defined keyword to check if an identifier has been
- defined or not.
+ You may use the defined keyword to check if an identifier has been
+ defined or not.
- ifnot defined foo {
- say "No foo yet defined";
- }
+ ifnot defined foo {
+ say "No foo yet defined";
+ }
- my foo = 1;
+ my foo = 1;
- if defined foo {
- put "foo is defined and has the value ";
- say foo;
- }
+ if defined foo {
+ put "foo is defined and has the value ";
+ say foo;
+ }
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.
+ 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.
Math
- (*any*) *any* + *any*
- Special string behavior: A string will get auto convertet into
- an *integer*.
+ (*any*) *any* + *any*
+ Special string behavior: A string will get auto convertet into an
+ *integer*.
- (*any*) *any* - *any*
- Special string behavior: A string will get auto convertet into
- an *integer*.
+ (*any*) *any* - *any*
+ Special string behavior: A string will get auto convertet into an
+ *integer*.
- (*any*) *any* * *any*
- Special string behavior: A string will get auto convertet into
- an *integer*.
+ (*any*) *any* * *any*
+ Special string behavior: A string will get auto convertet into an
+ *integer*.
- (*any*) *any* / *any*
- Special string behavior: A string will get auto convertet into
- an *integer*.
+ (*any*) *any* / *any*
+ Special string behavior: A string will get auto convertet into an
+ *integer*.
Conditional
- (*integer*) *any* == *any*
- (*integer*) *any* != *any*
- (*integer*) *any* <= *any*
- (*integer*) *any* >= *any*
- (*integer*) *any* < *any*
- (*integer*) *any* > *any*
- (*integer*) not *any*
+ (*integer*) *any* == *any*
+ (*integer*) *any* != *any*
+ (*integer*) *any* <= *any*
+ (*integer*) *any* >= *any*
+ (*integer*) *any* < *any*
+ (*integer*) *any* > *any*
+ (*integer*) not *any*
Definedness
- (*integer*) defined *identifier*
- Returns 1 if *identifier* has been defined. Returns 0 else.
+ (*integer*) defined *identifier*
+ Returns 1 if *identifier* has been defined. Returns 0 else.
- (*integer*) undef *identifier*
- Tries to undefine/delete the *identifier*. Returns 1 if success,
- otherwise 0 is returned.
+ (*integer*) undef *identifier*
+ Tries to undefine/delete the *identifier*. Returns 1 if success,
+ otherwise 0 is returned.
Bitwise
- (*integer*) *any* :< *any*
- (*integer*) *any* :> *any*
- (*integer*) *any* and *any*
- (*integer*) *any* or *any*
- (*integer*) *any* xor *any*
+ (*integer*) *any* :< *any*
+ (*integer*) *any* :> *any*
+ (*integer*) *any* and *any*
+ (*integer*) *any* or *any*
+ (*integer*) *any* xor *any*
Numeric
- (*number*) neg *number*
- This function returns the negative value of *any*
+ (*number*) neg *number*
+ This function returns the negative value of *any*
- (*integer*) no [*integer*]
- This function returns 1 if the argument is 0, otherwise it will
- return 0! If no argument is given, then 0 is returned!
+ (*integer*) no [*integer*]
+ This function returns 1 if the argument is 0, otherwise it will
+ return 0! If no argument is given, then 0 is returned!
- (*integer*) yes [*integer*]
- This function always returns 1. The parameter is optional.
+ (*integer*) yes [*integer*]
+ This function always returns 1. The parameter is optional.
- # Prints out 1, because foo is not defined
- if yes { say no defined foo; }
+ # Prints out 1, because foo is not defined
+ if yes { say no defined foo; }
System
- (*void*) end
- Exits the program with the exit status of 0
+ (*void*) end
+ Exits the program with the exit status of 0
- (*void*) exit *integer*
- Exits the program with the specified exit status
+ (*void*) exit *integer*
+ Exits the program with the specified exit status
- (*integer*) fork
- Fork forks a subprocess. It returns 0 for the child process and
- the pid of the child process otherwise! Example:
+ (*integer*) fork
+ Fork forks a subprocess. It returns 0 for the child process and the
+ pid of the child process otherwise! Example:
- my pid = fork;
+ my pid = fork;
- if pid {
- put "I am the parent process; child has the pid ";
- say pid;
+ if pid {
+ put "I am the parent process; child has the pid ";
+ say pid;
- } ifnot pid {
- say "I am the child process";
- }
+ } ifnot pid {
+ say "I am the child process";
+ }
- (*integer*) gc
- Executes the garbage collector and returns the number of items
- freed! You may wonder why most of the time it will return a
- value of 0! Fype tries to free not needed memory asap. This may
- change in future versions in order to gain faster execution of
- scripts!
+ (*integer*) gc
+ Executes the garbage collector and returns the number of items
+ freed! You may wonder why most of the time it will return a value of
+ 0! Fype tries to free not needed memory asap. This may change in
+ future versions in order to gain faster execution of scripts!
I/O
- (*any*) put *any*
- Prints out the argument
+ (*any*) put *any*
+ Prints out the argument
- (*any*) say *any*
- Same as put, but also includes an ending newline
+ (*any*) say *any*
+ Same as put, but also includes an ending newline
- (*void*) ln
- Just prints a newline
+ (*void*) ln
+ Just prints a newline
SELF DEFINING PROCEDURES AND FUNCTIONS
Procedures
- A procedure can be defined with the proc keyword and deleted with
- the undef keyword. A procedure does not return any value and does
- not support parameter passing. It's using already defined variables
- (e.g. global variables). A procedure does not have its own
- namespace. It's using the calling namespace. It is possible to
- define new variabes inside of a procedure in the current namespace.
-
- proc foo {
- say 1 + a * 3 + b;
- my c = 6;
- }
+ A procedure can be defined with the proc keyword and deleted with the
+ undef keyword. A procedure does not return any value and does not
+ support parameter passing. It's using already defined variables (e.g.
+ global variables). A procedure does not have its own namespace. It's
+ using the calling namespace. It is possible to define new variabes
+ inside of a procedure in the current namespace.
+
+ proc foo {
+ say 1 + a * 3 + b;
+ my c = 6;
+ }
- my a = 2, b = 4;
+ my a = 2, b = 4;
- foo; # Run the procedure. Print out "11\n"
- say c; # Print out "6\n";
+ foo; # Run the procedure. Print out "11\n"
+ say c; # Print out "6\n";
Nested procedures
- It's possible to define procedures inside of procedures. Since
- procedures don't have its own scope, nested procedures will be
- available to the current scope as soon as the main procedure has run
- the first time. You may use the defined keyword in order to check if
- a procedure has been defined or not.
-
- proc foo {
- say "I am foo";
-
- undef bar;
- proc bar {
- say "I am bar";
- }
- }
+ It's possible to define procedures inside of procedures. Since
+ procedures don't have its own scope, nested procedures will be available
+ to the current scope as soon as the main procedure has run the first
+ time. You may use the defined keyword in order to check if a procedure
+ has been defined or not.
+
+ proc foo {
+ say "I am foo";
+
+ undef bar;
+ proc bar {
+ say "I am bar";
+ }
+ }
- # Here bar would produce an error because
- # the proc is not yet defined!
- # bar;
+ # Here bar would produce an error because
+ # the proc is not yet defined!
+ # bar;
- foo; # Here the procedure foo will define the procedure bar!
- bar; # Now the procedure bar is defined!
- foo; # Here the procedure foo will redefine bar again!
+ foo; # Here the procedure foo will define the procedure bar!
+ bar; # Now the procedure bar is defined!
+ foo; # Here the procedure foo will redefine bar again!
Functions
- A function should be defined with the func keyword and deleted with
- the undef keyword. Function not yet return values (will be changed
- in future versions) and supports not yet parameter passing (will be
- changed in future versions). It's using local (lexical scoped)
- variables. If a certain variable does not exist It's using already
- defined variables (e.g. one scope above).
-
- func foo {
- say 1 + a * 3 + b;
- my c = 6;
- }
+ A function should be defined with the func keyword and deleted with the
+ undef keyword. Function not yet return values (will be changed in future
+ versions) and supports not yet parameter passing (will be changed in
+ future versions). It's using local (lexical scoped) variables. If a
+ certain variable does not exist It's using already defined variables
+ (e.g. one scope above).
+
+ func foo {
+ say 1 + a * 3 + b;
+ my c = 6;
+ }
- my a = 2, b = 4;
+ my a = 2, b = 4;
- foo; # Run the procedure. Print out "11\n"
- say c; # Will produce an error, because c is out of scoped!
+ foo; # Run the procedure. Print out "11\n"
+ say c; # Will produce an error, because c is out of scoped!
Nested functions
- Nested functions work the same way the nested procedures work, with
- the exception that nested functions will not be available any more
- after the function has been left!
+ Nested functions work the same way the nested procedures work, with the
+ exception that nested functions will not be available any more after the
+ function has been left!
- func foo {
- func bar {
- say "Hello i am nested";
- }
+ func foo {
+ func bar {
+ say "Hello i am nested";
+ }
- bar; # Calling nested
- }
+ bar; # Calling nested
+ }
- foo;
- bar; # Will produce an error, because bar is out of scope!
+ foo;
+ bar; # Will produce an error, because bar is out of scope!
AUTHOR
- Paul C. Buetow (http://paul.buetow.org)
+ Paul C. Buetow (http://paul.buetow.org)
WEBSITE
- The Fype Language (http://fype.buetow.org)
+ The Fype Language (http://fype.buetow.org)
SEE ALSO
- awk(1) cc(1)
+ awk(1) cc(1) make(1)
diff --git a/docs/stats.txt b/docs/stats.txt
index 207f2b8..b49fcc8 100644
--- a/docs/stats.txt
+++ b/docs/stats.txt
@@ -1,4 +1,4 @@
===> Num of C source files : 42
-===> Num of C source lines : 7714
+===> Num of C source lines : 7460
===> Num of Fype source examples : 13
-===> Num of Fype source lines : 323
+===> Num of Fype source lines : 321
diff --git a/docs/version.txt b/docs/version.txt
index 549fead..10949e7 100644
--- a/docs/version.txt
+++ b/docs/version.txt
@@ -1 +1 @@
-Fype v0.1-devel Build 9640
+Fype v0.1-devel Build 9213