Difference between revisions of "Extensible Object Script"
(→Examples) |
|||
| Line 84: | Line 84: | ||
<shl> | <shl> | ||
| + | // A Simple While-Loop | ||
var a = 0; | var a = 0; | ||
while(true) | while(true) | ||
| Line 93: | Line 94: | ||
continue; | continue; | ||
a = 10; // this line is never evaluated | a = 10; // this line is never evaluated | ||
| + | } | ||
| + | </shl> | ||
| + | <shl> | ||
| + | // Two For-Loops | ||
| + | var arr = []; | ||
| + | |||
| + | for( var i=0; i<10; i++ ) | ||
| + | arr[i] = i; | ||
| + | |||
| + | var sum = 0; | ||
| + | for( var item : arr ) | ||
| + | sum += item; | ||
| + | </shl> | ||
| + | <shl> | ||
| + | // Simple Recursion | ||
| + | function fib(n) | ||
| + | { | ||
| + | if( n == 0 ) | ||
| + | throw new Exception("Invalid Input"); | ||
| + | else if( n == 1 ) | ||
| + | return 1; | ||
| + | else if( n == 2 ) | ||
| + | return 1; | ||
| + | else | ||
| + | return fib(n-1) + fib(n-2); | ||
} | } | ||
</shl> | </shl> | ||
Revision as of 04:57, 27 December 2022
|
Extensible Object Script | |
|---|---|
| Developer | Netroda Technologies, A. Zeneli et. al. |
| Type | Scripting Language |
| Licenses | Public Domain |
| Initial release |
Dec. 1998 |
| Current Version | 2.4 |
| Platform | EOSRuntime (Java / Platform Independent) |
| Origin |
|
| Typing | Dynamic, Weak |
| Influences | Java, ActionScript, JavaScript |
Extensible Object Script (short "EOS") is the Scripting language used for Systems Based on the Extensible Services / Server for Automation family. Extensible Object Script features Object mixing, caching, lambda expressions and strict/weak typing.
Extensible Object Script runs inside the ES/S-A Enviroment (Java-Based) and is compatble with Java Object (Objects extending java.lang.Object). As Java-Based Language (Processed by JJ and Apache BCEL) it is theoretically Plattform independent, as the runtime can be executed on any Java-capable platform.
Examples
// A Simple While-Loop
var a = 0;
while(true)
{
a++;
if( a > 5 )
break;
else
continue;
a = 10; // this line is never evaluated
}
// Two For-Loops var arr = []; for( var i=0; i<10; i++ ) arr[i] = i; var sum = 0; for( var item : arr ) sum += item;
// Simple Recursion
function fib(n)
{
if( n == 0 )
throw new Exception("Invalid Input");
else if( n == 1 )
return 1;
else if( n == 2 )
return 1;
else
return fib(n-1) + fib(n-2);
}