Permalink
Browse files

ch4

  • Loading branch information...
1 parent d740efd commit ae6ed0e790a22202dac12819e05c8cdb5723663f @nslobodin committed Sep 4, 2012
@@ -21,17 +21,17 @@ int main() try
std::string input;
shared_ptr<Expression> exp;
- while (!exit)
- {
-// input = readExpression();
- exp = Expression::analyzeExpression("( define x 3 )"/*input*/);
+// while (!exit)
+// {
+//// input = readExpression();
+// exp = Expression::analyzeExpression("( define x 3 )"/*input*/);
-// Expression *output = static_cast<Expression *>(eval(exp, globalEnvironment()));
-// promtOutput(output);
+//// Expression *output = static_cast<Expression *>(eval(exp, globalEnvironment()));
+//// promtOutput(output);
-// delete exp;
-// delete output;
- }
+//// delete exp;
+//// delete output;
+// }
// delete exp;
@@ -34,7 +34,8 @@ SchemeList::SchemeList(const std::string &expr)
eraseWhiteSpaces();
if (m_listString.empty()/* || m_listString[0] != '(' || m_listString[m_listString.size() - 1] != ')'*/)
- throw std::runtime_error("Bad expression.");
+ m_listString = "()";
+// throw std::runtime_error("Bad expression.");
}
SchemeList SchemeList::car() const
@@ -11,6 +11,7 @@
#include <iostream>
#include <string>
#include <sstream>
+#include <iterator>
#include <map>
#include <stdexcept>
#include <algorithm>

0 comments on commit ae6ed0e

Please sign in to comment.