Skip to content

improve note in nix_value_force documentation again#10842

Merged
fricklerhandwerk merged 3 commits into
NixOS:masterfrom
prednaz:nix_value_force_docs
Jun 4, 2024
Merged

improve note in nix_value_force documentation again#10842
fricklerhandwerk merged 3 commits into
NixOS:masterfrom
prednaz:nix_value_force_docs

Conversation

@prednaz

@prednaz prednaz commented Jun 4, 2024

Copy link
Copy Markdown
Contributor

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

prednaz commented Jun 4, 2024

Copy link
Copy Markdown
Contributor Author

@fricklerhandwerk

Comment thread src/libexpr-c/nix_api_expr.h Outdated
@fricklerhandwerk fricklerhandwerk enabled auto-merge (squash) June 4, 2024 06:46
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