# Designing a Paths Julep

**URL:** <https://discourse.julialang.org/t/designing-a-paths-julep/124335>\
**Category:** Internals & Design\
**Tags:** proposal, filesystem, path, rfc\
**Created:** [January 1, 2025, 12:37pm UTC](https://discourse.julialang.org/t/designing-a-paths-julep/124335 "2025-01-01T12:37:25Z")\
**Posts on this page:** 1\
**Showing post:** 22

<div class="post-metadata">

**Author:** ![MilesCranmer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/milescranmer/32/21070_2.png) [@MilesCranmer](https://discourse.julialang.org/u/MilesCranmer)\
**Post date:** [January 3, 2025, 8:10am UTC](https://discourse.julialang.org/t/designing-a-paths-julep/124335/22 "2025-01-03T08:10:18Z")

</div>

Good point. I think

```julia
# equivalent to joinpath
/(::Path, ::Path) -> Path
/(::Path, ::String) -> Path

## equivalent to string concat (like file extensions)?
# [deleted] *(::Path, ::String) -> Path

# invalid
*(::Path, ::Path) -> error
*(::String, Path) -> error
/(::String, ::Path) -> error
/(::String, ::String) -> error

```

I think making `*` completely invalid for use on `Path` would also be a good option, to avoid ambiguity here [edit: yeah probably just do this].

Also, if relative paths is made a different type from an absolute path (which semantically seems good), you could even make it so that

```julia
# ok
/(::RelativePath, ::RelativePath) -> RelativePath
/(::RelativePath, ::String) -> RelativePath
/(::AbsolutePath, ::RelativePath) -> AbsolutePath
/(::AbsolutePath, ::String) -> AbsolutePath

# invalid
/(::String, ::RelativePath) -> error
/(::String, ::AbsolutePath) -> error
/(::RelativePath, ::AbsolutePath) -> error
/(::AbsolutePath, ::AbsolutePath) -> error

```

Perhaps those could just be fields of `Path` rather than actually distinct types.

* * *

Edit: nvm, removed the `*(Path, String)` - see below.

---

_[View the full topic](https://discourse.julialang.org/t/designing-a-paths-julep/124335)._
