【发布时间】:2021-01-31 04:14:54
【问题描述】:
在尝试 nix 和 nix repl 时:
Welcome to Nix version 2.3.6. Type :? for help.
nix-repl> pkgs = import <nixpkgs> {}
nix-repl> builtins.typeOf pkgs
"set"
nix-repl> pkgs ? "firefox"
true
nix-repl> func = (n: pkgs ? "firefox")
nix-repl> func null
true
nix-repl> func = (n: pkgs ? n)
nix-repl> func "firefox"
false
我假设func "firefox" 会返回true。
什么 Nix 范例或概念解释了为什么 func "firefox" 在此示例中返回 false?
【问题讨论】: