::SHE+ILA:: syntax summary

33
0
  • Squishy Plushie's avatar Artist
    Squishy Pl...
  • DDG Model
    QWEN
  • Access
    Public
  • Created
    2d ago
  • Try

Prompt

A large purple plushie reading a book.

More about ::SHE+ILA:: syntax summary

::SHE+ILA:: is a special-purpose retro hobbyist operating system and table-driven programming language compiler, with experimental AI and research tendencies. It stands for "Segmented Hierarchical Environment" (the protected-mode datastore) + "Interactive Language Architecture" (the data processor). Currently it is built for the 80x86 family, i.e. the ubiquitous PC. Smaller cut-down versions have previously run on the Apple ][, the Atari 800XL, and the DEC PDP11/70. Here is quick summary of the syntax :
Foo <:: 1; // Set variable Foo to the integer value 1
// This is a comment, terminated by a new line or a semicolon
Foo <:: "Hello World"; // Set variable Foo to the text string "Hello World"
Foo <:: (2, 4, 6, 8); // Set variable Foo to the array (2, 4, 6, 8)
Bar <:: #Foo; // Set variable Bar to the length of Foo, i.e. the number of elements in the array
Bar <:: Foo[1]; // Set variable Bar to the first element of the array Foo. Note that ::SHE+ILA:: indexes arrays from 1 (like Fortran), not 0 (like C++)
Bar <:: Foo[999]; // Indexing out of range is legal, since it repeatedly wraps round, modulo fashion
Bar <:: Foo[`1]; // `1 means "minus 1" and it refers to the final (rightmost) element of the array.
Foo <:: a+ b; // Arithmetic and logical operators ("ALUops") include + - * $/ ^ /\ \/ @@ (see below)
// - is "subtract" whereas ` is used to make a number negative. This avoids confusion and allows us to say things like (1, 2, `3, 4) i.e. put negative numbers in an array
Foo << (10, 12); // Insert the array (10, 12) into the variable Foo, making it (2, 4, 6, 8, 10, 12)
Foo <:: {ttyout ("Hello World", %, CRLF)}; // Define a function Foo which prints "Hello World", then its parameter, then a new line
Foo(42); // Call the function Foo with a parameter of 42
// This will print Hello World 42
i <::0; {* i<10 : ttyout ("i is ", i, CRLF); i++ *}; // Repeatedly print the value of i and then increment (I++) it, forming a loop
{!thread1, thread2, thread3!}; // Start three parallel functions (threads) to execute concurrently
{? DIV0 : ttyout("oops"), ?kbd ?}; // Trap a divide-by-zero event and wait for a keyboard event
Foo <:: 12.34i5.6j7.8k9.0; // Yes we have quaternions and BCD floating point values
More later ... :)

Comments


Loading Dream Comments...

Discover more dreams from this artist