Grant Jacobs wrote:
My feeling is that as long as you don't lose
procedure Foo; external;
whatever you choose doesn't matter (for me!). I think it'd be an idea to leave open the option that the user wants to directly refer to the external name (as in the example above) and resolve any renaming issue via wrappers or the export mechanism should they choose to.
I don't quite understand. Which "the" external name are you referring to? Without any specification, that's undefined -- or rather, we're going to define it here. As I said, I suggest all-lowercase then.
FWIW, I prefer the options to be:
procedure foo; external; procedure foo; external 'name=_foo' ; procedure foo; external 'name=_foo; language=c' ; procedure foo; external 'language=c' ;
Where language could be any number of things: asm, c, c++, etc.
You can alter the stuff in the quotes to your heart's content without breaking the overall syntax of:
procedure <name> ; [ external [ '<attribute-list>' ] ; ] <attribute-list> ::= '<attribute-item> { ; <attribute-item> }' <attribute-item> ::= name | language = <string>
Stop for a minute. My intent in this thread is to *reduce* the number of parallel and redundant syntaxes, not to invent even more!
We already have `attribute' as a general container (similar to what you suggest within the quotes). We already have BP's syntax (which may not always be perfect, but as I said, all other things equal, it's better to follow it than make up something new).
So, unless there are other dialects whose compatibility we might consider, or the new syntax has real advantages (which I don't see), I don't see a point ...
One thing I like is that since the attribute keywords are within quotes, its obvious they don't conflict with any identifiers that the user might choose to use (ie. they have a very explicit context in which they exist).
Same for `attribute'. Besides, quotes have a particular meaning in Pascal in general (string constants), and I don't really like the idea of (mis?)using them for something else.
I suppose you could argue that the external keyword gives the context so the quotes are not needed, but I still feel happier with them inside quotes as in principle you could have it such that all keywords not in quotes are globally recognised as defined-keywords (and hence conflict with user's identifiers) and only those in quotes are treated as "local" (and hence not conflicting with user's identifiers). It'd make for one simple rule for identifier that's easy to follow.
If you're referring to the issues in my other mail -- this might work for these particular directives, but surely not for all the other problematic keywords, which certainly can't be enclosed in quotes.
Frank