문제

I have an F# script that I intend to use both at home and at work. The script shall work similarly in both places, yet, I have a set of issues to deal with at work (mostly regarding firewalls and http proxies) so I'd like to run my script in a slightly different way in one case and in the other.

I imagine that ideally I'd set a special flag (directive) at the FSI level, so I could have #if AT_WORK to deal with some sharp corner cases.

How to accomplish this?

도움이 되었습니까?

해결책

Yes, you can define your own symbols to use with conditional compilation, when you call FSI do it like this:

Fsi.exe --define:AT_WORK yourScript.fsx

See http://msdn.microsoft.com/en-us/library/dd233172.aspx

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top