// dimento // ======= // // dimento is a set of extensions to the C programming language // to use the extra dimento features you must #include "dimento.h" // // the dimento main code block can be used in place of a main routine, // and is delimited with the dimento_start and dimento_end keywords, e.g. // dimento_start // ... "main" statements go here // dimento_end // (you cannot have both a main routine and a dimento_start/end block) // // dimento variables are all fixed point floats, declared using // decl(a,b,c); // // the assumed return type of all dimento functions is float, // and dimento function declarations have the form: // func(fname, arg1, arg2, ...) { // func body // } // dimento functions can be declared with anywhere from 1-6 parameters // // function calls can be made with the format // eval(fname, arg1, arg2, ...) // // both an expression and its result can be displayed (stdout) using // the syntax prt(expression); e.g. the prt below displays "3*9 = 27" // prt(3*9); // // dimento uses ternary logic instead of binary, i.e. there // are three logic values: false, true, maybe // numerically, negative values are treated as false, // positive values are treated as true, // zero is treated as maybe // the compound logic operators supported are // AND(x,y) returns false if either operand is false (negative) // returns true if both operands are true (positive) // returns maybe otherwise // OR(x,y) returns true if either operand is true (positive) // returns false if both operands are false (negative) // returns maybe otherwise // NOT(x) returns true if x is false (negative) // returns false if x is true (positive) // returns maybe otherwise // the test operator in dimento has the format test(x) // and returns true if x is positive, // false if x is negative, // maybe otherwise // // dimento if statements are expressions that return a value, // and have the form // if(expression, falseval, maybeval, trueval) // where falseval is returned if the expression is false, // trueval is returned if the expression is true, // and maybeval is returned otherwise // // the dimento while loop has the form // while (variable, logicval) { // ... body of loop ... // } // where the logicval is one of true, false, maybe, and the loop body is // entered on each pass providing test(expression) equals the logicval // e.g. // while(x,maybe) { // ... do this while test(x) evaluates to maybe ... // }