Pyrex Hard Case

Rodrigo Benenson rodrigob at elo.utfsm.cl
Mon Apr 28 14:59:33 EDT 2003


Francois Pinard wrote:
>>>I'm not fully sure I'm replying to your question, but this might work:
>>>
>>>---------------------------------------------------------------------->
>>>cdef extern from *:
>>>    MACRO_NAME(EXPECTED_ARGUMENTS)
>>>----------------------------------------------------------------------<
>>
> 
> [rdrb at 123.cl]
> 
> 
>>I had already done that.
>>extern MACRO_NAME(EXPECTED_ARGUMENTS)
> 
> 
> This is not the same thing.  Your macro declaration, in Pyrex, really
> ought to be within the `cdef extern from *:' and indented within it.
> You do not need to repeat `extern', yet I presume it does not hurt either.
> 

I just replyied shortly, in fact I did tested your suggestion and it 
create the same output. It's obvious it should do, because we are 
defining and External Function Prototype. So Pyrex will define the 
prototype in order to have a good compilation.

In normal C I should just simply avoid the prototype and let's the Macro 
do his job. But here in Python/Pyrex I nedd to tell to Pyrex how to 
manage/translate the objects applyied to and resulting form this macro.

I think that Pyrex should have something like:
"""
cdef macro foo_type foo_function (foo_parameters)
"""
That behave like an cdef extern but do not instanciate the extern prototype.

Be the way maybe Pyrex have already a trick to do this in 0.7.

Thanks anyway.
I will be waiting for more attempt.
RodrigoB.





More information about the Python-list mailing list