Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ch4

  • Loading branch information...
commit ae6ed0e790a22202dac12819e05c8cdb5723663f 1 parent d740efd
flamingo authored
18 ch4/interpreter-cpp/schint/main.cpp
View
@@ -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;
3  ch4/interpreter-cpp/schint/schemelist.cpp
View
@@ -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
1  ch4/interpreter-cpp/schint/utils.h
View
@@ -11,6 +11,7 @@
#include <iostream>
#include <string>
#include <sstream>
+#include <iterator>
#include <map>
#include <stdexcept>
#include <algorithm>
Please sign in to comment.
Something went wrong with that request. Please try again.