From f8a870c48886e8828155d05b0da6b7868344ba6a Mon Sep 17 00:00:00 2001 From: Teddy Date: Fri, 9 Aug 2013 17:58:48 +0800 Subject: added `and` operator --- builtin.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'builtin.h') diff --git a/builtin.h b/builtin.h index 3f6fa29..d4ad86f 100644 --- a/builtin.h +++ b/builtin.h @@ -8,7 +8,6 @@ using std::string; const int EQUAL_QUEUE_SIZE = 262144; -bool is_list(Pair *ptr); /** @class InexactNumObj * Inexact number implementation (using doubles) @@ -234,6 +233,21 @@ class SpecialOptEval: public SpecialOptObj { ReprCons *get_repr_cons(); }; +/** @class SpecialOptAnd + * 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); + 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) -- cgit v1.2.3