Scoping of attributes in let/with

Поділитися
Вставка
  • Опубліковано 9 січ 2025

КОМЕНТАРІ • 4

  • @tobzdaman619
    @tobzdaman619 10 місяців тому +3

    This one doesn't make much sense to me but at least I can be aware of it. let takes priority over with.

  • @JonnyD000
    @JonnyD000 10 місяців тому +1

    Been really enjoying the tour up to this module, I think it needs to be explained better.

    • @jkitchentube
      @jkitchentube 9 місяців тому +1

      Yea there are tons of things being introduced here that are not even touched on anywhere and there are no links to the documentation for `with` which probably actually explains this caveat.
      Like "this example, why it makes sense" ... I think is implying that `pkgs.vim` would clobber the local `vim`, but that implies that the user is aware that `pkgs.vim` is even a thing. Plus where is `pkgs` even coming from? I get that it's coming from that first line, but so far in the tour that line hasn't been discussed at all. And where is `environment` even coming from?

  • @MegaBaellchen
    @MegaBaellchen 4 місяці тому +1

    Okay, i understand that "vim" is defined there and also present in the pkgs set. So the explanation i inferred is that nix takes the outmost scope first. Is that correct? None of the explanations say so.