add return types for control functions

implement set_var
implement set_var_slice