Portings Texts.Mod to Oberon-7, my Artemis project
> The Oberon-07 language report does not define the implementation of CHAR. > It can be 8 bits, 16 bits or even longer. The language does only define ORD, but > does not define what ORD returns. It might be ASCII, it might be EBCDIC or Unicode. Could one therefore change the implementation of the data type CHAR such that it can be Unicode, while simultaneously keeping the implementation backward compatible, i.e ideally such that no c(!) ode in the system needs to be changed? > Principally, all program code using someting like ORD(ch)-48 is not portable. > Better is ORD(ch) - ORD(“0“). All program code assuming CHAR to be one byte > is not portable. Use BYTE instead. Of course, in places where non-portable code exists in the system, one would then need to adapt it.
participants (1)
-
Andreas Pirklbauer