Input BASIC Code:
LET x = 39 * 2PRINT "Hello, World!", 50+1, xIF 5+5 > 123 THEN PRINT "Testing"INPUT x, a, b
Output C++ Code:
//Begin Intro Segment#include #include using namespace std;int main(){//End Intro Segment//Begin Variable Segmentint x = 0; int a = 0; int b = 0;//End Variable Segment//Begin Generated Code Segmentx = 39 * 2;cout << "Hello, World!" << 50+1 << x;if(5+5 > 123){ cout << "Testing";}cin >> x >> a >> b;//End Generated Code Segmentreturn 0;}
With regard to your last entry on implicit conversions, I agree that implicit narrowing conversions (float to int) and lack of a proper Boolean type aren't great, but I don't see the problem with implicit widening conversions (int to float). I rather like the way C#/.NET handles this, with the ability to declare both implicit and explicit conversion operators.