hugs ffi - question thats been bugging me for some time

R. Legere legere@adelpia.net
Wed, 12 Jun 2002 20:29:47 -0400


This is a multi-part message in MIME format.

------=_NextPart_000_0007_01C2124F.E502AF70
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

In docs/ffi-notes.txt,  I find the following:

------------------------------------------------------------
o foreign export static is not implemented.

  You can code around this by writing:
 =20
    foreign import dynamic foo_dynamic :: Addr -> (A -> B -> C)
    foreign label foo_addr :: Addr
    foo =3D foo_dynamic foo_addr
 =20
  instead of:

    foreign import foo :: A -> B -> C
-------------------------------------------------------------------------=

Does anyone understand what this is saying? I can't grok it.
 The work around presented here seems to have nothing to do with
foriegn export static. It looks like a workaround to not having foreign
IMPORT static. (Which we of course dont need a workaround for :)).
 Is something extremely tricky going on or am i just dense?
=20
Anyway, just curious, I have not had any trouble working around by
passing pointers to the C-side using foreign export dynamic.
I have just wondered about this for a long long time :)


------=_NextPart_000_0007_01C2124F.E502AF70
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2716.2200" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff><FONT face=3DArial size=3D2>
<DIV>In docs/ffi-notes.txt,&nbsp; I find the following:</DIV>
<DIV>&nbsp;</DIV>
<DIV>------------------------------------------------------------<BR>o =
foreign=20
export static is not implemented.</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; You can code around this by writing:<BR>&nbsp;=20
<BR>&nbsp;&nbsp;&nbsp; foreign import dynamic foo_dynamic :: Addr -&gt; =
(A -&gt;=20
B -&gt; C)<BR>&nbsp;&nbsp;&nbsp; foreign label foo_addr ::=20
Addr<BR>&nbsp;&nbsp;&nbsp; foo =3D foo_dynamic foo_addr<BR>&nbsp; =
<BR>&nbsp;=20
instead of:</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; foreign import foo :: A -&gt; B -&gt; C</DIV>
<DIV>--------------------------------------------------------------------=
-----</DIV>
<DIV>Does anyone understand what this is saying? I can't grok it.</DIV>
<DIV>&nbsp;The work around presented here seems to have nothing to do =
with</DIV>
<DIV>foriegn export static. It looks like a workaround to not having=20
foreign</DIV>
<DIV>IMPORT&nbsp;static. (Which we of course dont need a workaround for=20
:)).</DIV>
<DIV>&nbsp;Is something extremely tricky going on or am i just =
dense?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Anyway, just curious, I have not had any trouble working around =
by</DIV>
<DIV>passing pointers to the C-side using foreign export dynamic.</DIV>
<DIV>I have just wondered about this for a long long time :)</DIV>
<DIV></FONT>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_0007_01C2124F.E502AF70--