treewide: use lib.optionalAttrs instead of 'then {}'#235924
Merged
drupol merged 1 commit intoNixOS:masterfrom Jun 13, 2023
Merged
treewide: use lib.optionalAttrs instead of 'then {}'#235924drupol merged 1 commit intoNixOS:masterfrom
drupol merged 1 commit intoNixOS:masterfrom
Conversation
rhendric
reviewed
Jun 4, 2023
pkgs/development/lisp-modules-obsolete/quicklisp-to-nix-overrides.nix
Outdated
Show resolved
Hide resolved
e851ffa to
69e8228
Compare
r-vdp
reviewed
Jun 4, 2023
69e8228 to
bc0cf62
Compare
rhendric
reviewed
Jun 6, 2023
bc0cf62 to
ed3b102
Compare
rhendric
approved these changes
Jun 6, 2023
Contributor
Author
|
thanks for your good and thorough reviews 👍 |
SuperSandro2000
approved these changes
Jun 13, 2023
drupol
approved these changes
Jun 13, 2023
Member
|
Aaand again - broke evaluation and is blocking channels. |
vcunat
reviewed
Jun 13, 2023
| }; | ||
| multiOverride = l: x: if l == [] then {} else | ||
| ((builtins.head l) x) // (multiOverride (builtins.tail l) x); | ||
| multiOverride = l: x: pkgs.lib.optionalAttrs (l != []) ((builtins.head l) x) // (multiOverride (builtins.tail l) x); |
Member
There was a problem hiding this comment.
I think missing parentheses here?
Member
There was a problem hiding this comment.
OK I guess, though I really suspect that that if-then-else version was more readable. Also supported by getting several +1 reviews without noticing that the new code parses wrong. (copied this from chat, for reference)
Member
There was a problem hiding this comment.
Possibly relevant to the proposal for <| in NixOS/rfcs#148.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)