function o = nested_assignment(name_list, value)
    idx.type = ".";
    idx.subs = {};

    name_list_length = length (name_list);

    for i = 1:name_list_length
        idx.subs{i} = name_list{i};
    endfor

    o = struct ();
    subsasgn (o, idx, value);
endfunction

