Task Guide

Function()function
{Required}required argument
[Optional]optional argument
*function not yet complete
!function not yet implemented

Dark black functions mean that the function has been implemented
Gray functions mean that function is not yet implemented


Task Basics

Meaning of operators

:= {variable}

The funnel. Put it after a function. Takes the result of a function, dumps it into a variable. Otherwise, result is thrown into bitbucket, which can be good and bad.

Various development notes

There is currently very little to no error checking implemented at this time.

You may find that paran parsing is not implemented in most functions. Yea, they make the language structure look nice, but they are unneeded and just increase overhead. We will do without some of them for now.

Some functions are not fully complete. Take note of the "Dev Status" before you use a function.


Subroutine, process handling, and children

Child( {Subroutine}, [subroutine],...[subroutine] )

Description

Launch a series of multithreaded subroutines as children processes. Don't wait for any to complete. Execute next line immediately.

Dev Status

Completed in Nov28-2003 version.

ChildWait ( {Subroutine}, [subroutine],...[subroutine] )

Description

Launch a series of multithreaded subroutines as children processes and wait for them all to complete before executing next line.

Dev Status

ChildWait will never return, even if all subs complete. Sub completion notification not yet implemented. No foreseeable implementation difficulties.

Sub {Subroutine}

Description

Mark the start of a subroutine. The interpreter indexes these before execution.

Dev Status

Complete. Multithreading complete.

Endsub

Description

Mark the end of a subroutine. If interpreter executes this line, subroutine thread will close out and return. If last existing thread, script execution halts.

Dev Status

Mostly complete. Execution of this line doesn't close out thread just yet. Thread will just hang, but pretty much has the same effect as closing out.


Variable States

Buff {FIFO/FIPO Variable}

Description

Start the buffering process in subroutine for FIFO/FIPO variable.

Dev Status

Not yet implemented. Will implement once core FIFO/FIPO stuff is finished. This will be tricky as hell.

UnBuff {FIFO/FIPO Variable}

Description

Stop the buffering process in subroutine for FIFO/FIPO variable.

Dev Status

Not yet implemented. Will implement once core FIFO/FIPO stuff is finished. This will be tricky as hell.

Comm {Variable} [= value]

Description

Initialize an interprocess variable. All processes can read and modify this variable. A modification generates a Comm_Mod notification.

Dev Status

Complete except for time saving step: [= value]. This must be done in a Let at the moment. No issues in implementing this.

GlobalFIFO {variable} [cap]

Description

Initialize a FIFO variable. Owner can only modify. Can be memory intensive. Cap specifies element buffer size before overflow. Defaults at 16.

Dev Status

Not yet implemented. Tricky stuff. Could be memory intensive depending on how lazy the subs that use this fifo end up being.

GlobalFIPO {variable} [cap]

Description

Initialize a FIPO variable. Owner can only modify. Priorities can be given for items put into the FIFO. Can be memory intensive. Cap specifies element buffer size before overflow. Defaults at 16.

Dev Status

Not yet implemented. Tricky stuff, memory intensive, bla bla bla ..

GlobalACK {variable} [cap]

Description

Initalizes an ACK-based FIFO. Acknowledgements are sent via notification to owner to insure delivery. Can be memory intensive. Cap specifies element buffer size before overflow. Defaults at 16.

Dev Status

Not yet implemented. Tricky stuff, memory intensive, bla bla bla ..

Local {variable} [= value]

Description

Initialize a local variable for a sub. They cannot be read outside of local sub. No notifications are sent if it is modified.

Dev Status

Not yet implemented. Make sure that these do not overlap other global variable types or else god knows what data you'll get back. Error checking for conflicting variable types (probably done at pre-parsing state) comes later. Right now i dont expect any lame ass programmers to screw this up.

Global {variable} [= value]

Description

Initialize an interprocess variable. Only the owner can modify the variable. A modification generates a Global_Mod notification.

Dev Status

Not yet implemented.

Constant {variable} = {value}

Description

Initialize an interprocess variable. It cannot be changed after it has been created.

Dev Status

Not yet implemented.


Variable Control

Let {Variable} = {value}

Description

Make something equal something.

Dev Status

Complete. This may stay in the language for good, but we may allow variable assignment like $a = 100 or $a = $q later on.

Inc {variable} [value]

Description

Increment a variable by 1 or specified value.

Dev Status

Not yet implemented. This may change to {variable}++ later on.

Dec {variable} [value]

Description

Decrement a variable by 1 or specified value. This may change to -- later on.

Dev Status

Not yet implemented. This may change to {variable}-- later on.

Math {variable} {variable or number} {operation} {variable or number}

Description

Perform an operation, placing the result into variable.

Dev Status

Not yet implemented. This will change to standard $a = 4 + 2 like stuff in a later revision.

Store {destination variable} {source variable}

Description

Copy a variable's content into another variable.

Dev Status

Not yet implemented. This will be replaced with something like $a = $b later on.


String wrappers

