def packvalue(value, *properties):
    '''
    Store a specified value to specified property path. Often used in nstruct "init" parameter.
    
    :param value: a fixed value
    
    :param properties: specified field name, same as sizefromlen.
    
    :returns: a function which takes a NamedStruct as parameter, and store the value to property path.
    
    '''
    def func(namedstruct):
        v = namedstruct._target
        for p in properties[:-1]:
            v = getattr(v, p)
        setattr(v, properties[-1], value)
    return func
Store a specified value to specified property path. Often used in nstruct "init" parameter.
    
    :param value: a fixed value
    
    :param properties: specified field name, same as sizefromlen.
    
    :returns: a function which takes a NamedStruct as parameter, and store the value to property path.