Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std/misc/vector #1046

Merged
merged 9 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ module.exports = {
'misc/number',
'misc/shuffle',
'misc/uuid',
'misc/vector',
]
}
]
Expand Down
17 changes: 13 additions & 4 deletions doc/reference/std/misc/list-builder.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
# List builder

The `:std/misc/list-builder` library provides
common bindings for building lists.

::: tip To use the bindings from this module:
```scheme
(import :std/misc/list-builder)
```
:::

## with-list-builder

``` scheme
```scheme
(with-list-builder (put! [peek]) body ...) -> list

put! := function identifier that modifies internal list
Expand All @@ -14,7 +23,7 @@ so *put!* and *peek* can be used without wrapping them in a lambda first.
`with-list-builder` returns the internal list at the end.

::: tip Examples:
``` scheme
```scheme
> (import :std/iter)
> (with-list-builder (put!)
(for (n (in-iota 100 1))
Expand All @@ -30,7 +39,7 @@ so *put!* and *peek* can be used without wrapping them in a lambda first.

## call-with-list-builder

``` scheme
```scheme
(call-with-list-builder proc) -> list

proc := procedure that takes two proc identifiers as input
Expand All @@ -49,7 +58,7 @@ with `copy-list` if you want not to be affected by these mutations.
Finally, `call-with-list-builder` returns the constructed list.

::: tip Examples:
``` scheme
```scheme
> (import :std/iter)
> (call-with-list-builder
(lambda (put! peek)
Expand Down
Loading