Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IF clauses inside definitions #573

Closed
robertwb opened this issue Jun 5, 2008 · 5 comments
Closed

IF clauses inside definitions #573

robertwb opened this issue Jun 5, 2008 · 5 comments

Comments

@robertwb
Copy link
Contributor

robertwb commented Jun 5, 2008

Normally, IF only works in the global scope.
Defining conditional members of a struct necessitates redefining the whole structure:

IF UNAME_SYSNAME == "Windows":
      ctypedef struct ohmygod:
            int common
            int greece
ELSE:
      ctypedef struct ohmygod:
            int common
            float pelvis

This would be more convenient, especially for big structures:

ctypedef struct ohmygod:
     int common
     IF UNAME_SYSNAME == "Windows":
                 int greece
     ELSE:
                 float pelvis

Migrated from http://trac.cython.org/ticket/16

@robertwb
Copy link
Contributor Author

@robertwb changed milestone to wishlist
commented

@robertwb
Copy link
Contributor Author

@robertwb commented

These macros are not a pre-parser as in C, and so to do this one would have to do a bit of trickery...

@robertwb
Copy link
Contributor Author

@dagss commented

I vote for resolving this as invalid; as discussed on the mailing list (sometimes August 2008) the efforts in this direction might be better concentrated on integrating other preprocessing languages with Cython instead (and slowly deprecating the IF statement altogether).

@maxbachmann
Copy link
Contributor

@scoder given the deprecation in #4310 this can probably be closed

@da-woods
Copy link
Contributor

Yeah I think we're agreed that we aren't planning to do this thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants