Yes, but that would imply direction-changing escapes at the start of a literal or (perhaps) an identifier, not embedded in it and definitely not with multiple embedded escapes.
There's already a rule that identifiers have to start in a certain way that differs from what might follow (i.e. the acceptability of digits) and that could potentially be extended to when escapes were permitted.
Well, but the normal syntax constructs are left to right, arabic text is right to left, so if you have an arabic identifier it must always start with a direction switch, similar it always has to end with one to start the parameter list. Also it is common for such languages to embedd english words in the latin alphabet into their sentences. And identifiers usually are not words but phrases, a function like "PerfomRESTRequest" could be written as the arabic phrase for perfom request and the latin word REST, so in such a case you need at least 3 direction changes, possibly 4.
Honestly I see no way around to, if langauges like arabic should be supported, to allow for arbitrary direction changes.
Should two identifiers which comprised the same character sequence but rendered in opposing directions be equivalent or distinct? Should a reserved word rendered in the unconventional direction be considered equivalent?
MarkMLl
Well pretty simple, an identifier is referenced by the characters it is made of, not how the characters are displayed. Simply for the fact that it would be completetly impractical to compare renderings, you would have to render every identifier and compare the bitmaps or something similar. Then the question, what rendering engine should be used for this?
The thing is, yes unicode is complicated and no one likes internationalization. But it's the only viable solution if you don't want to exclude over half the planet.
Hi!
In the early Delphi days I was happy to find some solutions in a russian Delphi forum. I did not understand a word of the communication, but the code was (mostly) written in some kind of "Pascal English".
If the code was cyrillic it would't have helped me.
Winni
Forcing people to use a language you understand helps you to understand their code... What a revelation.
But you know this goes the other way around, while this makes it easier for you to understand the code, for the russians, the simple fact of learning Pascal requires them to learn english, which makes it much harder than if they could use russian and look at other russian code.
I wrote my first programs (Delphi) at the age of 7-8, where I did not understand a word english. I really started learning programming at the age of 12/13, where I knew a little bit english but wasn't that confident with it.
If I couldn't have used german identifier names, I would simply not have learned Pascal.
Restricting the identifiers to the english alphabeth only will simply result in people from other countries not using the language, but rather languages that will support their alphabet. And having less overall pascal programmers won't help you finding more code online either.