You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Comment to self: if two lists are merged (extended), and those lists use RefValues, then expansion (interpolation) won't work. The reason is that the DictPath includes the list indices, e.g. apt_repos:0:uri and those indices start at 0 for every list. Now, when two lists are merged, the reference to the base RefValue (in Parameters._occurrences) is overwritten by the RefValue of the mergee, causing it to not get expanded later.
DictPath is a gross hack, and I wish I didn't need it. One way around it would be to teach the output drivers to translate RefValue instances into their values once resolved. If that were the case, then we'd only need a list of RefValues, not a mapping between RefValues and their path, which is used to replace the with the value once interpolated.
Another solution might be to let list extension augment the indices in the DictPaths.
The text was updated successfully, but these errors were encountered:
This was easier than thought. The problem:
If two lists are merged (extended), and those lists use RefValues,
then expansion (interpolation) won't work. The reason is that the
DictPath includes the list indices, e.g. apt_repos:0:uri and those
indices start at 0 for every list. Now, when two lists are merged,
the reference to the base RefValue (in Parameters._occurrences) is
overwritten by the RefValue of the mergee, causing it to not get
expanded later.
Instead of just updating self._occurrences, we can populate it as we
update scalars, and on extending lists, we can add an offset to the
index in the path of the mergee.
Still: DictPath should go. One day…
Closes: #13
Signed-off-by: martin f. krafft <madduck@madduck.net>
This was easier than thought. The problem:
If two lists are merged (extended), and those lists use RefValues,
then expansion (interpolation) won't work. The reason is that the
DictPath includes the list indices, e.g. apt_repos:0:uri and those
indices start at 0 for every list. Now, when two lists are merged,
the reference to the base RefValue (in Parameters._occurrences) is
overwritten by the RefValue of the mergee, causing it to not get
expanded later.
Instead of just updating self._occurrences, we can populate it as we
update scalars, and on extending lists, we can add an offset to the
index in the path of the mergee.
Still: DictPath should go. One day…
Closes: #13
Signed-off-by: martin f. krafft <madduck@madduck.net>
Comment to self: if two lists are merged (extended), and those lists use
RefValues
, then expansion (interpolation) won't work. The reason is that theDictPath
includes the list indices, e.g.apt_repos:0:uri
and those indices start at 0 for every list. Now, when two lists are merged, the reference to the baseRefValue
(inParameters._occurrences
) is overwritten by theRefValue
of the mergee, causing it to not get expanded later.DictPath
is a gross hack, and I wish I didn't need it. One way around it would be to teach the output drivers to translateRefValue
instances into their values once resolved. If that were the case, then we'd only need a list ofRefValues
, not a mapping betweenRefValues
and their path, which is used to replace the with the value once interpolated.Another solution might be to let list extension augment the indices in the
DictPaths
.The text was updated successfully, but these errors were encountered: