[MLton] The evils of importing as 'extern'

Matthew Fluet fluet@cs.cornell.edu
Wed, 24 May 2006 21:13:55 -0400 (EDT)


>> It seems to me that there must have been some reson not to include
>> "platform.h" in "c-chunk.h", which is where all the FFI declarations
>> used to live.
>
> The reason is that we want to keep the namespace pollution to a
> minimum in generated C files, which include c-chunk.h.  Generated C
> files include names that come from user code via _import declarations,
> so including platform.h would greatly increase the chance of
> conflicts.

But, what names are exported by platform.h that aren't also exported by 
libmlton.a?  That is, if there was a conflict, isn't the user at the mercy 
of the linker that the symbol gets resolved the way they want?