Looking at the code of my toupper/tolower example it is clear that BASIC makes it too easy to use globals:
10 LET a$ = "STEVE"
20 GOSUB blah
30 REM a$ is now updated
If we wanted to provide clarity we could have said:
10 LET a = "STEVE"
20 LET a = GOSUB 300
30 END
300 RETURN 3
i.e. "RETURN" now returns an expression. It doesn't help a lot, because the "input parameter" is still a random global. To allow named-parameters we'd need to implement "DEF FN" + "FN". But it's a cheap hack that might be useful.
Looking at the code of my toupper/tolower example it is clear that BASIC makes it too easy to use globals:
If we wanted to provide clarity we could have said:
i.e. "RETURN" now returns an expression. It doesn't help a lot, because the "input parameter" is still a random global. To allow named-parameters we'd need to implement "DEF FN" + "FN". But it's a cheap hack that might be useful.
Filed as fantasy issue for now.