Im currently mapping a lot of these functions to rexx string functions ... they are good functions that have been found in a lot of other languages, so what the hell..

Its a pain in the ass to parse out stuff when the function isnt first. Im lazy, so we are going to do this := thing after the function. I might change this in the future because its counterintuitive.

index({string}, {search}, [count]) := $variable

Description

Determine where {search} is in the {string}. [count] specifies the second {search} in the string. It returns -1 when there isnt any more. Puts it into $variable.

Dev Status

Not yet implemented.

substr({string}, {start}, {stop}, [offset]) := $variable

Description

Pulls out part of a string, character by character. {string} is the string to search in, starting from {start} to {stop}. Omitting word [offset] makes {stop} and absolute position. Put it into $variable.

Dev Status

Not yet implemented.

subword({string}, {start}, {stop}, [offset]) := $variable

Description

Pull a group of words from {string}, starting from word {start} and ending word {stop}. word [offset] makes the ending word an offset from {start} instead of an absolute position. Put it into variable.

Dev Status

Not yet implemented.

word({string}, {word number}) := $variable

Description

Pull word {word number} out of {string} and put into $variable.

Dev Status

Not yet implemented.

words({string}) := $variable

Description

Count the number of words. Returns number of words into $variable. All words are consider words if they have spaces around them. Excessive spaces dont count as words.

Dev Status

Not yet implemented.


Special Variables

$randrandom between 1 and 9999
$secscurrent seconds since midnight
$timecurrent time
$datecurrent date


Control Structures

Sleep ( {seconds} )

Description

Sleep for a certain number of seconds.

Dev Status

Complete. Would be cool if we could do fractions of a second?

Do {specifier}

Description

Start of a loop. The specifier is the loop number. The specifier can be any word or number with no spaces.

Dev Status

Nearly complete. Specifier does not work, only one loop instance is supported at the moment.

Loop {specifier}

Description

End of a loop -- go to specifier Do. The specifier can be any word or number with no spaces.

Dev Status

Nearly complete. Specifier does not work, only one loop instance is supported at the moment.

Wait ( [notification type], [name], [content] )

Description

Wait for something to happen. If no notifications are discovered, the subroutine will remain suspended in a wait state.

If nothing is specified, routine will come out of wait whenever an event occurs.

Currently supported notification types:

Notification TypeDescription
VARVariable change
STDINSTDIN data waiting
GUIGUI change
SYSTEMSystem Notification
IOGeneral I/O

Name can be specified to search for a particular type of a particular notification. If VAR is used, this can be a variable name. If none is specified, all of [notification type] will pull subroutine out of wait. IE, Wait( "VAR", "name") would come out of wait state if the value of $name ever changed from its previous value.

Content can be specified to search for particular content of a particular type of a particular notification. If VAR is used, this can be variable content. IE, Wait( "VAR", "name", "Casey") would come out of wait state if $name ever equaled the string "Casey".

Dev Status

Partly complete. Wait only takes a variable name at the time. No need to specify VAR. content is not accepted at this time. This function just needs work and expansion, no hardships are expected.

If {condition} Then {code fragment to execute}

Description

Check to see if a specific condition is true, then execute a code fragment.

Dev Status

Currently supported evaluations:

OperatorDescription
=Equals
<Less Then
>Greater Then
>=Greater Then or Equal To
=<Less Then or Equal To
~=Not Equal To

Only one code fragment is supported at this time after the evaluation. This should be enough until the parser is smart enough to selectively evaluate blocks encapsulated in brackets { }. It serves the same functionality, but a little crude to the programmer.

FragmentDescription
FlipFlip the current thread to another subroutine without creating another thread

This fragment executes a subroutine under the current thread number. Basically, the current subroutine thread index number and program line counter is stored away. Then the thread index is set to the subroutine's numerical value. The program counter is set back to 1. The subroutine executes. When it reaches an 'Unflip' function, the thread index and program line counter are reset to their original values (plus one), and the original thread continues after the If statement that caused the flip.

Flip {Subroutine}

Description

Flip the current thread to another subroutine without creating another thread. Use Unflip to return.

Dev Status

This functionality will later be replaced with usage of brackets { } to specify a block of code, usually executed when only a condition is met. In the background, this will be treated as a subroutine after parsing, but eventually it will be transparent to the user.

Unflip

Description

Unflip the current subroutine back to its originator.

Dev Status

This functionality will later be replaced with usage of brackets { } to specify a block of code, usually executed when only a condition is met. In the background, this will be treated as a subroutine after parsing, but eventually it will be transparent to the user.


Output

Print ( {string} )

Description

Prints a string to the display. Can be a variable or a text encapsulated in double quotes.

Dev Status

Partly complete. Currently, interpreter only can print a text string or a variable. But not both at the same time. Print automatically creates a carriage return (this will not do this in the future and require an escaped newline code). The following bellow will be the new accepted type for print in the future:

Print ("I like to smoke pot, but it costs me '$price' a ounce") or Print ("I feed my cat '$food', he smells like '$smell'.) !