> On 17 Dec 2015, at 18:13, Zefram (via RT) <perl6-bugs-follo...@perl.org> > wrote: > > # New Ticket Created by Zefram > # Please include the string: [perl #126950] > # in the subject line of all future correspondence about this issue. > # <URL: https://rt.perl.org/Ticket/Display.html?id=126950 > > > > IO::Path.perl produces output of the general form > $a.IO(:SPEC($b),:CWD($c)), but it turns out that this expression doesn't > actually replicate the SPEC and CWD attributes: > >> "foo".IO(:SPEC(IO::Spec::Unix), :CWD("/bar")).perl > q|foo|.IO(:SPEC(IO::Spec::Unix),:CWD</home/zefram/usr/rakudo/rakudo>) >> "foo".IO(:SPEC(IO::Spec::Win32), :CWD("C:\\bar")).perl > q|foo|.IO(:SPEC(IO::Spec::Unix),:CWD</home/zefram/usr/rakudo/rakudo>) > > Empirically, it would work to instead generate a IO::Path.new expression: > >> IO::Path.new("foo", :CWD("/bar")).perl > q|foo|.IO(:SPEC(IO::Spec::Unix),:CWD</bar>) >> IO::Path.new("foo", :SPEC(IO::Spec::Win32), :CWD("C:\\bar")).perl > q|foo|.IO(:SPEC(IO::Spec::Win32),:CWD<C:\\bar>) > > This is distinct from the string quoting issues that arise in the same > code and are being addressed in [perl #126935].
FWIW, I’m not ready to drop the .IO form, because we may want to be able to override that coercer in the future. Liz