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 and nobody wants to write nEWhAnDLe instead of NewHandle or hEaPaLlOc instead of HeapAlloc.
If the declarations are all one-liners, and the letter-casing is the same that should be used for asmnames, try this (using GNU awk -- I'm not using sed because it doesn't seem to have an easy way to match `procedure' and `function' case-insensitively, and because an awk script can be better extended if necessary):
#!/bin/sh gawk ' BEGIN { IGNORECASE = 1 } $1 == "procedure" || $1 == "function" { n = $2 sub ("[^a-z0-9_].*", "", n) print $0 " external name '"'"'" n "'"'"';" } '
Thanks for the example (and I found coworkers on a MacPascal mailing list that offered further help here).
Regards,
Adriaan van Os