Olaf Dabrunz wrote:
> This is an idea to play with.
>
> This variant of the extend() patch implements a fourth, optional
> parameter to extend(). With the parameter the error handling method can
> be selected: "stop" on error (keep partial changes), "cont"inue after
> error or "rollback" changes and return on error.
>
> Documentation is included, and the existing tests have slightly been
> updated to test the error handling. But tests are not complete.
>
> Even extend(list, list2, where, error_action) works: error_action is
> ignored, as list extension does not encounter errors (except for "out of
> memory").
>
> Out of memory error handling is unchanged: for dictionaries, the
> extension always continues, and list extension always stops on the first
> error.
>
> For this reason, "rollback" is really the wrong name for that error
> handling mode, as it never needs to roll back changes: all error checks
> are completed before any changes are made.
>
> But "rollback" implements all-or-nothing behavior (except when
> encountering OOM), and it was the best name I could come up with to
> convey that idea.
>
> Please comment.
Well, it's what anyone could ask for. But I suspect it won't be used
much, while it adds quite a few lines of code.
I don't recall people actually complaining about extend() not doing the
right thing. We have only been discussing making it work as documented.
I think this change adds too much flexibility.
--
hundred-and-one symptoms of being an internet addict:
12. You turn off your modem and get this awful empty feeling, like you just
pulled the plug on a loved one.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.