F.E.L.T.

Functionally Equivalent Language Translation

Standard Operators

It is worth stating again that the original instruction set and operators and such like were all inspired, if that is the right word to use, by PHP and as a consequence FELT supports all of the operators that PHP does (well, I've not found one it doesn't do yet but if you do, let me know as sometimes it's easy to forget the simple things!).

FELT is less verbose with operators...

As FELT is modeled on LISP, it is possible in FELT to take advantage of the fact that you don't need to explicitly place an operator between every pair of arguments, like PHP makes you do. For instance, here is how you would add a bunch of numbers in PHP:

$total = 1 + 2 + 3 + 4 + 5;

That's a lot of plus signs when all you want to do is add them! Here is the same program in FELT:

(defvar total (+ 1 2 3 4 5))

This concept applies throughout, the same concept as stated in the FELT Syntax Page page where is says that there is one form for all instructions, which is:

(instruction arg1 arg2 ... arg3)

Hopefully you can see that using +, or * etc. is just another instruction, albeit a numerical operation.

List of Recognised Operators

The following is a simple list of the operators that FELT has been told to look out for.

Standard Operators

These are the standard operators that you would expect to find. These can have any number of arguments applied and the operator will be placed in between each as desribed above to generate the equivalent expression in the chosen back-end target language:

Operator Description
+ (+ a b ... N) addition
- (- a b ... N) subtraction
* (* a b ... N) multiplication
/ (/ a b ... N) division

The remainder of the operators follow the same pattern i.e. as many arguments as you want to put in:

Operator Description
. string concatenation
% arithmetic modulo
& bit-wise AND
| bit-wise OR
^ bit-wise XOR
|| logical OR
and bit-wise AND
or bit-wise OR
xor bit-wise XOR
concat string concatenation

Unary Operators

The following are "unary" operators; they expect a single argument when called:

Operator Description
! logical-NOT brief
not logical-NOT longform

Binary Operators

The following are "binary" operators in that by their very nature they expect to have only two parameters passed with them:

Operator Description
> (> a b) -- a greater than b
< (< a b) -- a less than b
>= (>= a b) -- a greater than or equal to b
<= (<= a b) -- a less than or equal to b
== (== a b) -- a equal to b
!= (!= a b) -- a not equal to b
=== (=== a b) -- a same object/instance etc as b
!== (!== a b) -- a not same object/instance as b