On Wed, Jul 8, 2009 at 10:00 PM, Greg Ewing<[email protected]> wrote:
> Dag Sverre Seljebotn wrote:
>
>> This is hardly satisfying, and SOME kind of solution is needed here. If
>> only to prevent subtle bugs from mixing types from numpy.pxd with other
>> types in arithmetic!
>
> If you do this, you might like to consider a syntax
> I suggested earlier:
>
>   ctypedef some int foo
>   ctypedef some float bar
>
> etc.
>
> I think this is better than something like int? or
> ?int because it makes it clear that the uncertainty
> is about the size of the type, not its basic kind.
>

I agree...

> Some thoughts on implementation:
>
> * Treat it as having a rank higher than any known
> rank for that kind. That way arithmetic etc. between
> known and unknown sizes will get promoted to an
> unknown size.
>

I was also thinking about this way... I cannot imagine right now a
case were this breaks...

> * Only allow it to be introduced via a typedef, so
> that generated code always has a named type for the
> C compiler to go on.
>

Likely you mean EXTERNAL ctypedefs, right? In such case, that's the intention...

Greg, many thanks for your input...

-- 
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to