-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Error with at-pattern and optional params #334
Comments
@-patterns bind the actual argument passed, not the optional arguments. This also applies to |
Think of |
Didn't understand much the semantics, but it's very inconvenient. Now I have to write:
|
You can just write Anyway, closing since it's intended behaviour (and the alternative is less efficient to implement, because it would require constructing a new attrset). |
@edolstra no because I want to use |
Given that plenty of people complain about the performance and memory consumption of the evaluator, it's a pretty relevant argument. |
If you want this semantics as you said being intended, I really dislike this choice because it makes @-pattern useless with optional arguments, and deserves a big warning in the docs. Currenly it's written as follows:
Which for me means that I can use I don't know the implementation details of nix and I don't know why another set is needed to be created, but if another set can even remotely (theoretically) be avoided, please keep this issue open. |
@lethalman Are you prepared to go through all existing uses of this and ensure they don't depend on the current semantics? |
@shlevy yes. I'd like to highlight this line: https://github.com/NixOS/nixpkgs/blob/master/pkgs/desktops/kde-4.12/kde-package/default.nix#L57 Apparently, who wrote that line had my same wrong thought, that meta, name and cmakeFlags are part of |
Well, the performance aspect is moot anyway, since the current behaviour is intended. The |
* tutorial: nixos configurations on vm Co-authored-by: Benoit de Chezelles <bew@users.noreply.github.com> Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io> Co-authored-by: Henrik <i97henka@gmail.com>
It only happens with optional parameters.
The text was updated successfully, but these errors were encountered: