This capability would have to be provided somewhere, since its absolutely essential to portably handle many path manipulation use-cases (eg provide an absolute path or a relative path that is relative to some base path). IMO joinpath() is as good a place as any to have the functionality.
On Friday, February 6, 2015 at 7:45:44 AM UTC+11, Milan Bouchet-Valat wrote: > > Le jeudi 05 février 2015 à 14:09 -0500, Stefan Karpinski a écrit : > > I don't see how it's magical. The function joinpath(path1,path2) gives > > the path of path2 relative to path1 – that's what it means. When path2 > > is absolute, path1 doesn't matter to answer that question. > Yeah, but one could also imagine raising an exception instead, as the > programmer may not have expected path2 to be absolute. It's not magical, > but maybe a little too smart for my taste for a function called > "joinpath". YMMV of course. > > > Regards > > > On Thu, Feb 5, 2015 at 2:06 PM, Milan Bouchet-Valat > > <nali...@club.fr <javascript:>> wrote: > > Le jeudi 05 février 2015 à 13:55 -0500, Stefan Karpinski a > > écrit : > > > When you open the file referred to by path2, that is > > essentially > > > looking at joinpath(pwd(), path2) and this is just a > > generalization of > > > that that behavior relative to path1 instead of pwd() > > specifically. > > > This is also how Python does it, although there seems to be > > some > > > confusion due to that as well. > > Indeed. Isn't this behavior a bit too magical for the Julian > > philosophy? > > Is convenience worth the increased confusion here? Maybe this > > behavior > > should only be enabled via a keyword argument? > > > > > > Regards > > > > > On Thu, Feb 5, 2015 at 12:36 PM, Davide Lasagna > > > <lasagn...@gmail.com <javascript:>> wrote: > > > I know this is documented by what is the rationale > > for > > > joinpath(path1, path2) to return path2 if path2 > > looks like an > > > absolute path? > > > > > > Cheers, > > > > > > Davide > > > > > > > > > > > > > > > > > > > > > >