On Sun, 04 Oct 2015 12:57:26 -0700, duelafn wrote:
> http://doc.perl6.org/type/IO::Path#method_absolute
> 
> Says: method absolute (IO::Path:D: $base = ~$*CWD --> IO::Path:D)
> 
> But IO::Path in Rakudo returns a string.
> 
> S16 doesn't really commit to an answer, saying just "absolute   the
> absolute, canonical path"
> 
> Who is correct?
> 
> Patches included to fix the perl6/doc or else fix the IO-Path module
> in rakudo/rakudo. Also attached trivial tests for each case for
> perl6/roast. (of course, only two of these patches should be applied.)


Thank you for the report.

The `.absolute`/`.relative` methods are basically a way to fine-tune how to an 
`IO::Path` is stringified. Since relative `IO::Path`s are relative to their 
`$!CWD` attribute and not the current `$*CWD` there's no tangible difference 
between absolute and relative `IO::Path` objects, so returning an `IO::Path` 
object from these methods is pointless.

Someone beat me to it to fix the `IO::Path`/`Str` on return types in the docs, 
but I've corrected[^1] some errors and expanded[^2] a bit on these two methods 
in the docs.

[1] https://github.com/perl6/doc/commit/ccae74a1502285d8b82697b68a8e26a31ca762d7
[2] https://github.com/perl6/doc/commit/3cf943d86bef3744146e31e106815a00a2a81f4a

-- IO grant

Reply via email to