Has remove() always thrown an error if idx is beyond the end of list?
Either way, what's the reasoning behind it doing so? If the items
aren't there to begin with, then great, that's precisely what I want.
The documentation should be updated to reflect this state of affairs.
Here's a patch:
--- eval.txt 2008-08-09 21:45:52.000000000 +0200
+++ eval.txt.new 2008-10-21 13:51:50.000000000 +0200
@@ -4482,8 +4482,10 @@
return it.
With {end}: Remove items from {idx} to {end} (inclusive) and
return a list with these items. When {idx} points to the same
- item as {end} a list with one item is returned. When {end}
- points to an item before {idx} this is an error.
+ item as {end} a list with one item is returned. When {idx}
+ points to an item beyond the last one in {list} this is an
+ error. When {end} points to an item before {idx} this is an
+ error.
See |list-index| for possible values of {idx} and {end}.
Example: >
:echo "last item: " . remove(mylist, -1)
The formulation isn't very good, but it's in sync with the other comments.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---