OKeval NAME OKeval - A standard built-ins implementation and RPL interpreter, based on the OKit library. AUTHOR Author: Yann LANDRIN-SCHWEITZER Contact: varkhan@free.fr Homepage: http://varkhan.free.fr/ SYNOPSIS OKeval -h | -H | -H name | [options] -f file | [options] code-block ... DESCRIPTION OKeval provides a complete set of basic instructions, and can parse and execute OKit programs, respectively from the command line, and with the -f option, from files. -h : prints this help and returns -H : prints help about supported built-ins -f : introduces a file name to be loaded Options: A leading '-' followed by one or more characters among c * : prints 'echo' comments in read file (started by ##) C * : don't print 'echo' comments in read file r : prints error reports for each code-block R : don't print error reports s : prints all stack levels for each code-block S : prints all stack levels at the end of execution p : prints the first stack level for each code-block P : prints the first stack level at the end of execution 0 : absolutely quiet execution - usefull for stack preload or verbosity reset (*: only meaningfull when used with "-f file") Syntax: Files must contain one code-block per line (use \ before an \n to wrap long lines). Lines whose first character is # are comments, silently ignored, or echoed when the TWO first characters are # and the -c flag is set. A code-block is a space-separated list of numbers : +3.141526e00 / -12345 strings : "hello world" builtins : «HELP» / «*» barewords: interpretated in order as numbers, then builtins, and strings if everything else failed lists : [ foo bar 10 2 «/» ] ( any of the above, separated by spaces and inside square brackets ) Built-ins: To get the list of known built-ins, type: OKstrevl -H For specific help about some built-in, type: OKstrevl -H built-in_name Here is a list of currently implemented built-ins, with a short description: != Boolean numeric unequality % Integer remainder & Bitwise and ' * Numeric product + Numeric addition - Numeric substraction / Numeric quotient : Integer exact division < Boolean less-than comparison <= Boolean less-than-or-equal comparison == Boolean numeric equality > Boolean more-than comparison >= Boolean more-than-or-equal comparison @ Numeric power AND Boolean conjunction BRK Breaks a compound object CALV Execute a variable's content CAT Concatenes two compound objects CLRSTK Clears the stack COMP Boolean type test for a compound object DEC Numeric 1-decrementation DELV Undefines a variable DEP Depth of the stack DROP Drops the first object on stack DROPN Drops the N first object on stack DUMP Prints the stack DUP Duplicates the first object on stack DUPN Duplicates the N first objects on stack in order EQL Tests if two objects are equal ERR Aborts with specified error EXEC Execution of a portion of code EXSV Tells wether a variable is defined FLSE Always False FLTP Boolean type test for a float GET Gets an object by its position in a compound object GRP Builds a compound object GSZ Size of a compound object HELP Returns the description of a builtin IF 'If then' control structure IFE 'If then else' control structure INC Numeric 1-incrementation INTG Boolean type test for an integer ISDEF Tells wether first object on stack is not 'undef' LOOP Loops until code execution return false NOP Does nothing NOT Boolean negation OBJ Parse a string into objects OR Boolean disjunction PEEK Gets the object on level stack[0] POKE Puts the object stack[1] on level stack[0] PONG Inserts the object stack[1] on level stack[0] PRINT Prints an object PRINTLN Prints an object and \n PRINTSTR Prints a string with \[abfnrt] converted RCLV Recalls a variable's value RND Rounds a number ROLSTK Rolls down the last object on stack, if any ROTSTK Rolls up the first object on stack, if any STOV Stores a value in a variable STR Makes a string from an object STRG Boolean type test for a string SWAP Swaps the two first objects on stack TRUE Always True UNDEF Pushes 'undef' VARS Lists all existing variables ^ Bitwise xor | Bitwise or ~ Bitwise 1-complement