diff options
| author | Anderson Torres <torres.anderson.85@protonmail.com> | 2024-03-06 08:51:54 -0300 |
|---|---|---|
| committer | Anderson Torres <torres.anderson.85@protonmail.com> | 2024-03-06 11:40:09 -0300 |
| commit | e671d3bbbda9b2bec8fa119aa1ff46499118ef17 (patch) | |
| tree | de070bfc9392fe6bbb73f786db960279755540a7 /pkgs/development/python-modules/python-openstackclient | |
| parent | a2c4602ccd6a9e32dac098abf38bd1fa0fe53dd4 (diff) | |
Nix docs: remove `with lib;` from example code
Following [Best Practices](https://nix.dev/guides/best-practices#with-scopes),
`with` is a problematic language construction and should be avoided.
Usually it is employed like a "factorization": `[ X.A X.B X.C X.D ]` is written
`with X; [ A B C D ]`.
However, as shown in the link above, the syntatical rules of `with` are not so
intuitive, and this "distributive rule" is very selective, in the sense that
`with X; [ A B C D ]` is not equivalent to `[ X.A X.B X.C X.D ]`.
However, this factorization is still useful to "squeeze" some code, especially
in lists like `meta.maintainers`.
On the other hand, it becomes less justifiable in bigger scopes. This is
especially true in cases like `with lib;` in the top of expression and in sets
like `meta = with lib; { . . . }`.
That being said, this patch removes most of example code in the current
documentation.
The exceptions are, for now
- doc/functions/generators.section.md
- doc/languages-frameworks/coq.section.md
because, well, they are way more complicated, and I couldn't parse them
mentally - yet another reason why `with` should be avoided!
Diffstat (limited to 'pkgs/development/python-modules/python-openstackclient')
0 files changed, 0 insertions, 0 deletions
