On May 6, 2009, at 12:48 PM, Dag Sverre Seljebotn wrote: > Robert Bradshaw wrote: >> Just trying to get a syntax, how about >> >> cdef extern from "header.h": >> cdef cclass MyClass[TemplateParamers](BaseCPPClass): >> int member >> int method(int) >> >> The only concern I have is whether or not "cdef cclass" is to similar >> to "cdef class" (probably not). Any other ideas? > > cdef cppclass?
I don't like this one, but I think just for aesthetic reasons. Nor cpp_class. > Yes, I think cclass is to similar to class. > > Anyway, when I proposed a Fortran syntax earlier you and Stefan made a > good point about the language specification belonging in the "cdef > extern" > part, as, after all, the "header.h" file contains only C++ code. Will the compiler need to know that header.h is C++ code? If not, I see no reason to declare it. > Also consider that C++ needs namespace specifications, for instance > > cdef extern ...: > namespace std: > cdef cppclass vector[T]: ... > > or > > cdef cclass std::vector[T]: ... Yep. That too. I'm a fan of both declarations. (Or even rolling the "namespace" into the cdef extern statement.) - Robert _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
