aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/eval.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-24 16:41:04 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-24 16:41:04 +0200
commit5bc41d78ffcd2952eaddb20ef129f48e94d60cb0 (patch)
tree86e3fae7ffafd81e5956bccdbea1608effc92dee /src/libexpr/eval.cc
parent9e4bb2045548e2166102f4a8eedf43741e1a6a98 (diff)
Rename "attribute sets" to "sets"
We don't have any other kind of sets so calling them attribute sets is unnecessarily verbose.
Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r--src/libexpr/eval.cc23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 29b3e3c82..814c19efc 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -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());