aboutsummaryrefslogtreecommitdiff
path: root/builtin.h
diff options
context:
space:
mode:
authorTeddy <ted.sybil@gmail.com>2013-08-09 17:58:48 +0800
committerTeddy <ted.sybil@gmail.com>2013-08-09 17:58:48 +0800
commitf8a870c48886e8828155d05b0da6b7868344ba6a (patch)
treec644eecb1eab55b3e08390efb179c6d6bdbab045 /builtin.h
parent01b2c905872ff38d5d8291f2f8de92c2771f183f (diff)
added `and` operator
Diffstat (limited to 'builtin.h')
-rw-r--r--builtin.h16
1 files changed, 15 insertions, 1 deletions
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)