Again: FFI syntax
Manuel M. T. Chakravarty
chak at cse.unsw.edu.au
Tue May 29 04:22:05 EDT 2001
Sven Panne <Sven_Panne at BetaResearch.de> wrote,
> > I like '&', but I'm less sure about '!' - this feels like we're getting
> > a little too cryptic.
> The reason for the "cryptic" '!' is avoiding ambiguity. Let's assume we
> introduce a modifier which looks like a valid C identifier. What should
> the following mean then?
> foreign import ccall "static foo bar" baz :: ...
> Is it an import of the C entity "foo" with the #include file "bar", or is
> it an import of the C entity "bar" with modifier "foo"? An alternative
> would be to make the include part somehow distinguishable from a C
> identifier, but I'm not sure if this would be less cryptical. And '!' is
> not that bad IMHO, the connotation "DANGER" should be obvious, and a single
> character doesn't clutter up the extent.
Now that we require the include file to have the suffix
`.h', the declaration should be unambigious without '!'.
Or do I overlook anything?
More information about the FFI