From da494cd8a01d49a1f08107201fa4e1fc36d5aa1e Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Wed, 22 Oct 2014 13:54:08 -0400 Subject: [PATCH] Spec: must memoize when resolving substitutions --- HOCON.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/HOCON.md b/HOCON.md index d439fed6..6a00fefc 100644 --- a/HOCON.md +++ b/HOCON.md @@ -825,6 +825,15 @@ working with ordered maps rather than unordered maps, which is too constraining. Implementations only have to track order for duplicate instances of the same field (i.e. merges). +Implementations must set both `a` and `b` to the same value in +this case, however. In practice this means that all substitutions +must be memoized (resolved once, with the result +retained). Memoization should be keyed by the substitution +"instance" (the specific occurrence of the `${}` expression) +rather than by the path inside the `${}` expression, because +substitutions may be resolved differently depending on their +position in the file. + ### Includes #### Include syntax