Comments
Loading Dream Comments...
You must be logged in to write a comment - Log In
Suppose we want to add a new user-defined function to an existing ::SHE+ILA:: library, for example let's add "mysqrt()" to ::MATHS::.
£+::MATHS:: // Make ::MATHS:: our current segment, enable writing ("+");
!1!1 << &{ % ^ 0.5 }; // Parameter to the halfth power is square root;
!1!0 << "mysqrt"; // Put the name in the symbol table (row 0 of the Buf);
There are other ways of doing this, including a built-in system function
which also locks the library with a mutex for the duration (causing other tasks to suspend during the update).
These will be documented later.
Note: "!1!1" is a shorthand for "::MATHS::[1][1]" (or whatever our current segment is called).
The first Buf in a segment is always the "trigger Buf", containing entry points and short lambdas.
"!1!0" is the same as "::MATHS::[1][0]", which is of course the symbol table.
::MATHS::[1] is the root Buf in the current segment,
and contains the symbol table [1][0] and the trigger Buf [1][1].
(Substitute your segment name for "::MATHS:: if you are editing a different segment).