Re: Add REMOVE to map put/nested_put (maybe?)

new topic     » goto parent     » topic index » view thread      » older message » newer message
ghaberek said...

I was going to open this as a ticket but I thought maybe I should collect some feedback first. The functions put and nested_put provide operations for modifying the value stored in a key, and most of these have complimenting operations (ADD/SUBTRACT, MULTIPLY/DIVIDE, etc.). While whole values can be removed from the map using remove, there exists no method to remove a value added with APPEND. Thus, I propose we add a new REMOVE operation that would remove things from a list of values as shown below. Thoughts?

 
-- remove some items (new REMOVE option) 
map:nested_put( my_map, {"foo","bar"}, 1, REMOVE ) 
map:nested_put( my_map, {"foo","bar"}, 4, REMOVE ) 

Using "REMOVE" seems a little confusing. Maybe something like, REMOVE_ELEMENT.

Matt

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu