[IronPython] Preprocessor directives in IronPython 2.0

Dino Viehland dinov at microsoft.com
Mon Dec 15 10:20:47 PST 2008


The one form this is available is with the assert keyword.  Assert statements will be removed in optimized code so you don't have the if debug check.  But they won't let you have the else branch.

From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher
Sent: Monday, December 15, 2008 6:27 AM
To: Discussion of IronPython
Subject: Re: [IronPython] Preprocessor directives in IronPython 2.0

Nope.  Why do you think you want them?  Or rather, what's wrong with this:

debug = False

def Main():
    if debug:
        print 'DEBUG is set'
    else:
        print 'DEBUG is not set'
On Mon, Dec 15, 2008 at 5:46 AM, Yash Ganthe <yashgt at gmail.com<mailto:yashgt at gmail.com>> wrote:
In C# we can code for conditional compilation such as:
public static void Main()
{
#if DEBUG
Console.WriteLine("DEBUG is defined");
#else
Console.WriteLine("DEBUG is not defined");
#endif
}

Is it possible to do the same in IronPython? Does it support preprocessor directives?

Thanks,
Yash




_______________________________________________
Users mailing list
Users at lists.ironpython.com<mailto:Users at lists.ironpython.com>
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ironpython.com/pipermail/users-ironpython.com/attachments/20081215/1ce29f78/attachment.htm>


More information about the Users mailing list