[mercury-users] foreign_decl vs. foreign_code

Zoltan Somogyi zs at cs.mu.OZ.AU
Tue Feb 12 20:46:24 AEDT 2002


On 12-Feb-2002, Michael Day <mikeday at bigpond.net.au> wrote:
> Should I have
> put something like "extern myInt g;" in the foreign_decl?

Short answer: put what you would put into a .h file into a foreign_decl,
and what you would put into a .c file into foreign_code. (U of M reference:
remember the rules I taught in 252.) In this case that requires a declaration
for the variable that is separate from its definition.

Zoltan.
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list