diff options
author | Teddy <ted.sybil@gmail.com> | 2013-08-11 09:58:22 +0800 |
---|---|---|
committer | Teddy <ted.sybil@gmail.com> | 2013-08-11 09:58:22 +0800 |
commit | 05f893bbe7e8a839c26cc951fafb166c25d0a6ee (patch) | |
tree | 26ede7d65a8baf4038fd97c297bb9cb7b5a7b7be /builtin.h | |
parent | 2729f71c327f8ef4ddbb620dc486e7334ba40119 (diff) |
`apply` and `or` support
Diffstat (limited to 'builtin.h')
-rw-r--r-- | builtin.h | 35 |
1 files changed, 33 insertions, 2 deletions
@@ -249,8 +249,6 @@ class SpecialOptEval: public SpecialOptObj { * The implementation of `and` operator */ class SpecialOptAnd: public SpecialOptObj { - private: - unsigned char state; /**< 0 for prepared, 1 for pre_called */ public: SpecialOptAnd(); void prepare(Pair *pc); @@ -260,6 +258,34 @@ class SpecialOptAnd: public SpecialOptObj { ReprCons *get_repr_cons(); }; +/** @class SpecialOptOr + * The implementation of `and` operator + */ +class SpecialOptOr: public SpecialOptObj { + public: + SpecialOptOr(); + void prepare(Pair *pc); + Pair *call(ArgList *args, Environment * &envt, + Continuation * &cont, FrameObj ** &top_ptr); + + ReprCons *get_repr_cons(); +}; + +/** @class SpecialOptApply + * The implementation of `apply` operator + */ +class SpecialOptApply: public SpecialOptObj { + public: + SpecialOptApply(); + void prepare(Pair *pc); + Pair *call(ArgList *args, Environment * &envt, + Continuation * &cont, FrameObj ** &top_ptr); + + ReprCons *get_repr_cons(); +}; + + + #define BUILTIN_PROC_DEF(func)\ EvalObj *(func)(ArgList *args, const string &name) @@ -311,6 +337,11 @@ BUILTIN_PROC_DEF(is_equal); BUILTIN_PROC_DEF(display); BUILTIN_PROC_DEF(is_string); BUILTIN_PROC_DEF(is_symbol); +BUILTIN_PROC_DEF(string_lt); +BUILTIN_PROC_DEF(string_le); +BUILTIN_PROC_DEF(string_gt); +BUILTIN_PROC_DEF(string_ge); +BUILTIN_PROC_DEF(string_eq); #endif |