diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/resp.hpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/resp.hpp b/src/resp.hpp index cf74e56..efd0c43 100644 --- a/src/resp.hpp +++ b/src/resp.hpp @@ -493,8 +493,8 @@ ostream& operator<<(ostream& out, const Env<V>& env) { struct PEnv : private map<const string, const char*> { PEnv() : symID(0) {} ~PEnv() { FOREACHP(const_iterator, i, this) free(const_cast<char*>(i->second)); } - string gensymstr(const char* s="_") { return (format("%s_%d") % s % symID++).str(); } - ASymbol* gensym(const char* s="_") { return sym(gensymstr(s)); } + string gensymstr(const char* s="b") { return (format("_%s%d") % s % symID++).str(); } + ASymbol* gensym(const char* s="b") { return sym(gensymstr(s)); } ASymbol* sym(const string& s, Cursor c=Cursor()) { assert(s != ""); const const_iterator i = find(s); @@ -682,7 +682,10 @@ struct Engine { virtual CVal compileDot(CEnv& cenv, CVal tup, int32_t index) = 0; virtual CVal compileGlobalSet(CEnv& cenv, const string& s, CVal v, const AST* t) = 0; virtual CVal compileGlobalGet(CEnv& cenv, const string& s, CVal v) = 0; - virtual CVal compileIf(CEnv& cenv, const AST* cond, const AST* then, const AST* aelse) = 0; + virtual void compileIfStart(CEnv& cenv, const AST* cond, const AST* type) = 0; + virtual void compileIfThen(CEnv& cenv, CVal thenV) = 0; + virtual void compileIfElse(CEnv& cenv, CVal elseV) = 0; + virtual CVal compileIfEnd(CEnv& cenv) = 0; virtual CVal compileLiteral(CEnv& cenv, const AST* lit) = 0; virtual CVal compilePrimitive(CEnv& cenv, const ATuple* prim) = 0; virtual CVal compileString(CEnv& cenv, const char* str) = 0; |