Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • my $fac10 = [*] 1 .. 10;

    It isn’t even worth pulling out into a function.

    • Perl Golf still lives, I see. I had started playing around with subsets and had intended to update it with stuff like that but I will just say wow...that is really neat.

      • It’s not golf! That’s just bog-standard Perl 6. Hyper- and reduce operators are normal part of the repertoire and in fact one of the reasons I am looking forward to v6. They get rid of huge swathes of monkey code… as you just saw. Lots of things that would require loops, which really constitute nothing but accidental complexity, can be expressed by a single operator.

        • Like all good things, I hope Perl 6 will change my perception of programming.

        • This old APL/J and Prolog programmer agrees that Perl6 is my dream languoge, as it has hyper / reduce and grammars/structure-matching search, plus threads, though perhaps without the elegance of Hoare-Dijkstra parallel calculus as I originally envisaged (nor even the terseness of sh's & ).

          However, how will the simple [*] 1..$n work or fail when $n is large like 100 or 8.424000e+08 ? Does it magically transform to a generator and tail recursion under the covers, or does it do what it appears to say an

          --
          Bill
          # I had a sig when sigs were cool
          use Sig;