Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Implement IO::CatHandle.handles
Lets the user work on source handles individually, which is
especially handy when working with $*ARGFILES. e.g.:
# print at most the first 2 lines of each file in $*ARGFILES:
.say for flat $*ARGFILES.handles.map: *.lines: 2
Addresses R#1546 #1546- Loading branch information
1 parent
2a8b17a
commit d5baa03
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d5baa03There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this doesn't work on the JVM backend:
Would it be possible to use a construct with nqp::defined here (and in line 115)? (At least nqp::defined(self.next-handle) is used multiple times in this file.)
[Please note: I don't know how to fix the underlying issue with nqp::eqaddr. I've tried to look at it once and I vaguely remember it relied on hashCode on the JVM backend.]
d5baa03There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That means =:= operator doesn't work either and a number of fast-path optimizations don't work either.
Is there even a ticket for this bug?
d5baa03There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only problem I remember wrt nqp::eqaddr was noted here: https://rt.perl.org/Ticket/Display.html?id=128041
I don't really understand under which conditions nqp::eqaddr gives the wrong answer. Mostly, it seems to work just fine (we have quite a lot of nqp::eqaddr in rakudo's core.)
d5baa03There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, after hitting the comment button, it occured to me that a nqp::decont might make a difference:
d5baa03There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in eb06492213
d5baa03There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot!