Skip to content

Commit

Permalink
vector fix and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
fare committed Nov 18, 2023
1 parent 08df8d0 commit ca554e8
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
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
48 changes: 48 additions & 0 deletions doc/reference/std/misc/vector.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Vector

The `:std/misc/vector` library provides common vector functions
that complement those provided by RnRS, Gambit and `:std/srfi/43`.

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

## vector-ref-set!

``` scheme
(def vector-ref-set! vector-set!)
(set! (vector-ref v i) x)
```

This binding enables you to use `set!` with `vector-ref`.

::: tip Examples:
``` scheme
> (def foo (vector 1 2 3))
> (set! (vector-ref foo 1) 4)
> foo
#(1 4 3)
```
:::

### vector-least-index

### vector-most-index

### maybe-subvector

### subvector-for-each

### subvector-for-each/index

### subvector-reverse-for-each

### subvector-reverse-for-each/index

### subvector->list

### cons->vector

### vector-filter
2 changes: 1 addition & 1 deletion src/std/misc/vector.ss
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
vector-count) srfi43-)
(only-in :std/iter for in-range in-iota)
(only-in :std/misc/list-builder with-list-builder)
(only-in :std/misc/number least-integer)
(only-in :std/misc/number least-integer most-integer)
(only-in :std/sugar while))

;; Enable (set! (vector-ref v i) x)
Expand Down

0 comments on commit ca554e8

Please sign in to comment.