
At 02:48 PM 8/26/2004, Carlo Wood wrote:
... What do you think about my proposal(s)?
I (too?) think that an important improvement can be made by making an explicit distinguishment between relative and absolute paths.
Dave was talking about changes to the path grammar. IIRC, he was not suggesting adding additional path types. If the grammar can be modified to make relative and absolute path issues clearer, that would be a good thing. But there still isn't a firm proposal on the table for grammar improvements.
...
My idea is therefore that there should be two types: - An absolute/native path type and - A relative/portable path type
We looked at that approach during initial design, and it just didn't work. The added complexity was really messy, yet the benefits were few. For example, what does the signature of the exists() function look like if there are two path types? Do we now need two exists() functions? What about functions that take two path arguments? Do those now need four versions? That might just barely be acceptable in the filesystem library itself, but you couldn't inflict that sort of argument explosion on user code. Instead, you would need a base class. That adds complexity. It just gets too messy, and tests to break use cases we really want to work. We really want the user to be able to write: if fs::exists("foo") ... rather than: if fs::exists(fs::relative_path("foo")) ... --Beman