|
Code Manifestation -- Strings as Code |
Sheerpower allows strings to contain code. This makes it easy to design and implement your own business-specific scripting languages. The following example uses the eval() function:
The contents of c$ are compiled into Sheerpower bytecode at runtime and then evaluated. The result is stored in d. Because the eval() function can return any data type depending on the string that was passed into it, d must be declared as a dynamic variable.
In special cases where greater runtime flexibility is required, Sheerpower supports code manifestation, allowing entire blocks of code to be compiled and executed dynamically at runtime using the execute statement:
This runtime compilation capability means Sheerpower can act as both a host language and a code generator. Developers can build domain-specific scripting engines, dynamic rule processors, or business logic layers that evolve without redeployment. It combines the performance of compiled code with the adaptability of scripting — a powerful advantage for systems that need to respond to changing business logic or external data sources in real time.
(Show/Hide Sheerpower Code Manifestation Takeaways)|
Hide Description
|
|
|
Enter or modify the code below, and then click on RUN |
|
Looking for the full power of Sheerpower?
Check out the Sheerpower website. Free to download. Free to use. |