On Tue, Feb 25, 2003 at 02:47:46PM +0100, Frank Heckenbach wrote:
As another small step towards cleaning up the `external' mess in GPC, I'm now implementing `external name', i.e. procedure Foo; external name 'bar';
Looks good, as far as
var Name: Integer; external name 'name';
works. ("Name" is a very popular identifier).
However, unless there's heavy resistance, I'd like to deprecate the `c' and `c_language' directives, and drop them in a later release. So, procedure Foo; c; should be turned to: procedure Foo; external name 'foo';
What about: procedure Foo; external cname 'foo'; in case of resistance ;-)
What about a plain `external' without `name' or `asmname'? Currently, this keeps the "default" asmname (first letter uppercase, the rest lowercase). Some time in the future, we'll need name mangling (for qualified identifiers and overloading), so the default asmname will be something ugly which one should not have to know about in order to write interfacing C code or such.
I do not want to rewrite all my units interfacing C code. In C, all function names are lowercase with "_" between (gtk_window_new). In Pascal, this function would be called "GtkWindowNew". So something simlar to "asmname", "external name", or "attribute (name = 'XXX')" would be good.
Another question is whether `asmname' should be dropped entirely. In external declarations (the most common case), it can be turned into `external name' as described above. But there are cases where you need to set the asmname of a non-external routine or variable. But perhaps we can just use `name' then, e.g.: var Foo: Integer; name 'bar'; (instead of asmname 'bar'). The advantage would be to have another non-standard (conditional) keyword less. Or we could even use `attribute', something like: var Foo: Integer; attribute (name ('foo'));
This syntax looks unnatural to me, is it Lisp code?
var Foo: Integer; attribute (name = 'foo');
Looks better!
I think this could be an acceptable way (syntactically), so `asmname' can be dropped.
OK, with "attribute" at hand.
Eike