I think that if the ampersand appears in any occasion then it should always appear.
Consistency is important to ensure the file is always treated the same way which cannot be guaranteed if the ampersand in is significant in some situations and not in others.
I agree. As far as I know, escaping keywords with ampersands is important for compatibility in some cases. And if
Delphi does not allow it, then this makes
fpc an advantage, which is, as all know, more portable.
However,
WooBean, I would like to clarify at what level of
Delphi this is "prevented"? Have you tried calling the compiler directly?
Some filesystems/OS' do not allow an ampersand in a filename (or has a special meaning).
At which ones exactly? File systems used in
Windows (
FAT32/
NTFS) definitely allow this, and in
Linux (
EXT4) there are almost no restrictions at all.
This sign can be interpreted in the terminal, but it can be escaped.
And this all is not so important, since only escaping keywords in the code is mandatory. That is, the file can be called simply "
begin.end.pas", but in the code it must be written "
&begin.&end".
I wouldn't recommend abusing &. It was meant for COM interfaces that are externally named, not as the end of keywords.
Can you give an example? I saw somewhere the use of "
interface", but I never looked into it. I only found
this information, in which I do not see the use of the ampersand.