diff options
| author | Martin Atkins <mart@degeneration.co.uk> | 2018-02-04 11:20:42 -0800 |
|---|---|---|
| committer | Martin Atkins <mart@degeneration.co.uk> | 2018-02-04 11:20:42 -0800 |
| commit | 18a92d222b21831715441f4c8a6ba25ea1bd3e12 (patch) | |
| tree | 34daf209b98bf2c2102f66ad1b0456511fb6ef77 /cmd/hcldec | |
| parent | 2ddf8b4b8c9659fb62262037e41d0293306234e9 (diff) | |
ext/userfunc: use bare identifiers for param names
Now that we have the necessary functions to deal with this in the
low-level HCL API, it's more intuitive to use bare identifiers for these
parameter names. This reinforces the idea that they are symbols being
defined rather than arbitrary string expressions.
Diffstat (limited to 'cmd/hcldec')
| -rw-r--r-- | cmd/hcldec/spec-format.md | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/cmd/hcldec/spec-format.md b/cmd/hcldec/spec-format.md index d80beda..9f4d7a9 100644 --- a/cmd/hcldec/spec-format.md +++ b/cmd/hcldec/spec-format.md @@ -364,7 +364,7 @@ block type: ``` function "add_one" { - params = ["n"] + params = [n] result = n + 1 } ``` @@ -379,9 +379,15 @@ input file: ``` function "upper" { - params = ["str"] + params = [str] result = upper(str) } + +function "min" { + params = [] + variadic_param = nums + result = min(nums...) +} ``` Custom functions defined in the spec cannot be called from the spec itself. |
