Inserting a new function into a ::SHE+ILA:: library [$4B]

Elegant Library with Stylish Women in Velvet Gowns
63
2
  • Squishy Plushie's avatar Artist
    Squishy Pl...
  • Prompt
    Read prompt
  • DDG Model
    DaVinci2
  • Access
    Public
  • Created
    19h ago
  • Try

More about Inserting a new function into a ::SHE+ILA:: library [$4B]

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).

Comments


Loading Dream Comments...

Discover more dreams from this artist