This one works, but is ugly, especially if the tuple consists of very many fields.
var
frameTextDefaults = (
author: "Thomas",
version: "unknown")
frameTextDefaults = (
author: "Ralf",
version: frameTextDefaults.version)
Alternatively, what can I do if I want to change only one value in a tuple that consists of very many fields?
Here you go:
var
frameTextDefaults = (
author: "Thomas",
version: "unknown")
echo frameTextDefaults
frameTextDefaults.author = "Ralf"
echo frameTextDefaults
frameTextDefaults[0] = "Thomas Again"
echo frameTextDefaults
There is also sugar for this:
import sugar
var
frameTextDefaults = (
author: "Thomas",
version: "unknown")
frameTextDefaults = frameTextDefaults.dup:
author = "Ralf"
echo frameTextDefaults