Firstly, I believe `dict["b"]++` assumes that the key would be defaulted to
0, then incremented. Currently, `getindex` and `setindex` don't allow
setting default values, that can be achieved through

`get(dict, "b", 0)`

Secondly, `++` is not an actual operator in Julia.
You can achieve what you're trying to do with:

dict["a"] = 1
dict["b"] = 0
dict["b"] += 1

You'll have to clarify your question if that doesn't help.

-Jacob



On Sat, Dec 20, 2014 at 8:52 PM, Min-Woong Sohn <[email protected]> wrote:

> dict = Dict()
> dict["a"] = 1
> 1
> dict["b"] ++
>
> key not found: "b"
>
>
> This behavior is surprising and potentially very limiting. Is there any 
> discussion on this?
>
>

Reply via email to