Bug 396697 - remove builtin should not return nil (?)
Summary: remove builtin should not return nil (?)
Status: RESOLVED FIXED
: 431855 (view as bug list)
Alias: None
Product: openSUSE 11.1
Classification: openSUSE
Component: YaST2 (show other bugs)
Version: Alpha 0
Hardware: Other Other
: P4 - Low : Enhancement (vote)
Target Milestone: ---
Assignee: Martin Vidner
QA Contact: Jiri Srain
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-03 13:10 UTC by Jiří Suchomel
Modified: 2008-10-07 13:01 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jiří Suchomel 2008-06-03 13:10:41 UTC
OK, it is documented correctly [1]:

"Remove the value with the key KEY from a map. Returns nil if the key is invalid."


IMHO it would be friendlier if the function would return the unchanged map if the key does not exist (see e.g. bug 396666 for a problem that could be avoided). I'm not sure, however: maybe someone expects the nil value, which is documented...



[1] http://forgeftp.novell.com/yast/doc/SL10.3/tdg/YCPBuiltinMap_remove.html
Comment 1 Stefan Hundhammer 2008-06-03 13:32:51 UTC
IMHO the proposal makes a lot of sense - the documented behaviour, however, does not. It forces every application to wrap the remove() call in checks for nil or for the key that is to be removed. It's destructive.
Comment 2 Stanislav Visnovsky 2008-10-03 10:39:21 UTC
*** Bug 431855 has been marked as a duplicate of this bug. ***
Comment 3 Stanislav Visnovsky 2008-10-07 13:01:15 UTC
'remove' builtins now return unchanged parameter on error.

yast2-core-2.17.16