Module lookup and class naming
"Bertrand LUPART - Linkeo.com" <[email protected]> Thu, 23 Mar 2017 11:46:31 +0100
| Newsgroups | gmane.comp.lang.pike.user |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I'm using a custom module for dealing with CSV files for some years now, and everything's fine :
— 8< — 8< — 8< —
// Public.Standards.CSV.FILE
class FILE
{
inherit Stdio.FILE;
// custom code here, everything's fine
}
— >8 — >8 — >8 —
Now, i'm slightly updating the module to handle CSV data stored in strings :
— 8< — 8< — 8< —
// Public.Standards.CSV.String
class String
{
// obviously won't inherit String here
// class name collision : can't invoke classes from top level String, like String.SplitIterator for example
}
— >8 — >8 — >8 —
This leads me to two questions :
1- Invoking String classes (like String.SplitIterator) from my String class fails because of class name collision. There should be a way to ask the compiler to look up String.SplitIterator from the top level hierarchy and not the local class but i failed to find this myself from the doc.
2- Obviously, renaming the String class solves the issue. Should class names be globally unique ? Public.Standards.CSV.CSVFILE and Public.Standards.CSV.CSVString looked redundant to me.
Thank you,
--
Bertrand