69 bool operator==(const
Expression & exp) const noexcept;
81 typedef std::vector<
Expression>::iterator IteratorType;
90 std::ostream & operator<<(std::ostream & out, const
Expression & exp);
Expression eval(Environment &env)
Evaluate expression using a post-order traversal (recursive)
Definition: expression.cpp:170
bool isHeadSymbol() const noexcept
convienience member to determine if head atom is a symbol
Definition: expression.cpp:52
Expression()
Default construct and Expression, whose type in NoneType.
Definition: expression.cpp:9
An expression is a tree of Atoms.
Definition: expression.hpp:22
bool isHeadNumber() const noexcept
convienience member to determine if head atom is a number
Definition: expression.cpp:48
A class representing the interpreter environment.
Definition: environment.hpp:40
Atom & head()
return a reference to the head Atom
Definition: expression.cpp:40
void append(const Atom &a)
append Atom to tail of the expression
Definition: expression.cpp:57
A variant type that may be a Number or Symbol or the default type None.
Definition: atom.hpp:14
std::vector< Expression >::const_iterator ConstIteratorType
Definition: expression.hpp:25
ConstIteratorType tailConstEnd() const noexcept
return a const-iterator to the tail end
Definition: expression.cpp:76
Expression & operator=(const Expression &a)
deep-copy assign an expression (recursive)
Definition: expression.cpp:25
ConstIteratorType tailConstBegin() const noexcept
return a const-iterator to the beginning of tail
Definition: expression.cpp:72
Expression * tail()
return a pointer to the last expression in the tail, or nullptr
Definition: expression.cpp:62