I have a project with two different versions depending on a compile time symbol VERSION1. It has the following structure:
partA
when VERSION1:
partB1
else:
partB2
partC
when VERSION1:
partD1
else:
partD2
partE
PartC depends on partsB and partsD depend on partC, so the when commands cannot easily be combined. All of the partsB1, B2, D1, and D2 are fairly large and I want to keep them in separate files.
Hence I have used include commands thusly:
partA
when VERSION1:
include "partB1.nim"
else:
include "partB2.nim"
partC
when VERSION1:
include "partD1.nim"
else:
include "partD2.nim"
partE
Is there a better (more nim-like) way to do this?