Re: processing a file in chunks

2019-10-22 Thread Brad Gilbert
CatHandle is the mechanism behind $*ARGFILES. If you want to read several files as it they were one, you can use IO::CatHandle. my $combined-file = IO::CatHandle.new( 'example_000.txt', *.succ ... 'example_010.txt' ); Basically it works similar to the `cat` command-line utility. (Hence its n

Re: What is a LoweredAwayLexical?

2019-10-22 Thread Brad Gilbert
The optimizer can lower lexical variables into local variables. When it does so, it keeps track of this so that it can give you this error message. The `given` block and the `when` blocks are optimized away. If you move the first `$a` declaration to inside the `given` block the error goes away.

What is a LoweredAwayLexical?

2019-10-22 Thread Kevin Pye
Yesterday I created a new when clause in an existing working program, which worked fine, but today when I came to exercise another previously working when clause it was broken. The golfed version... my $a = 41; given 6 { when 5 { my $a; } when 6 { say $a + 1; } }

Re: processing a file in chunks

2019-10-22 Thread Marcel Timmerman
On 10/22/19 3:03 PM, Parrot Raiser wrote: CatHandle? Is that an alias for "tail"? :-)* hehe, that's a nice word change... Well, I've seen it here at https://docs.perl6.org/routine/readchars But there's also IO::Handle What I've understood is that the CatHandle does the same as a readonl

Re: processing a file in chunks

2019-10-22 Thread Parrot Raiser
CatHandle? Is that an alias for "tail"? :-)* On 10/22/19, Marcel Timmerman wrote: > On 10/22/19 1:05 PM, Marcel Timmerman wrote: >> On 10/20/19 11:38 PM, Joseph Brenner wrote: >>> I was just thinking about the case of processing a large file in >>> chunks of an arbitrary size (where "lines" or "

Re: processing a file in chunks

2019-10-22 Thread Marcel Timmerman
On 10/22/19 1:05 PM, Marcel Timmerman wrote: On 10/20/19 11:38 PM, Joseph Brenner wrote: I was just thinking about the case of processing a large file in chunks of an arbitrary size (where "lines" or "words" don't really work).   I can think of a few approaches that would seem kind-of rakuish, b

Re: processing a file in chunks

2019-10-22 Thread Marcel Timmerman
On 10/20/19 11:38 PM, Joseph Brenner wrote: I was just thinking about the case of processing a large file in chunks of an arbitrary size (where "lines" or "words" don't really work). I can think of a few approaches that would seem kind-of rakuish, but don't seem to be built-in anywhere... somet

Re: order of execution

2019-10-22 Thread Marcel Timmerman
Thanks everyone, I wonder, should I file an issue at rakudo's? Marcel Programs are compiled in memory, it just isn't written out to disk. On Mon, Oct 21, 2019 at 3:33 AM Marcel Timmerman > wrote: @yary Thanks for your answer. I've done it too and saw the sa

Re: processing a file in chunks

2019-10-22 Thread William Michels via perl6-users
Hi Joe, Just a quick note to say that "Learning Perl 6" by brian d foy has a section on reading binary files (pp.155-157). Check out the "Buf" object type, the ":bin" adverb, and the ".read" method. In particular, ".read" takes an argument specifying how many octets you want to read in. HTH, Bill