Re: [RFC] use `when predef.os.macosx` instead of `when defined(macosx)` ; more robust and scalable

2018-04-06 Thread Araq
[https://nim-lang.org/docs/nimc.html#additional-compilation-switches](https://nim-lang.org/docs/nimc.html#additional-compilation-switches)

Re: [RFC] use `when predef.os.macosx` instead of `when defined(macosx)` ; more robust and scalable

2018-04-06 Thread timothee
> Enum are mutually exclusive but you can create predefined sets from the enums. using this? [https://nim-lang.org/docs/manual.html#types-set-type](https://nim-lang.org/docs/manual.html#types-set-type) is there any code using it for defined(...) ? > Regarding compile-time defines, my main

Re: [RFC] use `when predef.os.macosx` instead of `when defined(macosx)` ; more robust and scalable

2018-04-05 Thread mratsim
Enum are mutually exclusive but you can create predefined sets from the enums. Regarding compile-time defines, my main issue is that a lot are hidden. There is this wiki documentation:

Re: [RFC] use `when predef.os.macosx` instead of `when defined(macosx)` ; more robust and scalable

2018-04-04 Thread Araq
Lol, please don't. I'm tired of nano improvements that make me touch thousands of lines of code. We need to ship what we have and call it a day. I don't remember mistyping these names all too often. And for other defines you can do: when defined(foo): const useFoo = true

Re: [RFC] use `when predef.os.macosx` instead of `when defined(macosx)` ; more robust and scalable

2018-04-04 Thread dom96
Go for it. It's a boring job but if you can create a PR to introduce these new symbols then please do

Re: [RFC] use `when predef.os.macosx` instead of `when defined(macosx)` ; more robust and scalable

2018-04-04 Thread timothee
thanks, didn't know about [https://github.com/nim-lang/Nim/blob/devel/lib/system/platforms.nim](https://github.com/nim-lang/Nim/blob/devel/lib/system/platforms.nim) ; it's an improvement over status quo, however: * since it uses an enum, the values are mutually exclusive; eg we can't have

Re: [RFC] use `when predef.os.macosx` instead of `when defined(macosx)` ; more robust and scalable

2018-04-04 Thread Araq
You can also use `when hostOs == "linux"` but it shares the typo fragility.

Re: [RFC] use `when predef.os.macosx` instead of `when defined(macosx)` ; more robust and scalable

2018-04-04 Thread Arrrrrrrrr
There is already a better approach [https://github.com/nim-lang/Nim/blob/devel/lib/system/platforms.nim](https://github.com/nim-lang/Nim/blob/devel/lib/system/platforms.nim)