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

Small problems with the IO functions #403

Open
developedby opened this issue Jul 8, 2024 · 0 comments
Open

Small problems with the IO functions #403

developedby opened this issue Jul 8, 2024 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@developedby
Copy link
Member

Reproducing the behavior

I'm writing a guide on how to add IO through dlls in Bend and noticed some problems with run.c and hvm.h.

  • hvm.h doesn't expose the inject_ functions. This is useful for returning lists and strings like we do in run.c.
  • The definition of struct Str is outdated in hvm.h. It has a fixed size of 256 instead of the new dynamically sized array.
  • inject_cons and inject_nil should be called inject_list_cons and inject_list_nil to avoid confusion with String/Cons and String/Nil.

And I also make 2 suggested additions.

inject_list that takes an array of elements and function pointer of how to encode them to HVM. It then calls inject_cons and inject_nil to properly build the list.
inject_string to convert Str to bend strings.

System Settings

HVM: v2.0.21

Additional context

No response

@developedby developedby added the bug Something isn't working label Jul 8, 2024
@developedby developedby added this to the HVM IO lib v0 milestone Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants