magic.lambda.system
This project contains “system slots” to be able to invoke system commands, and/or dynamically compile and load plugins, etc. More specifically the project contains the following slots.
- [system.compile] - Compiles a piece of C# code and returns the result as raw bytes
- [system.plugin.load] - Loads the specified assembly and initialises any slots found in it
- [system.plugin.unload] - Unloads a previously loaded plugin assembly and unregister any slots
- [system.plugin.execute] - Short hand combining load with unload and a lambda object
- [system.plugin.list] - Lists all dynamically loaded plugins
- [system.execute] - Execute the specified command returning the result to caller
- [system.debug] - Evaluates a lambda object while recording every slot invocation, and returns the recording
- [system.os] - Returns description of your operating system
- [system.is-os] - Returns true if your underlying operating system is of the specified type
The most important feature of this project is probably that it gives you the ability to dynamically compile C# code, persist to an assembly/dll, and dynamically load this assembly as if it was a “plugin”.
Querying operating system version
In addition to the above slots this project also contains the following slots.
- [system.os] - Returns description of your operating system
- [system.is-os] - Returns true if your underlying operating system is of the specified type
The last slot above takes an argument such as “Windows”, “OSX, “Linux”, etc, and will return true of the operating system you are currently running on belongs to the specified family of operating systems. Below is example usage of both.
system.is-os:OSX
system.os