aboutsummaryrefslogtreecommitdiff
path: root/model.h
diff options
context:
space:
mode:
Diffstat (limited to 'model.h')
-rw-r--r--model.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/model.h b/model.h
index dbd54a5..58f45f4 100644
--- a/model.h
+++ b/model.h
@@ -27,6 +27,7 @@ const int CLS_SIM_OBJ = 1 << 0;
const int CLS_PAIR_OBJ = 1 << 1;
const int CLS_OPT_OBJ = 1 << 3;
+const int CLS_PROM_OBJ = 1 << 9;
const int CLS_SYM_OBJ = 1 << 2;
const int CLS_NUM_OBJ = 1 << 4;
@@ -108,7 +109,8 @@ class EvalObj : public FrameObj {
bool is_bool_obj();
/** Check if the object is a string */
bool is_str_obj();
- /** Check if the object is a operator */
+ /** Check if the object is a promise */
+ bool is_prom_obj();
int get_otype();
virtual void prepare(Pair *pc);
/** Any EvalObj has its external representation */
@@ -398,6 +400,22 @@ class VecObj: public EvalObj {
ReprCons *get_repr_cons();
};
+/**
+ * @class PromObj
+ * Promise support (partial)
+ */
+class PromObj: public EvalObj {
+ private:
+ Pair *entry;
+ EvalObj *mem;
+ public:
+ PromObj(EvalObj *exp);
+ Pair *get_entry();
+ EvalObj *get_mem();
+ void feed_mem(EvalObj *res);
+ ReprCons *get_repr_cons();
+};
+
typedef map<string, EvalObj*> Str2EvalObj;
/** @class Environment
* The environment of current evaluation, i.e. the local variable binding