typesafehub/config — Issue #3: support string and object in value concatenation
Author: havocp
Created: 2012-02-07 14:01:56+00:00
State: open

The README proposes extending the string value concatenation to arrays and objects. So

${foo} "hello"

concats ${foo}'s value with "hello", with arrays

${foo} [1,2,3]

prepends ${foo} to the array, and with objects it would merge the two, so

${foo} { name = "east" }

would merge { name = "east" } into ${foo}

This would among other things give a nicer syntax when "inheriting", before:

data-center-east = ${data-center-generic}
data-center-east = { name = "east" }

after:

data-center-east = ${data-center-generic} { name = "east " }

also, if substitutions are allowed to refer to the previous value of the field being defined, you could use this to extend paths.

path = [somethingBefore] ${path} [somethingAfter]

For more bonus points, support +=:

path += somethingAfter

equivalent to

path = ${path} [somethingAfter]