You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 # true
It 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 purposeshastag(k, "site") # false
so 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"# truegettag(k, "link") =="3"# true
following 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.0
The text was updated successfully, but these errors were encountered:
The second proposal would make sense to me. I think the idea would be that settags could semantically mean something similar to how setindex! works for a dictionary, where it creates new entries but does not delete different pre-existing entries in the dictionary. Then resettags would more explicitly warn the user that other pre-existing tags will be deleted unless they are specified.
Currently with the new "named tags" design based on a dictionary, you can add or update a tag using its name with:
and delete a tag using its name with:
It 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:so 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.:following the usage of
Base.merge
onBase.Dict
:The text was updated successfully, but these errors were encountered: