def setval(self, varname, value):
        """
        Set the value of the variable with the given name.
        """
        if varname in self:
            self[varname]['value'] = value
        else:
            self[varname] = Variable(self.default_type, value=value)
Set the value of the variable with the given name.