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

improve note in nix_value_force documentation again #10842

Merged
merged 3 commits into from
Jun 4, 2024

Conversation

prednaz
Copy link
Contributor

@prednaz prednaz commented Jun 4, 2024

Motivation

the documentation of nix_value_force contains a note that needs fixing.

You don't need this function for basic API usage very often, since all functions that return a Value call [nix_value_force] for you.

this sounds like "all functions that return a Value call [nix_value_force] for you" on the Value that they return. but this is wrong because nix_init_apply, for example, does not call nix_value_force on its return value. indeed, it would be silly because no function could ever return a thunk.

i believe the documentation is trying to say here that "all functions that return a Value call [nix_value_force] for you" on their arguments.

some Value returning functions do not even need to force their arguments because they return a thunk themselves anyway though. so i think the easiest and most accurate statement is as follows.

You don't need this function for basic API usage as long as you use functions that return a Value.

This work is sponsored by Antithesis

Context

i just edited the rest of this note in #10828 but overlooked the misleadingness i am trying to fix here now.

Priorities and Process

Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@prednaz prednaz requested a review from edolstra as a code owner June 4, 2024 01:31
@github-actions github-actions bot added the c api Nix as a C library with a stable interface label Jun 4, 2024
@prednaz
Copy link
Contributor Author

prednaz commented Jun 4, 2024

@fricklerhandwerk

@fricklerhandwerk fricklerhandwerk enabled auto-merge (squash) June 4, 2024 06:46
@fricklerhandwerk fricklerhandwerk merged commit 214051b into NixOS:master Jun 4, 2024
9 checks passed
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants