# How to use the get/2 dictionary function?

**URL:** <https://swi-prolog.discourse.group/t/how-to-use-the-get-2-dictionary-function/4274>\
**Category:** Predicate\
**Created:** [August 10, 2021, 12:47pm UTC](https://swi-prolog.discourse.group/t/how-to-use-the-get-2-dictionary-function/4274 "2021-08-10T12:47:12Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Ataraxia](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/ataraxia/32/3664_2.png) [@Ataraxia](https://swi-prolog.discourse.group/u/Ataraxia)\
**Post date:** [August 10, 2021, 1:48pm UTC](https://swi-prolog.discourse.group/t/how-to-use-the-get-2-dictionary-function/4274/5 "2021-08-10T13:48:51Z")

</div>

Thanks, Eric, that was a brilliant reply—and you set me off on the right track.

I’ve realized what I’ve done—all I had to do was type the magic words  
`sudo apt-add-repository ppa:swi-prolog/devel`  
and install from there!

```prolog
?- Dict=pl_en{kot:cat, pies:dog}, X = Dict.get(panda, unknown).
Dict = pl_en{kot:cat, pies:dog},
X = unknown. % as desired!

```

Q: Did I miss something in the web documentation that informs a predicate/function is in the dev version only?

Extra: If you’ve ended up here but you’re stuck on a pre-8.3 version, there’s an implementation of get-with-default [in the other thread here](https://swi-prolog.discourse.group/t/how-about-predefined-dict-function-dict-get-key-default/1314).

---

_[View the full topic](https://swi-prolog.discourse.group/t/how-to-use-the-get-2-dictionary-function/4274)._
