lang: Add a resource-specific elvis operator

This allows you to omit a resource parameter programmatically, and
avoids the need of an `undef` or `nil` in our language, which would
contribute to programming errors, crashes, and overall reduced safety.
This commit is contained in:
James Shubin
2018-02-25 20:46:30 -05:00
parent 67607eba8b
commit 8e01b6db48
6 changed files with 130 additions and 10 deletions

5
examples/lang/elvis0.mcl Normal file
View File

@@ -0,0 +1,5 @@
$b = true # change me to false and then try editing the file manually
file "/tmp/mgmt-elvis" {
content => $b ?: "hello world\n",
state => "exists",
}