sema-docs 1.20.0

Canonical structured documentation for Sema builtins/special forms; powers LSP hover/completion and REPL apropos
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
---
name: "hash-ref"
module: "maps"
section: "Access"
params: [{ name: m, type: map }, { name: key, type: any }, { name: default, type: any }]
---

Look up `key` in map `m`, returning the associated value or `default` (`nil` if omitted) when the key is missing. Alias of `get`.

```sema
(hash-ref {:a 1 :b 2} :a)         ; => 1
(hash-ref {:a 1} :missing)        ; => nil
(hash-ref {:a 1} :missing "none") ; => "none"
```