Nice.
I think this would be a good addition to the docs :)
You can also write
$*PROGRAM.parent.parent.parent.parent.absolute;
but if your relative path is too short, you might end up with a bunch
of .. like this:
/Users/gabor/work/perl6maven.com/../..
Gabor
On Sun, May 28, 2017 at 9:10 AM
After thinking about what Zoffix said, probably what you're meant to do is:
$*PROGRAM.parent.absolute
Which leaves the stringification (.absolute) until last.
On Sun, May 28, 2017 at 4:04 PM Lloyd Fournier
wrote:
> FYI:
>
> 15:57 < llfourn> Zoffix: is there any plan to make .dirname and .absol
FYI:
15:57 < llfourn> Zoffix: is there any plan to make .dirname and .absolute
on IO::Path return an IO::Path?
15:58 < llfourn> (rather than a Str)
15:58 < Zoffix> llfourn: no
15:58 < Zoffix> .absolute is one of the two ways to stringify an IO::Path
(the second being .relative)
15:58 < Zoffix> And
thanks.
$*PROGRAM.dirname.IO.absolute;
also works, but yours seem better.
As a side note, dirname does not return and IO::Path object either.
Gabor
On Sat, May 27, 2017 at 6:48 PM, Lloyd Fournier wrote:
> I'd use
>
> $*PROGRAM.absolute.IO.dirname
>
> I'm not sure why .absolute doesn't return
A bit late, but thanks to both of you :)
Gabor
On Tue, May 2, 2017 at 6:33 PM, Gianni Ceccarelli
wrote:
> On Tue, 2 May 2017 17:02:40 +0200
> Gabor Szabo wrote:
>> Is there some way in Perl 6 to tell if a file was executed directly or
>> loaded into memory as a module?
>
> One way that seems to
Excellent. Thanks.
Gabor
On Fri, May 26, 2017 at 1:15 PM, Elizabeth Mattijsen wrote:
> Fixed with https://github.com/rakudo/rakudo/commit/f2fca0c8c2 .
>
>> On 26 May 2017, at 10:47, Brent Laabs wrote:
>>
>> To file a bug in Rakudo, you should email rakudo...@perl.org.
>>
>> If it's a better err
> On 27 May 2017, at 23:22, Elizabeth Mattijsen wrote:
>> On 27 May 2017, at 19:33, Marcel Timmerman wrote:
>> In perl6 version 2017.04.3-287-g3e7675a built on MoarVM version
>> 2017.04-64-g6d5ea04
>> implementing Perl 6.c. I observe the following;
>>
>> my Num $num = Inf;
>> my FatRat $f = $nu
> On 27 May 2017, at 19:33, Marcel Timmerman wrote:
> In perl6 version 2017.04.3-287-g3e7675a built on MoarVM version
> 2017.04-64-g6d5ea04
> implementing Perl 6.c. I observe the following;
>
> my Num $num = Inf;
> my FatRat $f = $num.FatRat;
> Type check failed in assignment to $f; expected F
Hi,
In perl6 version 2017.04.3-287-g3e7675a built on MoarVM version
2017.04-64-g6d5ea04
implementing Perl 6.c. I observe the following;
my Num $num = Inf;
my FatRat $f = $num.FatRat;
Type check failed in assignment to $f; expected FatRat but got
Rational[Num,Int] (?)
in block at line 1
I'd use
$*PROGRAM.absolute.IO.dirname
I'm not sure why .absolute doesn't return an IO::Path object. Maybe that's
being addressed as part of Zoffix++'s IO work.
On Sat, May 27, 2017 at 10:07 PM Gabor Szabo wrote:
> I came up with this:
>
> say $*PROGRAM-NAME.IO.absolute.IO.dirname;
>
> but I wo
I came up with this:
say $*PROGRAM-NAME.IO.absolute.IO.dirname;
but I wonder if there is a simpler way to do it?
regards
Gabor
11 matches
Mail list logo