Hi
question: Do we teach to parser to ignore duplication of statement about CONST if they are made the same definition (for name and value)?
summarizing the different opinions showed until now:
let's make Pro and Cons
Pro - no headache for error that are no error (a CONST doesn't change)
- high feasibility to combine library of different authors and/or ispirations
Cons- no documentated feature of BASIC language
- if we change one definition of CONST we fall in the issue of duplicate of name because the others are not already changed so we must search the others to change
other options...-- make a strong changement of QB64 using
$IF TRUESET = FALSE THEN
CONST TRUE = -1, FALSE = 0
$LET TRUESET = TRUE
$END IF
and making a not backward compatibility with previous code.
This can be a feature of compiler activable by settings in menu (this can solve the backward compatibility issue)
-- create a .BI with only UNIVERSAL CONST from TRUE, FALSE... to OPENED, CLOSED, LOCKED, IS_DIGIT, IS_STRING as a global constant file as heat of each program coded in QB64. Just like Steve's .BI for COLOR costants.
-- we can teach to parser/compiler to jump to translate (or to REM) the duplicates of CONSTs, so if coder likes he doesn't care of duplication of the CONST otherwise he go down to delete duplications
Just a my real dubt
Does C++ compiler accept duplicate of CONST?
Thanks to read