Give the following files, a.nim:
proc `/`*(a, b: string): string = a & "-a-" & b
b.nim:
proc `/`*(a, b: string): string = a & "-b-" & b
and m.nim:
import a, b
echo a.`/`("x","y")
echo b.`/`("x","y")
when defined(`a./`):
echo "a variant defined"
elif defined(`b./`):
echo "b variant defined"
else:
echo "No proc defined"
Running nimrod c -r m I get:
x-a-y
x-b-y
No proc defined
I tried different combinations of the symbol for defined but wasn't able to make it work. How can I check that this / symbol exists?Have you tried the following?
When defined(a.`/`):
...