Skip to content

Conversation

@Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Dec 5, 2025

Motivation

This allows for better separation of concerns, and will allow better modeling of some things.

Context

Depends on #14720

I am not sure whether the *Display functions, to preserve existing behavior, are worth it!


Add 👍 to pull requests you find important.

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

We have the machinery to make a more informative error, telling the
user what format was actually encountered, and not just that it is not
the format that was requested.
This allows for better separation of concerns, and will allow better
modeling of some things.
@Ericson2314 Ericson2314 requested a review from edolstra as a code owner December 5, 2025 22:04
@github-actions github-actions bot added documentation new-cli Relating to the "nix" command with-tests Issues related to testing. PRs with tests have some priority labels Dec 5, 2025
Comment on lines 103 to 112
/**
* Get the encoding function for the given base encoding.
*/
decltype(base16::encode) * encodeForBase(Base base);

/**
* Get the decoding function for the given base encoding.
*/
decltype(base16::decode) * decodeForBase(Base base);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This really should just be a BaseDecoder singleton const class with just virtual methods. No reason to do this function pointer hackery

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That will make this PR bigger with something that's sort of orthogonal, but tbc I am happy to do it. Would you like it in a first commit, or a second commit (or a second PR)?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this PR is fine. As a follow-up commit would work, since we already have function pointer hackers now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK will do. Also remember this depends on #14720 so we better do that one first.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation new-cli Relating to the "nix" command with-tests Issues related to testing. PRs with tests have some priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants