This patch adds a simple function API for writing simple, pure functions. This should reduce the amount of boilerplate required for most functions, and make growing a stdlib significantly easier. If you need to build more complex, event-generating functions, or statically polymorphic functions, then you'll still need to use the normal API for now. This also makes all of these pure functions available automatically within templates. It might make sense to group these functions into packages to make their logical organization easier, but this is a good enough start for now. Lastly, this added some missing pieces to our types library. You can now use `ValueOf` to convert from a `reflect.Value` to the corresponding `Value` in our type system, if an equivalent exists. Unfortunately, we're severely lacking in tests for these new types library additions, but look forward to growing some in the future!
5 lines
118 B
Plaintext
5 lines
118 B
Plaintext
$d = datetime()
|
|
file "/tmp/mgmt/datetime" {
|
|
content => template("Hello! It is now: {{ datetime_print . }}\n", $d),
|
|
}
|