diff options
author | Teddy <ted.sybil@gmail.com> | 2013-08-11 11:25:26 +0800 |
---|---|---|
committer | Teddy <ted.sybil@gmail.com> | 2013-08-11 11:25:26 +0800 |
commit | 448ac0bcc3a81e250a825c333dd01c77e754341a (patch) | |
tree | 4d8d104fa59bdf73274602dbe2927945abeb92e3 /model.h | |
parent | 05f893bbe7e8a839c26cc951fafb166c25d0a6ee (diff) |
`delay` and `force` support is added
Diffstat (limited to 'model.h')
-rw-r--r-- | model.h | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -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 |