Cleaning up and 2.0 - Addition and Concatenation (Program Bug and Problems)

by Jim ⌂ @, Russell, KY, Saturday, March 26, 2016, 04:33 (631 days ago)

A flurry of posts on Sourceforge has been happening about little issues and ideas. I would like to post a couple of additional changes to propose.

To make BASIC256 easier for students to transition to VB.NET I would like to change the "&" operator for Binary And to "&&". This will allow "&" to be concatenate. Also Binary OR would change to "||" to make the operators consistent with other languages.

It has also been suggested that the ZX80 form of print "PRINT 1;'+';2;'=';(1+2)" using semicolons to concatenate and to suppress the new line. I would like to propose that ";" also be an operator for concatenate and that it could be used anywhere.

With these new concat operators "&" and ";", I would also like to change the behavior of "+". Currently (1.99.99.16) "+" does 1) if either or both are strings (even numeric strings) then concatenate; 2) if they are integers - add as integers; 3) add mixed integers amd floats as floats. I would like to propose for 2.0 to make "+" the following: 1) if both are integers then add as integers; 2) if both are mixed floats, integers, or strings that could be converted to floats then add as floats; 3) concatenate. This makes "+" more number-centric and makes the behavior more like '-' that tries to convert strings to floats.

The current test suite runs successfully with these changes but the example programs would need to be tested before this is released.

What think you all?


Complete thread:

 RSS Feed of thread

powered by my little forum