Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Variable Names
#12
It reminds me of what little I read of the REXX processor in OS/2. :/

Could have code like this (sorry not familiar with this "batch" language):

Code: (Select All)
hello = 4
SAY hello everyone

Then "hello" would stop printing "hello" and instead the value of the variable of the same name. But I'll bet that was hell to parse for whoever created the "batch" language.

It must have required two or more passes, which I don't think was how the MS-DOS batch file processor worked. If not then be forced to look at every single token (except keywords and operators) to see if it happened to be a variable. (shrugs)

To scan something like this:

Code: (Select All)
DIM 20D AS LONG
20D = 50
A = 20D

would require some kind of preprocessor, or at least one extra pass only to pick up "special" variable names. Might as well allow also symbols like dollar sign and ampersand to be the first character of an identifier in that case. The problem with that is it would make compilation even slower, which is not tolerated very much except with C/C++ only because that is ubiquitous.
Reply


Messages In This Thread
Variable Names - by Dimster - 11-19-2023, 06:18 PM
RE: Variable Names - by RhoSigma - 11-19-2023, 06:46 PM
RE: Variable Names - by CharlieJV - 11-19-2023, 07:46 PM
RE: Variable Names - by James D Jarvis - 11-19-2023, 07:52 PM
RE: Variable Names - by Haggarman - 11-19-2023, 07:58 PM
RE: Variable Names - by SMcNeill - 11-19-2023, 08:12 PM
RE: Variable Names - by bplus - 11-19-2023, 08:23 PM
RE: Variable Names - by mnrvovrfc - 11-19-2023, 09:01 PM
RE: Variable Names - by Jack - 11-19-2023, 10:43 PM
RE: Variable Names - by DSMan195276 - 11-19-2023, 11:01 PM
RE: Variable Names - by Dimster - 11-20-2023, 01:46 PM
RE: Variable Names - by mnrvovrfc - 11-22-2023, 01:46 AM
RE: Variable Names - by Jack - 11-22-2023, 10:17 AM
RE: Variable Names - by mnrvovrfc - 11-22-2023, 09:47 PM



Users browsing this thread: 2 Guest(s)