Functionally Equivalent Language Translation →
(concat expr1 expr2 ... exprN) ; string concatenation of terms (concat "Hello, " "World!") (. "Use the force," "or FELT!") ; shortform
See also EMIT
The string concatention instruction, CONCAT
has the short-form .
, which is the dor, or period, character. FELT does not impose any restrictions on the eventually types of the various expressions that you ask to be strung together. They must make syntactical sense to the back-end coder, that is the only requirement.
Always remember that FELT began as an alternative way for writing PHP code which explains why the concatentation instruction short-form is a .
character. It will be translated into whatever is required by the chosen back-end coder. So for example, in javaScript it will become the +
symbol.
(emit (concat "Hello, " "World!\n")) (emit (+ 1 2 3) " Four " :five "\n")
The above produces this PHP code,
echo ("Hello, " . "World!\n"); echo (1 + 2 + 3), " Four ", 'five', "\n";
Running this through the PHP interpreter we get this output:
$ felt docex.felt -cw | php Hello, World! 6 Four five
For javaScript code we get the following rendered code:
console.log(("Hello, " + "World!\n")); console.log((1 + 2 + 3)+ " Four "+ 'five'+ "\n");
and the output from running it thorugh Node.js is:
$ felt docex.felt -as nodejscoder | node Hello, World! 6 Four five