From 448ac0bcc3a81e250a825c333dd01c77e754341a Mon Sep 17 00:00:00 2001 From: Teddy Date: Sun, 11 Aug 2013 11:25:26 +0800 Subject: `delay` and `force` support is added --- model.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'model.h') 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 Str2EvalObj; /** @class Environment * The environment of current evaluation, i.e. the local variable binding -- cgit v1.2.3