sema-docs 1.20.4

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
---
name: "string/intern"
module: "strings"
section: "Core String Operations"
params: [{ name: s, type: string }]
returns: "string"
---

Intern a string, returning a shared instance for equal contents. Repeated calls with equal strings return values backed by the same underlying storage, which can reduce memory for many duplicated strings.

```sema
(string/intern "hello")   ; => "hello"
```