This file contains hidden or 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
I'm currently going through S17 to bring it up to date. | |
The following stuck out as things that may not be intentional behaviors, | |
so I need to know whether to doc current behavior or file an RT on each: | |
1) Should two different taps of a a serial supply be run simultaneuosly? | |
$ perl6 -e 'my $p = Supplier.new; my $s = $p.Supply; $s.serial.say; $s.tap({ sleep 1; "42 {now}".say; }); $s.tap({ sleep 1; "43 {now}".say }); $p.emit(42); sleep 3;' | |
True | |
42 Instant:1449454902.847377 |
This file contains hidden or 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
bri@atlas:~/git/perl6-Proc-Screen$ cat /tmp/screenrc | |
debug on | |
defutf8 off | |
bri@atlas:~/git/perl6-Proc-Screen$ screen -D -m -c /tmp/screenrc # then do "screen -Q info" from another window | |
Aborted | |
bri@atlas:~/git/perl6-Proc-Screen$ screen -ls | |
There are screens on: | |
7478..atlas-queryA (08/07/2015 09:41:20 PM) (Dead ???) | |
7478..atlas (08/07/2015 09:41:20 PM) (Dead ???) | |
Remove dead screens with 'screen -wipe'. |
This file contains hidden or 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
# We have to use NativeCall here as there is otherwise no way to | |
# get an fd for Term::termios, as of yet. And, it is buried so | |
# deep in the IO object it'll require guts work to unearth. | |
use NativeCall; | |
my sub open (str $pathname, int $flags) returns int is native {*} | |
my sub read (int $fd, Buf $buf is rw, int $count) returns int is native {*} | |
my sub close (int $fd) returns int is native {*} | |
my sub get-input { |
This file contains hidden or 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
So, this would seem to be the way to make a Supply from an IO::Pipe useful for waiting for the | |
pipe to close and then doing something with the pipe output. But it does not work reliably. | |
Similar schemes working directly with the Supply also have issues, since any state accumulating | |
the output in tap callbacks may not be complete inside a :done callback. Note that sometimes | |
(maybe when certain parts of the guts schedule on the same thread) it pretty much works -- I killed | |
statistically improbable runs with ^C below. Also note failures on run 8 and run 32 are popular. | |
$ perl6 -e 'sub f { my $cmd = Proc::Async.new(:path<ls>); my $c = $cmd.stdout.Channel; $cmd.start; $' | |
after 6 times |
This file contains hidden or 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
I think there might be a sliver of performance gain on that test script | |
with the following, but it is hard to tell. Oddly, it generates smaller | |
QAST but larger MAST. | |
diff --git a/src/core/Array.pm b/src/core/Array.pm | |
index e4960b0..2e03127 100644 | |
--- a/src/core/Array.pm | |
+++ b/src/core/Array.pm | |
@@ -319,7 +319,7 @@ my class Array { # declared in BOOTSTRAP |
This file contains hidden or 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
Copyright (C) 1999-2015 The FreeRADIUS server project and contributors | |
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A | |
PARTICULAR PURPOSE | |
You may redistribute copies of FreeRADIUS under the terms of the | |
GNU General Public License | |
For more information about these matters, see the file named COPYRIGHT | |
Starting - reading configuration files ... | |
including dictionary file /usr/share/freeradius/dictionary | |
including dictionary file /usr/share/freeradius/dictionary.dhcp | |
including dictionary file /usr/share/freeradius/dictionary.vqp |
This file contains hidden or 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
--- a/lib/Language/functions.pod | |
+++ b/lib/Language/functions.pod | |
@@ -155,6 +155,58 @@ type: | |
+=head1 Conventions and Idioms | |
+ | |
+While the dispatch system described above provides a lot of flexibility, | |
+there are some conventions that most internal functions, and those in | |
+many modules, will follow. These produce a consistent look and feel. | |
+ | |
+=head2 Slurpy Conventions |
This file contains hidden or 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
# This shows the cost of generating backtraces when using Str.Numeric | |
# to test whether a string can be numified, which is a normal usage | |
# scenario. | |
# | |
# Test code: different from the pre-allomorph original in that it will only | |
# ever generate one Failure per .Numeric, and as long as a :$backtrace is | |
# provided and the result is not thrown, should not generate any new backtraces | |
# (I think.) But -- also different in that it always uses an exception unwind | |
# instead of letting Failure objects go through the normal return path. |
This file contains hidden or 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
my sub build-cursor-to-template { | |
my ($x,$y) = 13,13; | |
my $raw = qq:x{ tput cup $y $x }; | |
my Str sub cursor-template( Int :$x, Int :$y ) { | |
# there may be single digit numbers in the escape preamble | |
$raw ~~ s:nth(*-1)[\d+] = $y+1; | |
$raw ~~ s:nth(*)[\d+] = $x+1; | |
return $raw; | |
} |
This file contains hidden or 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
diff --git a/src/core/Capture.pm b/src/core/Capture.pm | |
index 80d013c..dacdb85 100644 | |
--- a/src/core/Capture.pm | |
+++ b/src/core/Capture.pm | |
@@ -96,8 +96,8 @@ my class Capture { # declared in BOOTSTRAP | |
if self.^name eq 'Capture' { | |
"\\({ | |
join ', ', | |
- (nqp::atpos($!list, $_).perl for ^nqp::elems($!list)), | |
- %hash.sort.map( *.perl ) |