mirror of
https://github.com/NixOS/nix.git
synced 2025-12-10 02:51:02 +01:00
These constant Values have no business being in the EvalState in the
first place. The ultimate goal is to get rid of the ugly `getBuiltins`
and its relience (in `createBaseEnv`) on these global constants is getting in the way.
Same idea as in f017f9ddd3.
Co-authored-by: eldritch horrors <pennae@lix.systems>
29 lines
450 B
C++
29 lines
450 B
C++
#include "nix/expr/value.hh"
|
|
|
|
namespace nix {
|
|
|
|
Value Value::vEmptyList = []() {
|
|
Value res;
|
|
res.setStorage(List{.size = 0, .elems = nullptr});
|
|
return res;
|
|
}();
|
|
|
|
Value Value::vNull = []() {
|
|
Value res;
|
|
res.mkNull();
|
|
return res;
|
|
}();
|
|
|
|
Value Value::vTrue = []() {
|
|
Value res;
|
|
res.mkBool(true);
|
|
return res;
|
|
}();
|
|
|
|
Value Value::vFalse = []() {
|
|
Value res;
|
|
res.mkBool(false);
|
|
return res;
|
|
}();
|
|
|
|
} // namespace nix
|