It seems that me and Kurt are full speed ahead implementing memory view, 
after all.

Regarding syntax (not only the big issue of int[:], but also lots of 
smaller details in it), I think I'm going to take this stance:

In the first Cython release this ends up in (0.12 perhaps) this feature 
is marked as "experimental". Even using it will output a warning:

Warning: The memory view type is experimental, and its syntax may change 
in future Cython versions. Do not write too much code with it.

(A compiler directive can turn off the warning for Kurt's use.)

This seems to allow us getting the necessary experience developing and 
using it before fixing anything.

For those who are still following, I'd love some input on whether 
creative use of & seems acceptable. Basically on each axis we need to 
specify two closely connected, but orthogonal attributes:

Access mode: direct, ptr, full
Packing mode: contig, strided, follow

These will have lots of defaults and so on so you don't normally use 
them, but I'll deal with the situation where you do (for power users, 
which can tuck it away in a ctypedef). My visually preffered alternative is

cdef int[::contig & ptr, ::strided & direct]

although it would be possible to do e.g.

cdef int[::(contig, ptr), ::(strided, direct)]

instead.

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

Reply via email to