Export/import for C?

jack at mcvax.UUCP jack at mcvax.UUCP
Wed Jul 16 19:02:34 AEST 1986


In article <640 at uvacs.UUCP> rwl at uvacs.UUCP writes:
>> I think C's usage of 'static', as applied to functions, to mean 'don't export'
>> is unfortunate.
>:
>> I would prefer the use of 'export' and 'import' as in Modula, with 'import'
>> replacing 'extern'.
>> (I don't speak for my employer)			jgh at gec-mi-at.co.uk
>
>I can appreciate the aesthetics of export/import, but I don't think it would
>improve my coding.  One of the reasons that I like C is the idea of having a
>grab-bag of functions at my disposal with the special exception of those which
>have been explicitly hidden from me via ``static''.
>
This is exactly what you *don't* want! The situation in C is that the default
is that a function is exported. This leads to the fact that most people
will, unthinking, make a lot of functions extern, while they could have
been static. An explicit 'export' could force you to think about it.
-- 
	Jack Jansen, jack at mcvax.UUCP
	The shell is my oyster.



More information about the Comp.lang.c mailing list