KeepItSimpleStupid
- Joined Mar 4, 2014
- 5,088
I believe MrAl is talking about writing your own interpreter. e.g. Bolean Algebra to RPN. nce you have RPN it's easy to evaluate.
The ' can be handled just like UNARY MINUS -A.
I had to to the algebraic to RPN stuff for a class.
For a work program written in BASIC, I did something really cool. We had to enter cross sectional area/length with units in Angstroms, mm, cm and um. So, I wrote a parser that could do stuff like: (2.1 cm * 8000 A) / 1 mm; units of cm were assumed. +-*/^ and PI were implemented.
So, Mr AL is "saving space" by using the lower case bit as a sign bit, so it's like instead of the normal two complement notation, your using magnitude+sign notation. It just makes programming simpler.
~(A+B) could very well compile into:
Push a
NOT
Push b
NOT
+
NOT
The ' can be handled just like UNARY MINUS -A.
I had to to the algebraic to RPN stuff for a class.
For a work program written in BASIC, I did something really cool. We had to enter cross sectional area/length with units in Angstroms, mm, cm and um. So, I wrote a parser that could do stuff like: (2.1 cm * 8000 A) / 1 mm; units of cm were assumed. +-*/^ and PI were implemented.
So, Mr AL is "saving space" by using the lower case bit as a sign bit, so it's like instead of the normal two complement notation, your using magnitude+sign notation. It just makes programming simpler.
~(A+B) could very well compile into:
Push a
NOT
Push b
NOT
+
NOT