khchen / wNim

Nim's Windows GUI Framework
MIT License
327 stars 17 forks source link

Clash of & with strformat #33

Closed f-carraro closed 5 years ago

f-carraro commented 5 years ago

I get an ambiguous call error when trying the following code:

import wNim, strformat

let myvar = "string"
echo &"{myvar}"

There is clash on the definition of & by wNim and strformat. Both act on strings but in different ways, so allowing only one definition is not sufficient I assume.

khchen commented 5 years ago

You can add except after strformat, for example:

import wNim
import strformat except `&`

let myvar = "string"
echo fmt"{myvar}"
echo strformat.`&`("{myvar}")

Or you can add except after wNim, the choice is up to you.

BTW: I use & for string addressing in winim BEFORE strformat package existing. And I don't think there is a better choice than & symbol for now.