On Jul 8, 2009, at 1:32 AM, Robert Bradshaw wrote: >> One possible solution is to just replace the word "object" in the C >> source with something else throughout. But I'd like to make as few >> modifications of the C source as possible. Is there an alternate >> solution? > > Yes, you can use the magic c-namespace-renaming quotes. For your > example. > >> I actually have another unrelated question: what is the correct >> cython >> syntax for the union statement at the top of this message? Cython >> doesn't seem to like me putting >> >> struct any: >> objtype type >> reftype nfref >> >> in the middle of a union statement. > > Cython doesn't support anonymous structs. Give that struct a name, > and then you can declare your variable with that type. (The name you > choose will never actually be used.)
Thanks, your suggestions worked perfectly. > Just out of curiosity, what are you wrapping? It looks like a math > library of sorts. I'm wrapping a program called LiE for doing computations in lie group representation theory. http://www-math.univ-poitiers.fr/~maavl/LiE/ This sort of thing is very useful in high energy theoretical physics, which is what I work on. The typical choice among us theorists for doing computations is Mathematica (with the exception of collider simulations, which are run with dedicated programs like Pythia). However, representation theory is something Mathematica doesn't seem to know about, and I haven't been able to find a package for it. LiE does basically what I want, except that everything is wrapped up in a custom language that's not very expressive, hard to debug, and generally unpleasant to use. Python is much lovelier, especially since the object-oriented-ness is well-suited for writing mathematics. So I'm doing my best to provide a python interface as an alternative to LiE's built-in lexer, parser, and interpreter. Thanks again for all your help, David _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
