diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2004-10-26T17·01+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2004-10-26T17·01+0000 |
commit | 9fa07b376dd52ee8bbcc074e59d36af3f3f2536d (patch) | |
tree | ef2d6d8d32b8a7c87c5396ab3b34b7fafa3810f1 /src/libexpr/primops.cc | |
parent | ee401afad81dc7759c66829372826f98268ae606 (diff) |
* String/path concatenation operator (`+').
Diffstat (limited to 'src/libexpr/primops.cc')
-rw-r--r-- | src/libexpr/primops.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 938d9bb8c13b..ade483dc703d 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -273,8 +273,8 @@ static Expr primDerivation(EvalState & state, const ATermVector & _args) attrs.set("outPath", ATmake("(Path(<str>), NoPos)", outPath.c_str())); attrs.set("drvPath", ATmake("(Path(<str>), NoPos)", drvPath.c_str())); - attrs.set("drvHash", ATmake("(Str(<str>), NoPos)", ((string) drvHash).c_str())); - attrs.set("type", ATmake("(Str(\"derivation\"), NoPos)")); + attrs.set("drvHash", ATmake("(<term>, NoPos)", makeString(drvHash))); + attrs.set("type", ATmake("(<term>, NoPos)", makeString("derivation"))); return makeAttrs(attrs); } @@ -284,8 +284,7 @@ static Expr primDerivation(EvalState & state, const ATermVector & _args) following the last slash. */ static Expr primBaseNameOf(EvalState & state, const ATermVector & args) { - string s = evalString(state, args[0]); - return ATmake("Str(<str>)", baseNameOf(s).c_str()); + return makeString(baseNameOf(evalString(state, args[0]))); } @@ -298,7 +297,7 @@ static Expr primToString(EvalState & state, const ATermVector & args) if (atMatch(m, arg) >> "Str" >> s || atMatch(m, arg) >> "Path" >> s || atMatch(m, arg) >> "Uri" >> s) - return ATmake("Str(<str>)", s.c_str()); + return makeString(s); else throw Error("cannot coerce value to string"); } |