Trying above function:
echo joinPath("/part1st","part2st")
i get:
Error: ambiguous identifier: 'joinPath' -- use one of the following:
ospaths2.joinPath: proc (head: string, tail: string): string{.noSideEffect, gcsafe.}
ospaths2.joinPath: proc (parts: varargs[string]): string{.noSideEffect, gcsafe.}
Aot I have the following imports:
import std/[strutils, sequtils, algorithm, times, parseopt, math, tables, os]
import std/private/[osdirs,osfiles]
I have also added: ospaths2 but that does not make a diff.
Thanks all.
Spot the error:
import std/private/[osdirs,osfiles]
Hint: It's the word starting with P.
@arak
thanks for the quick response.
Firstly AI told me that private modules are not to be used by programmers but only by other (public) modules, in this case the module os. So it seems i must delete the second line. I assume that's what you meant with the "p".
Furthermore, previously AI told i could make a proc-alias like (i dont if that is valid):
let jp = joinPath
which was meant to shorten things. Apparently that somehow generates the message...
Is that by the way a valid way to create a proc-alias?
Yes, the private means that you shouldn't import it (at least unless you know what you're doing).
And the AI doesn't appear to know a lot of Nim, maybe not unsurprisingly, the proc-alias is better done as a template:
template jp(x: varargs[untyped]): untyped = joinPath(x)
@ PMunch
Since i often dont know what i am doing :-D i wont import the privates... And thanks for the alias-alternative. I will try it.