terraform/lang/funcs
Martin Atkins 30497bbfb7 lang/funcs: zipmap accepts tuple of values and produces object
Now that our language supports tuple/object types in addition to list/map
types, it's convenient for zipmap to be able to produce an object type
given a tuple, since this makes it symmetrical with "keys" and "values"
such the the following identity holds for any map or object value "a"

    a == zipmap(keys(a), values(a))

When the values sequence is a tuple, the result has an object type whose
attribute types correspond to the given tuple types.

Since an object type has attribute names as part of its definition, there
is the additional constraint here that the result has an unknown type
(represented by the dynamic pseudo-type) if the given values is a tuple
and the given keys contains any unknown values. This isn't true for values
as a list because we can predict the resulting map element type using
just the list element type.
2018-11-28 07:45:43 -08:00
..
testdata lang/funcs: port some of Terraform's built-in functions 2018-10-16 18:48:28 -07:00
cidr.go port compact function 2018-10-16 18:49:20 -07:00
cidr_test.go port cidr functions 2018-10-16 18:49:20 -07:00
collection.go lang/funcs: zipmap accepts tuple of values and produces object 2018-11-28 07:45:43 -08:00
collection_test.go lang/funcs: zipmap accepts tuple of values and produces object 2018-11-28 07:45:43 -08:00
crypto.go lang/funcs: never include the private key in error output 2018-10-16 18:50:29 -07:00
crypto_test.go porting crypto functions 2018-10-16 18:49:20 -07:00
datetime.go cleanup comments for nicer godocs 2018-10-16 18:49:20 -07:00
datetime_test.go cleanup comments for nicer godocs 2018-10-16 18:49:20 -07:00
encoding.go base64decode: check that the decoded (not encoded) string is valid UTF-8 2018-10-16 18:49:20 -07:00
encoding_test.go base64decodeFunc now checks for valid UTF-8 2018-10-16 18:49:20 -07:00
filesystem.go lang: Add fileexists function 2018-10-17 10:18:07 +01:00
filesystem_test.go lang: Add fileexists function 2018-10-17 10:18:07 +01:00
number.go porting functions 2018-10-16 18:49:20 -07:00
number_test.go porting functions 2018-10-16 18:49:20 -07:00
string.go lang/funcs: in "sort", don't panic if given a null string 2018-10-16 19:14:11 -07:00
string_test.go porting many functions 2018-10-16 18:49:20 -07:00