tail call optimization

2016-11-17 Thread Hiroki Horiuchi
Hello. I think the tail call is optimized in the following Perl 5 code. How can I do the same in Perl 6? -- #!/usr/bin/env perl v5; use strict; use warnings; local $\ = "\n"; sub reduce_sum($$) { my ($sum, $range) = @_; return $$sum unless @$range; my $lhs = shift @$ran

Re: [perl #130114] IO::Path.resolve on windows prefixed with \

2016-11-17 Thread mt1957
On 11/16/2016 09:17 PM, Zoffix Znet via RT wrote: On Wed, 16 Nov 2016 03:01:30 -0800, mt1...@gmail.com wrote: Hi, On windows the path created by method resolve on windows is prefixed with a '\' which is wrong e.g. in project config-datalang-refine on appveyor the statement say 'Resolve: '

Re: perl 5?

2016-11-17 Thread yary
Addning to Jan's answer, PerlMonks is still a great place for answers on Perl5 topics (and even some Perl6) http://perlmonks.org/ > I still do not have perl 6 support on rhel 7.2 Don't know how much of an "early adopter" you want to be- if that's an option, try building Rakudo from source, so yo

[perl #128897] [LTA] [MATH] "-0".Num isn't negative

2016-11-17 Thread Zoffix Znet via RT
On Thu, 11 Aug 2016 09:32:31 -0700, zef...@fysh.org wrote: > > "-0".Num.perl > 0e0 > > It's surprising that that's producing a floating-point positive zero, > rather than the negative zero that is also available: > > > (-("0".Num)).perl > -0e0 > > -zefram Thanks for the report. Are you able to

Re: [perl #128897] [LTA] [MATH] "-0".Num isn't negative

2016-11-17 Thread Brandon Allbery
On Thu, Nov 17, 2016 at 10:13 AM, Zoffix Znet via RT < perl6-bugs-follo...@perl.org> wrote: > > The reason we have a negative floating point zero at all is more due to > underlying implementations at whose level such zeros are used to signal > various exceptions. But such usage isn't needed on Perl

Re: perl 5?

2016-11-17 Thread Brandon Allbery
On Thu, Nov 17, 2016 at 2:08 AM, ToddAndMargo wrote: > Would you guys tolerate a perl 5 question every so often? Quite a few of the folks who work on Perl 6 don't know Perl 5, or at least know it only incidentally. -- brandon s allbery kf8nh sine nomine associate

[perl #128897] [LTA] [MATH] "-0".Num isn't negative

2016-11-17 Thread Zoffix Znet via RT
More discussion on IRC: https://irclog.perlgeek.de/perl6-dev/2016-11-17#i_13584755 So it seems a fix is indeed needed.

[perl #128785] [MATH] Zero to the zeroeth power: Complex numbers not consistent with others.

2016-11-17 Thread Zoffix Znet via RT
On Sat, 10 Sep 2016 23:17:33 -0700, sml...@gmail.com wrote: > Comparison table of the different cases of "zero to the zeroeth power" > in Rakudo: > > nn**00**nn**n > - - - - > 0 1 1 1 > 0.0 1

Re: perl 5?

2016-11-17 Thread ToddAndMargo
On 11/16/2016 11:27 PM, Jan Ingvoldstad wrote: On Thu, Nov 17, 2016 at 8:08 AM, ToddAndMargo wrote: Hi All, Would you guys tolerate a perl 5 question every s

Re: perl 5?

2016-11-17 Thread ToddAndMargo
On 11/17/2016 08:18 AM, Brandon Allbery wrote: On Thu, Nov 17, 2016 at 2:08 AM, ToddAndMargo wrote: Would you guys tolerate a perl 5 question every so often?

Re: perl 5?

2016-11-17 Thread Brandon Allbery
On Thu, Nov 17, 2016 at 3:03 PM, ToddAndMargo wrote: > And quiet a few perl 5 programmers are REALLY GRUMPY/CRABBY > about perl 6. I don't get it. > I think mostly this is history: the original perl 6 development team languished for many years producing basically nothing while promising everyth

Re: perl 5?

2016-11-17 Thread ToddAndMargo
On 11/17/2016 05:34 AM, yary wrote: Addning to Jan's answer, PerlMonks is still a great place for answers on Perl5 topics (and even some Perl6) http://perlmonks.org/ > I still do not have perl 6 suppor

Re: tail call optimization

2016-11-17 Thread Elizabeth Mattijsen
Hiroki, > On 17 Nov 2016, at 10:49, Hiroki Horiuchi wrote: > I think the tail call is optimized in the following Perl 5 code. Are you sure? Have you benchmarked it? I seem to recall that using goto like that in Perl 5 only makes sure that any backtrace doesn’t get longer. But that it comes

[perl #130123] [BUG] Instant.from-posix is too eager with adding extra 10 seconds for TAI - UTC difference

2016-11-17 Thread via RT
# New Ticket Created by Zoffix Znet # Please include the string: [perl #130123] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=130123 > The Instant.from-posix adds leap seconds to the provided argument: m: say Instant.

Re: [perl #130123] [BUG] Instant.from-posix is too eager with adding extra 10 seconds for TAI - UTC difference

2016-11-17 Thread Elizabeth Mattijsen
> On 17 Nov 2016, at 21:51, Zoffix Znet (via RT) > wrote: > > # New Ticket Created by Zoffix Znet > # Please include the string: [perl #130123] > # in the subject line of all future correspondence about this issue. > # https://rt.perl.org/Ticket/Display.html?id=130123 > > > > > The Instan

Re: [perl #130123] [BUG] Instant.from-posix is too eager with adding extra 10 seconds for TAI - UTC difference

2016-11-17 Thread Elizabeth Mattijsen
> On 17 Nov 2016, at 21:51, Zoffix Znet (via RT) > wrote: > > # New Ticket Created by Zoffix Znet > # Please include the string: [perl #130123] > # in the subject line of all future correspondence about this issue. > # https://rt.perl.org/Ticket/Display.html?id=130123 > > > > > The Instan

[perl #130124] [LTA] NaN in quantifiers is not allowed, message complains about P6opaque (/ .**{NaN..NaN} /)

2016-11-17 Thread via RT
# New Ticket Created by Aleks-Daniel Jakimenko-Aleksejev # Please include the string: [perl #130124] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=130124 > *Code:* say ‘abcefgh’ ~~ / .**{0..NaN} / *Result:* This type cannot

[perl #130125] [REGEX] negative numbers in ranges are understood incorrectly (/ .**{-10..-5} /)

2016-11-17 Thread via RT
# New Ticket Created by Aleks-Daniel Jakimenko-Aleksejev # Please include the string: [perl #130125] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=130125 > *Code:* say ‘abcefghij’ ~~ / .**{-10..-5} / *Result:* 「abcefghij」 I

[perl #130127] [REGEX] Excluded endpoints in ranged quantifiers do not work at all (/ .**{2^..^2} /)

2016-11-17 Thread via RT
# New Ticket Created by Aleks-Daniel Jakimenko-Aleksejev # Please include the string: [perl #130127] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=130127 > *Code:* say ‘abcefghij’ ~~ / .**{0..^2} / *Result:* 「ab」 I expected

Re: tail call optimization

2016-11-17 Thread Andrew Kirkpatrick
Perl5 goto &func definitely doesn't grow the stack: perl -E '$n = 0; sub wah { return if $_[0] < 1; $n++; @_=($_[0]-1); goto &wah; }; wah(shift); say "done $n"' 1000 But IIRC goto &func is more about fooling caller() than TCO, so its not that really fast thing some users expect. On 18 Novemb