aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/value.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr/value.hh')
-rw-r--r--src/libexpr/value.hh14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libexpr/value.hh b/src/libexpr/value.hh
index 0995dcd7b..e743da9c3 100644
--- a/src/libexpr/value.hh
+++ b/src/libexpr/value.hh
@@ -126,6 +126,20 @@ struct Value
inline void setExternal() { type = tExternal; };
inline void setFloat() { type = tFloat; };
+ // Functions needed to distinguish the type
+ // These should be removed eventually, by putting the functionality that's
+ // needed by callers into methods of this type
+
+ // normalType() == nThunk
+ inline bool isThunk() const { return type == tThunk; };
+ inline bool isApp() const { return type == tApp; };
+ inline bool isBlackhole() const { return type == tBlackhole; };
+
+ // normalType() == nFunction
+ inline bool isLambda() const { return type == tLambda; };
+ inline bool isPrimOp() const { return type == tPrimOp; };
+ inline bool isPrimOpApp() const { return type == tPrimOpApp; };
+
union
{
NixInt integer;