On May 11, 2008, at 4:23 AM, Greg Ewing wrote:

> On May 11, 2008, at 1:55 AM, Dag Sverre Seljebotn wrote:
>
>> So to have consistency in any sane way one
>> needs to make "all compile-time types also available run-time types"
>
> I don't understand what you're getting at here. I thought
> that all these type parameters -- whether they're "values"
> like ints, or other types -- would be resolved at compile
> time. In other words, in
>
>    cdef A(len = x) a
>
> the x would have to be a constant expression. There's no
> problem with constant expressions, as they're already
> used in C array declarations.

The issue here is handling something like

cdef A x
cdef A(type=cdef int) y = x # this needs to be able to do type  
checking at runtime

it also is inline with writing code like

if A.type == cdef int:
     ...
else:
     ....

to be able to "easily" handle types with type parameters.

- Robert

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to