From 1e5b73f1387e2b238e15238604b20a21f4e109ef Mon Sep 17 00:00:00 2001 From: "Paul C. Buetow (mars.fritz.box)" Date: Sun, 22 Jun 2014 11:53:34 +0200 Subject: add README.pod --- docs/pod/fype.html | 145 ++++++++++++++++++++--------------------------------- 1 file changed, 54 insertions(+), 91 deletions(-) (limited to 'docs/pod/fype.html') diff --git a/docs/pod/fype.html b/docs/pod/fype.html index 0a709bb..121cbea 100644 --- a/docs/pod/fype.html +++ b/docs/pod/fype.html @@ -4,13 +4,15 @@ NAME - + -

+ +
+

+ +
+
-

NAME

@@ -78,9 +82,9 @@

SYNOPSES

-
fype [-[hsvTV]] file.fy +
fype [-[hsvTV]] file.fy
-
fype -e ``fype code string;'' +
fype -e "fype code string;"

@@ -91,7 +95,7 @@ TODO file of the source distribution of Fype!

Fype is a 32 bit scripting language created for fun. You can use it and comment on it if you like. You could also write patches and mail them to fype at dev dot buetow dot org! Or go visit the IRC channel #coding at irc.german-elite.net and ask rantanplan.

Fype is developed under the BSD license. See the COPYING file which is included in the source tree.

-

Fype should be ``at least as good as AWK''. This does not mean it will be a replacement for AWK but it should support functions, loops and arrays like AWK does but with a different syntax. It should also get extension support like AWK has. I am not talking about GNU AWK but about New AWK, which is included in the *BSD distributions! Fype already has a few features which are not available in AWK. However, AWK has still many features which are not available in Fype as well ;)

+

Fype should be "at least as good as AWK". This does not mean it will be a replacement for AWK but it should support functions, loops and arrays like AWK does but with a different syntax. It should also get extension support like AWK has. I am not talking about GNU AWK but about New AWK, which is included in the *BSD distributions! Fype already has a few features which are not available in AWK. However, AWK has still many features which are not available in Fype as well ;)

Fancy stuff like OOP or unicode or threading is not yet planed. But fancy stuff like function pointers and closures may be considered for one of the first releases of Fype :)

@@ -139,71 +143,61 @@ TODO file of the source distribution of Fype!

The basic data types

-
integer +
integer

Specifies an integer number

- -
double +
double

Specifies a double number

- -
string +
string

Specifies a string

- -
number +
number

May be an integer or a double number

- -
any +
any

May be of any type above

- -
void +
void

No type

- -
identifier +
identifier

It's a variable name or a procedure name or a function name

-

Explicit type conversions

-
(integer) integer any +
(integer) integer any

Converts any type to an integer

- -
(double) double any +
(double) double any

Converts any type to a double

- -
(string) string any +
(string) string any

Converts any type to a string

-

@@ -259,30 +253,26 @@ TODO file of the source distribution of Fype!

Control statements

Fype knows the following control statements:

-
if <expression> { <statements> } +
if <expression> { <statements> }

Runs the statements if the expression evaluates to a true value.

- -
ifnot <expression> { <statements> } +
ifnot <expression> { <statements> }

Runs the statements if the expression evaluates to a false value.

- -
while <expression> { <statements> } +
while <expression> { <statements> }

Runs the statements as long as the the expression evaluates to a true value.

- -
until <expression> { <statements> } +
until <expression> { <statements> }

Runs the statements as long as the the expression evaluates to a false value.

-

@@ -356,153 +346,132 @@ not.

Math

-
(any) any + any +
(any) any + any

Special string behavior: A string will get auto convertet into an integer.

- -
(any) any - any +
(any) any - any

Special string behavior: A string will get auto convertet into an integer.

- -
(any) any * any +
(any) any * any

Special string behavior: A string will get auto convertet into an integer.

- -
(any) any / any +
(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) any >= any +
(integer) any >= any
-
(integer) any < any +
(integer) any < any
-
(integer) any > any +
(integer) any > any
-
(integer) not any +
(integer) not any

Definedness

-
(integer) defined identifier +
(integer) defined identifier

Returns 1 if identifier has been defined. Returns 0 else.

- -
(integer) undef identifier +
(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 :> any +
(integer) any :> any
-
(integer) any and any +
(integer) any and any
-
(integer) any or any +
(integer) any or any
-
(integer) any xor any +
(integer) any xor any

Numeric

-
(number) neg number +
(number) neg number

This function returns the negative value of any

- -
(integer) no [integer] +
(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] +
(integer) yes [integer]
-

This function always returns 1. The parameter is optional. -

-
-
+

This function always returns 1. The parameter is optional.

 
         # Prints out 1, because foo is not defined
         if yes { say no defined foo; }
-

System

-
(void) end +
(void) end

Exits the program with the exit status of 0

- -
(void) exit integer +
(void) exit integer

Exits the program with the specified exit status

- -
(integer) fork +
(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;
-
-
         if pid {
                 put "I am the parent process; child has the pid ";
                 say pid;
-
-
         } ifnot pid {
                 say "I am the child process";
         }
- -
(integer) gc +
(integer) gc

Executes the garbage collector and returns the number of items freed! You may @@ -510,30 +479,26 @@ 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 +
(any) put any

Prints out the argument

- -
(any) say any +
(any) say any

Same as put, but also includes an ending newline

- -
(void) ln +
(void) ln

Just prints a newline

-

@@ -620,9 +585,7 @@ keyword in order to check if a procedure has been defined or not.


SEE ALSO

-

awk(1) cc(1) make(1) - -

+

awk(1) cc(1) make(1)

-- cgit v1.2.3