about summary refs log tree commit diff
path: root/src/libexpr/eval-inline.hh
diff options
context:
space:
mode:
authorMathnerd314 <mathnerd314.gph+hs@gmail.com>2015-09-06T23·03-0600
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-10-08T11·19+0200
commit8a8752163611400e2386f1f1a449d9d3fb8f1496 (patch)
treee0a9a194862054d4a0eb68d631b95817aa837608 /src/libexpr/eval-inline.hh
parent055ab1fc8da1e7c2cfadb671acc8bdb9f2b245aa (diff)
forceFunction: allow functors as well
Diffstat (limited to 'src/libexpr/eval-inline.hh')
-rw-r--r--src/libexpr/eval-inline.hh10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libexpr/eval-inline.hh b/src/libexpr/eval-inline.hh
index c8d83814f3ca..b470fa315d61 100644
--- a/src/libexpr/eval-inline.hh
+++ b/src/libexpr/eval-inline.hh
@@ -78,5 +78,15 @@ inline void EvalState::forceList(Value & v, const Pos & pos)
         throwTypeError("value is %1% while a list was expected, at %2%", v, pos);
 }
 
+inline bool EvalState::isFunctor(Value& fun)
+{
+    if (fun.type == tAttrs) {
+      auto found = fun.attrs->find(sFunctor);
+      if (found != fun.attrs->end()) {
+        return true;
+      }
+    }
+    return false;
+}
 
 }