Ticket #16 (new enhancement)

Opened 7 months ago

Last modified 4 months ago

IF clauses inside definitions

Reported by: jmickelin@gmail.com Assigned to: somebody
Priority: minor Milestone: wishlist
Component: Parsing Version:
Keywords: Cc:

Description

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

Change History

08/18/2008 09:02:55 PM changed by robertwb

  • milestone set to wishlist.

08/18/2008 09:17:21 PM changed by robertwb

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

09/18/2008 02:17:58 AM changed by dagss

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).