Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Variable Names
#3
(11-19-2023, 06:18 PM)Dimster Wrote: Is there a reason why a variable name can not begin with a numerical value? ie a1 = 100 is ok but 1a = 100 or 1a$ = "100" is not ok.

Not that I know a heck of a whole lot about interpreters/compilers parsing and tokenising (?) a program, but I imagine there's value in the process knowing immediately that:
  • it is dealing with a literal number (because of a digit)
  • versus it is dealing with a literal string (because of a double-quote)
  • versus it is dealing with an identifier (variable, constant, function ... because of an alphabetic character)

I think.
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)