Adriaan van Os wrote:
Frank Heckenbach wrote:
Prof A Olowofoyeku (The African Chief) wrote:
If "name" is not supplied, then GPC could supply sensible defaults: Procedure Foo; external; { GPC supplies "name 'Foo'" automatically) Procedure Bar; { GPC supplies "name 'Bar'" automatically)
As I said, I'd prefer all-lowercase then.
All-lowercase is arbitrary, as was the previous convention. Any default name mangling scheme that is out of control of the programmer (with switches) is arbitrary. The best default will depend on the habits of a platform. The two largest API sets in the world (Win32 and MacOS) have Pascal-style capitalization
This just means that for such routines you need to specify the asmname explicitly, anyway, since there's no way for the compiler to "guess" such a scheme.
and nobody wants to write nEWhAnDLe instead of NewHandle or hEaPaLlOc instead of HeapAlloc.
I don't understand what you mean here.
Again, Pascal is case-insensitive, so the capitalization of Pascal identifiers must not matter. So if you want
procedure NewHandle; external;
to get an asmname `NewHandle', then
procedure nEWhAnDLe; external;
must also get `NewHandle', and I don't think that's possible to do (in general).
You're right, any default convention is arbitrary, but I think we should choose a somewhat "natural" default. AFAICS, the only "natural" convention in C is all-lowercase. It's what most if not all standard C and POSIX functions use. It's also what many C programmers write; other write mixed style, but as I said above, we can't get that automatically anyway, so we have to ignore that; whereas I haven't seen anyone who would write all C identifiers with first-uppercase-rest-lowercase, so this wouldn't be a useful default convention I think (while it's useful for "internal" Pascal identifiers where the goal is to avoid conflicts with other languages, i.e. quite the contrary).
Frank