arduino / Arduino

Arduino IDE 1.x

Home Page:https://www.arduino.cc/en/software

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enhancement/Suggestion: Ability to Declare new Operators

brdane opened this issue · comments

Although such feature isn't within standard C++ standards, it would be useful to programmers to incorporate their own user-defined operators. For example, if a programmer wanted to create an operator to check if a number is between two other numbers, then psuedo-code for that would look like the following:

if (3 between 0 5)
DoSomething();

Thanks for your suggestion @brdane.

Beyond the minor sketch preprocessing that is done to make it easier and more convenient for people to get started writing Arduino sketches, Arduino keeps the programming language identical to standard C++. It is also not feasible to make significant divergences in the language since Arduino sketches are compiled using standard C++ compilers that Arduino plays no part in developing or maintaining.

So a significant language capability like this would not and could not be implemented by Arduino.

I suggest investigating what is possible to accomplish using the existing capabilities of the Arduino programming language/C++. There is a good chance you can manage something like this already.