Christian Couder <chrisc...@tuxfamily.org> writes:

> but we also want to say:
>
>     action = do_Y_if_X_and_Z AND do_U_if_V
>
> For example some people might want:
>
>     if_exists = overwrite
>     if_missing = add
>
> while others might want:
>
>     if_exists = overwrite
>     if_missing = do_nothing
>
> and I don't see how we can say that with just:
>
>     action = do_Y_if_X_and_Z

That is a very relevant illustration that makes me realize why I
found your "if-exists/if-missing = do-Y-if-Z" somewhat distasteful.

Your

     if_exists = add_if_different

says "if the same key is there, add it if the value is different",
but it also implicitly says "donothing if the value is the same".

That is, you are saying with the above

     if_exists = add_if_different AND ignore_if_same

So you already have to support more than one actions depending on
the condition, unless you want to limit the actions for all the
cases other than X to be only "ignore" when you invent your next
"do_Y_if_X", X being "different" in this case, but you support (and
need to support) "different-neighbour" and other random collections
of conditions, I think.  Which is essentially the same as saying
that you need this:

>     action = do_Y_if_X_and_Z AND do_U_if_V

Again, unless all the U's are limited to "ignore", that is.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to