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

C API: document whether values can be thunks #10673

Open
Radvendii opened this issue May 9, 2024 · 1 comment
Open

C API: document whether values can be thunks #10673

Radvendii opened this issue May 9, 2024 · 1 comment
Assignees
Labels
c api Nix as a C library with a stable interface documentation feature Feature request or proposal

Comments

@Radvendii
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Right now, the documentation for nix_value_force() says

...all functions that return a value call it for you. The only place you will see a NIX_TYPE_THUNK is in the arguments that are passed to a PrimOp function you supplied to nix_alloc_primop

According to @roberth, this is not actually true (anymore?). Having an exhaustive list of places that you can see a NIX_TYPE_THUNK documented in one place is useful, but likely to get out of sync.

Describe the solution you'd like

We should instead document on each function that returns a value whether that value can be a thunk.

Describe alternatives you've considered

  • Keep the list on nix_value_force() up to date (error-prone)
  • Generate that list programmatically (seems complicated)
  • Enforce the documentation as it currently stands is accurate. That every function that returns a value forces it (maybe not desireable?)

Priorities

Add 👍 to issues you find important.

@Radvendii Radvendii added the feature Feature request or proposal label May 9, 2024
@roberth roberth added the c api Nix as a C library with a stable interface label May 12, 2024
@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2024-05-15-nix-team-meeting-minutes-146/45491/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c api Nix as a C library with a stable interface documentation feature Feature request or proposal
Projects
None yet
Development

No branches or pull requests

4 participants