JuliaLang/julia — pull request #1764 by toivoh (2012-12-15 08:44:29+00:00)
Title: RFC: Add get!, @get, and @get!

As per [this discussion.](https://groups.google.com/d/topic/julia-dev/PdLI60AnKac/discussion)
Already, `get(d::Associative, key, default)` returns the value at `key` if one exists, or `default` otherwise.

This patch adds `get!`, `@get`, and `@get!`:
* `get!` and `@get!` assign `default` to `d[key]` if it's not present.
They return `d[key]` (i.e. the converted value).
* `@get` and `@get!` evaluate `default` only if `key` is missing.

Thoughts? I think that at least `@get!` would provide a useful addition to `Base`.