I would like to know how to do some lower-level thing in C++ that will allow me to do some "wacky" math operations. Specifically my two questions are:
1) How can I define my own math symbol that the compiler will be able to recognizes in my code. In other words, I'm not looking to parse a string from a user, but rather have the compiler recognize this as a new math operation.
ex: 3 {+} 4 will actually do 3 – 4 etc.
2) How can I define a custom number from an ASCII symbol. For example, define the symbol # to be recognized by the compiler as 18 (i.e. 00010010 in binary).
ex: 18 {+} # = 18 - 18 = 0
If possible, I would like to be able to do the above two things at the compiler lever. Solutions in C++, Java, C, Python, and Objective-C are fine. Just let me know what language your solution is in. Thanks! :)