Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IO::Path clarifications #49

Open
colomon opened this issue Jun 4, 2013 · 1 comment
Open

IO::Path clarifications #49

colomon opened this issue Jun 4, 2013 · 1 comment

Comments

@colomon
Copy link
Contributor

colomon commented Jun 4, 2013

Working on borrowing IO::Path for Niecza, I've come up with a few questions.

  • Say we've got

    my $p = IO::Path.new(:basename("4th.pl"), :directory("."), :volume(""))

What should $p be? The spec says "Stringification returns the path (volume, directory and base name joined together) as a string", which to me would naively suggest ./4th.pl. But Rakudo and Roast seem to think it should be just 4th.pl. That's reasonable, I'm just curious what the official rules for this should be.

  • S32-io/dir.t has a test which does

    my @files = dir();
    @files.grep('t');

Should that's trying to smartmatch an IO::Path and a Str. Should that work?

I will add more things here as they come up...

@colomon
Copy link
Contributor Author

colomon commented Jun 4, 2013

Talking with labster++ I've concluded that smartmatching IO::Path ~~ Str should indeed work, as Str.ACCEPTS does an eq check, which should convert IO::Path to Str.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant