Skip to content

add aliases to bytevector procedures for r7rs compat#650

Merged
mattwparas merged 5 commits intomattwparas:masterfrom
m4rch3n1ng:bytevector-r7rs-compat
May 5, 2026
Merged

add aliases to bytevector procedures for r7rs compat#650
mattwparas merged 5 commits intomattwparas:masterfrom
m4rch3n1ng:bytevector-r7rs-compat

Conversation

@m4rch3n1ng
Copy link
Copy Markdown
Contributor

and also add an alias for bytes-copy for bytevector-copy for consistency.

additionally implement bytes-read! (with a bytevector-read! alias) and actually respect the parameter for read-bytes-into-buf by just implenting that via the bytes-read! procedure.

similar to the read-bytes-into-buf procedure, but with start and end
parameters and not just a length.
this simplifies the rust side a little but, but it also fixes an
outstanding bug, where read-bytes-into-buf would just ignore the given
amt and always try to fill the entire buf:

```
$ steel
λ > (define port (open-input-string "test"))
λ > (define buf (make-bytes 4))
λ > (read-bytes-into-buf buf 2 port)
=> 4
λ > buf
=> #u8(#x74 #x65 #x73 #x74)
λ > (peek-char port)
=> (eof)
λ >
```
@mattwparas mattwparas merged commit a477703 into mattwparas:master May 5, 2026
12 of 13 checks passed
@mattwparas
Copy link
Copy Markdown
Owner

thank you! sorry for the delay

@m4rch3n1ng m4rch3n1ng deleted the bytevector-r7rs-compat branch May 5, 2026 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants