If you want an empty statement you can write:

1
2
[<Inline("void(0)")>]
let dbg name x = ()

You could also just simply have:

1
2
3
4
5
6
7
let dbg name x = 
#if DEBUG
	sprintf "%s = %A" name x |> log
#else
	()
#endif

This will still be translated to an empty function call but that doesn't really mean much in terms of performance.

Or if you want something more robust than directives take a look at the topic with config-based compilation.

By on 10/16/2015 5:01 AM ()

Cool. "void(0)" does the trick since it doesn't translate to any javascript.

By on 10/16/2015 12:43 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper