diff --git a/ml.cpp b/ml.cpp index 1a17c0d..bfaf636 100644 --- a/ml.cpp +++ b/ml.cpp @@ -419,7 +419,7 @@ public: } } - bool operator!=(Value other) const { + bool operator!=(const Value &other) const { return !(*this == other); } @@ -427,19 +427,19 @@ public: /// ORDERING OPERATIONS //////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// - bool operator>=(Value other) const { + bool operator>=(const Value &other) const { return !(*this < other); } - bool operator<=(Value other) const { + bool operator<=(const Value &other) const { return (*this == other) || (*this < other); } - bool operator>(Value other) const { + bool operator>(const Value &other) const { return !(*this <= other); } - bool operator<(Value other) const { + bool operator<(const Value &other) const { // Other type must be a float or an int if (other.type != FLOAT && other.type != INT) throw Error(*this, Environment(), INVALID_BIN_OP); @@ -465,7 +465,7 @@ public: //////////////////////////////////////////////////////////////////////////////// // This function adds two lisp values, and returns the lisp value result. - Value operator+(Value other) const { + Value operator+(const Value &other) const { // If the other value's type is the unit type, // don't even bother continuing. // Unit types consume all arithmetic operations. @@ -513,7 +513,7 @@ public: } // This function subtracts two lisp values, and returns the lisp value result. - Value operator-(Value other) const { + Value operator-(const Value &other) const { // If the other value's type is the unit type, // don't even bother continuing. // Unit types consume all arithmetic operations. @@ -545,7 +545,7 @@ public: } // This function multiplies two lisp values, and returns the lisp value result. - Value operator*(Value other) const { + Value operator*(const Value &other) const { // If the other value's type is the unit type, // don't even bother continuing. // Unit types consume all arithmetic operations. @@ -575,7 +575,7 @@ public: } // This function divides two lisp values, and returns the lisp value result. - Value operator/(Value other) const { + Value operator/(const Value &other) const { // If the other value's type is the unit type, // don't even bother continuing. // Unit types consume all arithmetic operations. @@ -605,7 +605,7 @@ public: } // This function finds the remainder of two lisp values, and returns the lisp value result. - Value operator%(Value other) const { + Value operator%(const Value &other) const { // If the other value's type is the unit type, // don't even bother continuing. // Unit types consume all arithmetic operations.