mirror of
https://github.com/NixOS/nix
synced 2025-06-26 15:51:15 +02:00
Rename "attribute sets" to "sets"
We don't have any other kind of sets so calling them attribute sets is unnecessarily verbose.
This commit is contained in:
parent
9e4bb20455
commit
5bc41d78ff
13 changed files with 152 additions and 160 deletions
|
@ -116,7 +116,7 @@ string showType(const Value & v)
|
|||
case tString: return "a string";
|
||||
case tPath: return "a path";
|
||||
case tNull: return "null";
|
||||
case tAttrs: return "an attribute set";
|
||||
case tAttrs: return "a set";
|
||||
case tList: return "a list";
|
||||
case tThunk: return "a thunk";
|
||||
case tApp: return "a function application";
|
||||
|
@ -488,7 +488,7 @@ inline void EvalState::evalAttrs(Env & env, Expr * e, Value & v)
|
|||
{
|
||||
e->eval(*this, env, v);
|
||||
if (v.type != tAttrs)
|
||||
throwTypeError("value is %1% while an attribute set was expected", showType(v));
|
||||
throwTypeError("value is %1% while a set was expected", showType(v));
|
||||
}
|
||||
|
||||
|
||||
|
@ -898,9 +898,8 @@ void ExprOpUpdate::eval(EvalState & state, Env & env, Value & v)
|
|||
|
||||
state.mkAttrs(v, v1.attrs->size() + v2.attrs->size());
|
||||
|
||||
/* Merge the attribute sets, preferring values from the second
|
||||
set. Make sure to keep the resulting vector in sorted
|
||||
order. */
|
||||
/* Merge the sets, preferring values from the second set. Make
|
||||
sure to keep the resulting vector in sorted order. */
|
||||
Bindings::iterator i = v1.attrs->begin();
|
||||
Bindings::iterator j = v2.attrs->begin();
|
||||
|
||||
|
@ -1125,8 +1124,7 @@ string EvalState::coerceToString(Value & v, PathSet & context,
|
|||
|
||||
if (v.type == tAttrs) {
|
||||
Bindings::iterator i = v.attrs->find(sOutPath);
|
||||
if (i == v.attrs->end())
|
||||
throwTypeError("cannot coerce an attribute set (except a derivation) to a string");
|
||||
if (i == v.attrs->end()) throwTypeError("cannot coerce a set to a string");
|
||||
return coerceToString(*i->value, context, coerceMore, copyToStore);
|
||||
}
|
||||
|
||||
|
@ -1172,9 +1170,8 @@ bool EvalState::eqValues(Value & v1, Value & v2)
|
|||
forceValue(v2);
|
||||
|
||||
/* !!! Hack to support some old broken code that relies on pointer
|
||||
equality tests between attribute sets. (Specifically,
|
||||
builderDefs calls uniqList on a list of attribute sets.) Will
|
||||
remove this eventually. */
|
||||
equality tests between sets. (Specifically, builderDefs calls
|
||||
uniqList on a list of sets.) Will remove this eventually. */
|
||||
if (&v1 == &v2) return true;
|
||||
|
||||
if (v1.type != v2.type) return false;
|
||||
|
@ -1212,8 +1209,8 @@ bool EvalState::eqValues(Value & v1, Value & v2)
|
|||
return true;
|
||||
|
||||
case tAttrs: {
|
||||
/* If both attribute sets denote a derivation (type =
|
||||
"derivation"), then compare their outPaths. */
|
||||
/* If both sets denote a derivation (type = "derivation"),
|
||||
then compare their outPaths. */
|
||||
if (isDerivation(v1) && isDerivation(v2)) {
|
||||
Bindings::iterator i = v1.attrs->find(sOutPath);
|
||||
Bindings::iterator j = v2.attrs->find(sOutPath);
|
||||
|
@ -1263,7 +1260,7 @@ void EvalState::printStats()
|
|||
printMsg(v, format(" list concatenations: %1%") % nrListConcats);
|
||||
printMsg(v, format(" values allocated: %1% (%2% bytes)")
|
||||
% nrValues % (nrValues * sizeof(Value)));
|
||||
printMsg(v, format(" attribute sets allocated: %1%") % nrAttrsets);
|
||||
printMsg(v, format(" sets allocated: %1%") % nrAttrsets);
|
||||
printMsg(v, format(" right-biased unions: %1%") % nrOpUpdates);
|
||||
printMsg(v, format(" values copied in right-biased unions: %1%") % nrOpUpdateValuesCopied);
|
||||
printMsg(v, format(" symbols in symbol table: %1%") % symbols.size());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue