Skip to content

Commit

Permalink
Simplify creation of IO::Path::xxx classes
Browse files Browse the repository at this point in the history
More for maintenance convenience than anything else
  • Loading branch information
lizmat committed May 23, 2020
1 parent dc4fcb0 commit 4103a30
Showing 1 changed file with 7 additions and 20 deletions.
27 changes: 7 additions & 20 deletions src/core.c/IO/Path.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -835,29 +835,16 @@ my class IO::Path is Cool does IO {
}
}

my class IO::Path::Cygwin is IO::Path {
method new(|c) { self.IO::Path::new(|c, :SPEC(IO::Spec::Cygwin) ) }
multi method raku(::?CLASS:D:) {
self.^name ~ ".new({$.path.raku}, {:$.CWD.raku})"
}
}
my class IO::Path::QNX is IO::Path {
method new(|c) { self.IO::Path::new(|c, :SPEC(IO::Spec::QNX) ) }
multi method raku(::?CLASS:D:) {
self.^name ~ ".new({$.path.raku}, {:$.CWD.raku})"
}
}
my class IO::Path::Unix is IO::Path {
method new(|c) { self.IO::Path::new(|c, :SPEC(IO::Spec::Unix) ) }
multi method raku(::?CLASS:D:) {
self.^name ~ ".new({$.path.raku}, {:$.CWD.raku})"
}
}
my class IO::Path::Win32 is IO::Path {
method new(|c) { self.IO::Path::new(|c, :SPEC(IO::Spec::Win32) ) }
my role IO::Path::Spec[$SPEC] is IO::Path {
method new(|c) { self.IO::Path::new(|c, :$SPEC) }
multi method raku(::?CLASS:D:) {
self.^name ~ ".new({$.path.raku}, {:$.CWD.raku})"
}
}

my class IO::Path::Cygwin does IO::Path::Spec[IO::Spec::Cygwin] { }
my class IO::Path::QNX does IO::Path::Spec[IO::Spec::QNX ] { }
my class IO::Path::Unix does IO::Path::Spec[IO::Spec::Unix ] { }
my class IO::Path::Win32 does IO::Path::Spec[IO::Spec::Win32 ] { }

# vim: ft=perl6 expandtab sw=4

0 comments on commit 4103a30

Please sign in to comment.