chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] Complaining as ordered: pre-declare-external?


From: Robin Lee Powell
Subject: [Chicken-users] Complaining as ordered: pre-declare-external?
Date: Sun, 8 Jul 2007 18:28:24 -0700
User-agent: Mutt/1.5.13 (2006-08-11)

(I was ordered to complain by the Cowan)

I have code that calls (with easyffi) a C library function.  One
argument is a function.  I've defined, with define-external, the
scheme function play.  I pass a pointer to play to the C library
function with (location play).  This breaks if play is not defined
on the same Scheme source file as the C library function call.

I'll let jcowan speak to the details, as I don't get it.

    18:17 < jcowan> You need (location play) because that's the only
    way to pass a C pointer to a function (afaik)

    18:18 < jcowan> Unfortunately, "location" only works properly if
    the compiler knows that its argument is externally defined.

    18:18 < jcowan> Otherwise it is converted into a call to
    make-locative, which is completely irrelevant to procedures.

    18:19 < jcowan> And alas there is no way to tell the compiler
    that play is external other than to define it right there.

    18:19 < rlpowell> No trick where I could pre-define it in that
    file but actually fill it out somewhere else?

    18:19 < jcowan> Not afaik.

    18:20 < rlpowell> 'k.  Thanks.

    18:20 < jcowan> Complain to Felix; this is definitely his
    domain.

-Robin

-- 
http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/
Reason #237 To Learn Lojban: "Homonyms: Their Grate!"
Proud Supporter of the Singularity Institute - http://singinst.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]