-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Currently with the new "named tags" design based on a dictionary, you can add or update a tag using its name with:
i = Index(2)
j = settag(i, "site", "1")and delete a tag using its name with:
k = unsettag(j, "site")
k == i # trueIt might be nice to have a syntax for adding multiple tags at once. Currently, settags is used as an internal function for setting all the tags at once, with existing ones getting removed:
i = Index(2)
j = settag(i, "site", "1")
k = settags(j, Dict(["link" => "3"])) # This is currently only defined in `IndexName` but this is for demonstration purposes
hastag(k, "site") # falseso it is meant to be low-level, and I think it is a good name for that.
Maybe we can use the syntax mergetags, i.e.:
i = Index(2)
j = settag(i, "site", "1")
k = mergetags(j, Dict(["link" => "3"]))
gettag(k, "site") == "1" # true
gettag(k, "link") == "3" # truefollowing the usage of Base.merge on Base.Dict:
julia> merge(Dict("foo" => 0.0, "bar" => 42.0), Dict("baz" => 17, "bar" => 4711))
Dict{String, Float64} with 3 entries:
"bar" => 4711.0
"baz" => 17.0
"foo" => 0.0Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request