»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
Geth whateverable/master: 13 commits pushed by (Aleks-Daniel Jakimenko-Aleksejev)++, (Sylvain Colinet)++
review: github.com/perl6/whateverable/comp...46dba9ddff
01:06
Geth whateverable: c91eb7f60b | (Aleks-Daniel Jakimenko-Aleksejev)++ | bin/Releasable.p6
Change R6 link
01:16
Zoffix teatime: it's because ~~ is not symmetric. The thing on RHS dictates how the match is done and in this case it's a typecheck. Failure is a Nil (it's its subclass), so Failure ~~ Nil is true, but Nil is not a Failure, so Nil ~~ Failure is false 03:35
teatime I ended up doing some reading. Good explanation. 03:36
timotimo i wouldn't say "int32.^roles doesn't work" has something to do with "natives having rough edges". roles is simply a thing that's not possible to have for natives 05:47
smls m: say (HyperWhatever).^mro; 07:19
camelia sub (*@_) { #`(Sub|58907344) ... }
sjn looks at jnthn's mi.cro.services/ :) 09:10
...and found a typo \o/
timotimo the website is probably on github as well 09:12
learningperl6 howdy! how goes perl6 09:14
sjn learningperl6: perl6 is great! :) 09:15
timotimo: doesn't seem so? can't find it. :-| 09:16
timotimo oh 09:18
learningperl6 sjn :) 09:21
sjn timotimo: it is hosted on google, but not under the croservices project is seems 09:22
learningperl6 is mi.cro.services something jnthn strated? 09:24
sjn learningperl6: it's an edument project, it seems. just read about it on the facebooks 09:25
timotimo you mean "on github", right? 09:26
yeah, jnthn started cro
sjn timotimo: mi.cro.services ip address points to a googleusercontent.com owned IP 09:27
learningperl6 apart from its website is there any other place than facebook to learn more ?
timotimo ah, ok 09:28
sjn learningperl6: it's pretty new, so I guess not? 09:29
learningperl6 sjn: ah!. my hiatus explains my questioning then :) thanks anyway. 09:30
learningperl6 timotimo: last I remember when I was lurking, you were working on Levenshtein distance? ( meanwhile I'm asking am browsing the repository) 09:40
timotimo that was loooong ago :D 09:42
learningperl6 timotimo: :) 09:46
smls j: say "ab" ~~ / [ "ab" || "a" ]: "b" /; 09:50
camelia java.nio.file.NoSuchFileException: /nqp/lib/Perl6/BOOTSTRAP.jar
in <anon> (gen/jvm/ModuleLoader.nqp:90)
in load_module (gen/jvm/ModuleLoader.nqp:77)
in <anon> (gen/jvm/CORE.setting)
in <anon> (gen/jvm/ModuleLoader.nqp:255)
in load_sett…
smls ? 09:51
timotimo looks like it didn't get built correctly 09:52
tadzik so, cro! 10:06
what a release
timotimo oh yes 10:07
learningperl6 :) 10:11
pmurias so Cro is intended to be a web framework for writing micro services? 10:12
timotimo i wouldn't call it "web framework" 10:16
it can do much more than web 10:17
timotimo should we have a file descriptor duplication method on IO::Handle? 10:18
pmurias timotimo: what can it do besides web? 10:19
timotimo ZMQ isn't really web 10:22
and TCP in general, SSL sockets in general
ufobat m: my $c = "Some::Thing"; ::($c).new() 10:47
camelia Failed

Actually thrown at:
in block <unit> at <tmp> line 1
ufobat this error is not really helpful :( 10:48
shoudn't this failure be converted into an exception? i'd expect something like this: 10:50
m: my $c = "Some::Thing"; try { ::($c).new(); CATCH {default { $_.throw } } }
camelia No such symbol 'Some::Thing'
in block at <tmp> line 1
in block <unit> at <tmp> line 1
Skarsnik you can fill a bug repport for that I think
ufobat okay, will do 10:51
Skarsnik like you can send a mail to [email@hidden.address] or something like that
ufobat yap, done .) thank you 10:53
andreoss why comma acts as a statement terminator? 11:11
andreoss m: my $x = 1, #`new line here` 2, 3; say $x; # 2 and 3 are in sink context 11:12
camelia ( no output )
andreoss m: my $x = 1, #`<new line here> 2, 3; say $x; # 2 and 3 are in sink context 11:13
camelia WARNINGS for <tmp>:
Useless use of constant integer 2 in sink context (lines 1, 1)
Useless use of constant integer 3 in sink context (lines 1, 1)
1
araraloren_ m: my $x = 1, #`<new line here> 2, 3; say $x; # 2 and 3 are in sink context` 11:18
camelia WARNINGS for <tmp>:
Useless use of constant integer 2 in sink context (lines 1, 1)
Useless use of constant integer 3 in sink context (lines 1, 1)
1
araraloren_ m: my $x = 1, #`<new line here> 2 3; say $x; # 2 and 3 are in sink context`
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3my $x = 1, #`<new line here> 27⏏5 3; say $x; # 2 and 3 are in sink contex
expecting any of:
infix
infix stopper
statemen…
araraloren_ m: my $x = 1, #`<new line here> 2 3;`
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3my $x = 1, #`<new line here> 27⏏5 3;`
expecting any of:
infix
infix stopper
statement end
statement modifier…
araraloren_ m: my $x = 1; #`<new line here> 2 3;`
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3my $x = 1; #`<new line here> 27⏏5 3;`
expecting any of:
infix
infix stopper
statement end
statement modifier…
andreoss comman is missing 11:19
*comma
m: my $x = 1, 2, 3; say $x;
camelia WARNINGS for <tmp>:
Useless use of constant integer 2 in sink context (lines 1, 1)
Useless use of constant integer 3 in sink context (lines 1, 1)
1
andreoss hmm
it acts diffrenly in the repl 11:20
araraloren_ andreoss, it's a comma expression?
andreoss % printf 'my $x = 1,\n2,3' | perl6 11:21
araraloren_ Maybe it suppress the warning 11:22
andreoss if I type `my $x = 1,2,3` in repl I end up with `$x == (1,2,3)`; 11:23
araraloren_ Oh, Perl 6 not have comma expression, I think 11:24
andreoss actually not
it's just the repl which gives a misleading output 11:25
ufobat i am getting the error " 11:26
Too many positionals passed; expected 1 argument but got 2
in block at /home/martin/.workspace/p6/VoteImproved/../Bailador/lib/Bailador/Route/Controller.pm (Bailador::Route::Controller) line 17
andreoss and supresses warnings for some reasom
ufobat my line 17 is: require ::($.class);
i don't get why :(
araraloren_ Hmm, if you want bind a list, you can `my $x := 1, 2, 3; say $x;`
araraloren_ What is $.class for ? 11:27
ufobat it's a Str of an existing class, it work in my oneliner :( 11:28
a name of a class that i want to require
smls andreoss, araraloren_: The REPL doesn't print "Useless use of ... in sink context" for the last statement, because it doesn't sink that statement. It prints its. 11:29
araraloren_ If I run this `my $x = 1, 2, 3;` why it just print `(1, 2, 3)` 11:31
araraloren_ and this `my ($x) = 1, 2, 3;` will print `(1)` 11:32
smls It interprets it as ((my $x = 1), 2, 3);
araraloren_ oh ? 11:33
piojo m: my ($x, $y) = 1, 2, 3;
camelia ( no output )
piojo m: my ($x, $y) = 1, 2, 3; say $y;
camelia 2
smls m: my @a = my $x = 1, 2, 3; dd @a; dd $x;
camelia Array @a = [1, 2, 3]
Int $x = 1
piojo smls: it doesn't break it down the way you described
it interprets it as parallel assignment 11:34
timotimo araraloren_: you have to have something with @ on the lhs of the =
otherwise it'll be item assignment and ignore everything after the first thing
piojo it sees it as: my (list of variables) = list;
timotimo m: my ($a, $b, $c) = 9, 9, 9; say $a; say $b; say $c;
camelia 9
9
9
araraloren_ timotimo, yeah, I know, I just want see how
smls piojo: I was referring to `my $x = 1, 2, 3;`
timotimo m: my $x; @$x = 9, 9, 9; say $a; say $b; say $c; 11:35
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$a' is not declared
at <tmp>:1
------> 3my $x; @$x = 9, 9, 9; say 7⏏5$a; say $b; say $c;
timotimo m: my $x; @$x = 9, 9, 9; say $x.perl
camelia WARNINGS for <tmp>:
Useless use of constant integer 9 in sink context (lines 1, 1, 1, 1)
Cannot modify an immutable Any ((Any))
in block <unit> at <tmp> line 1
timotimo mhm
araraloren_ Actually I would not write that code, my @x = 1, 2, 3; would be the correct way 11:36
timotimo yeah
lunch &
araraloren_ But that's a pleasure of explore Perl 6's syntax :) 11:37
piojo m: grammar Matcher { rule TOP { <hash> }; proto rule atom {*}; rule atom:sym<hash> { . }; }; Matcher.parse('x'); 11:38
camelia P6opaque: no such attribute '$!pos' in type Match when trying to get a value
in regex TOP at <tmp> line 1
in block <unit> at <tmp> line 1
piojo The error should be "No such method 'hash' for invocant of type 'Matcher'"
piojo How do I know which project to file this bug with? 11:38
I assume it's either rakudo or moarvm. Is there any quick guideline? 11:40
araraloren_ what you mean..
m: grammar Matcher { rule TOP { <atom> }; proto rule atom {*}; rule atom:sym<hash> { . }; }; say Matcher.parse('x')
camelia 「x」
atom => 「x」
piojo I know the regex is wrong. But the error message is also wrong 11:41
the error said "no such attribute $!pos", which is nonsense because I never used any "pos"
araraloren_ ok
piojo Since perl6 is 3 projects, I assume this is a rakudo issue. Is that correct?
araraloren_ yeah, it need improve the error message . 11:42
yeah, it should be
piojo thanks
I'll mail it in, then 11:43
araraloren_ piojo, maybe you can ask somebody in perl6-dev(maybe right channel name)
ufobat AHHHH Golfed it down :/
piojo ‎araraloren_: thanks, I'll check 11:45
ufobat btw require ::($class) works 11:50
but require ::($.class) doesn't work
ufobat rt.perl.org/Public/Bug/Display.html?id=131971 11:53
andreoss github.com/andreoss/ob-perl6 # Org Babel for Perl 6 13:14
beginner hello 13:28
beginner is there abstract data type in perl 6 13:28
andreoss beginner: classes with stubs are abstract 13:36
m: class Abstract { method foo { ... } } ; class Concrete is Abstract { has $.foo = 10 }; Concrete.new.foo.say 13:37
camelia 10
beginner andreoss : ok but am here referring about the data type 13:41
Zoffix beginner: is there a description of what you're trying to accomplish? I glanced over a wiki for Abstract Data Type but it doesn't really tell me much. 13:47
Are roles it? docs.perl6.org/syntax/role 13:49
m: role Meow { method meow { say "meow" } }; class Foo does Meow {}; Foo.new.meow
camelia meow
Geth whateverable: 558b932ee0 | (Aleks-Daniel Jakimenko-Aleksejev)++ | 5 files
Actually fix these tests

Oops in 87f3f1c0cbe654539591d6511681bd989e1b2248
whateverable: c920e058bd | (Aleks-Daniel Jakimenko-Aleksejev)++ | 5 files
Make tests parallelizable

See issue #205. It is not entirely perfect because bots still lock each other when using same builds (especially on HEAD), but this makes the test suite go from 22 minutes to ≈11 minutes.
whateverable: 39e5c53825 | (Aleks-Daniel Jakimenko-Aleksejev)++ | 2 files
Split by “\n”, do not use .lines

Otherwise it may mistakenly split some line in half.
Zoffix "ADTs are a theoretical concept in computer science … mainstream computer language do not directly support formally specified ADTs." 13:51
Zoffix "In programming languages, an abstract type is a type in a nominative type system that cannot be instantiated directly; a type that is not abstract – which can be instantiated – is called a concrete type" 13:52
Yeah, sounds like our roles. Though we have auto-punning where you could instantiate a role, but it gets punned and basically becomes a class in that case.
andreoss beginner: classes are types in this case
piojo beginner: perl6 has parameterized types, too. I think roles are a better fit, but you can also use a parameterized type like generics in other languages
andreoss m: role Queue[::T] { method enqueue(T $x) { ... } ; method dequeue returns T { ... } } # begginer 13:59
camelia ( no output )
beginner Zoffix : web.mit.edu/6.005/www/fa14/classes/...tract_type 14:01
www.fas.harvard.edu/~cscie119/lectures/intro.pdf 14:02
timotimo andreoss: check out my adt module on modules.perl6.org 14:02
though those are "algebraic data types"
Zoffix buggable: eco adt 14:08
buggable Zoffix, ADT 'Algebraic Data Types inspired by Haskell.': github.com/timo/ADT
smls beginner: In Perl 6, the `Iterable`, `Positional` and `Associative` roles common interfaces for data structures. Is that what you mean?
For example class `Array` does both the `Iterable` and `Positional` role.
Zoffix beginner: thanks :) That stuff's over my head, so I'll shut up. Sorry :) 14:09
BenGoldberg m: role Callback[\T] { }; constant sorter_t = Callback[ :(Any, Any --> Order) ]; my sorter_t $x; 14:25
camelia ===SORRY!===
QAST::Block with cuid 3 has not appeared
Zoffix BenGoldberg: would you report that as a bug, please? End users should never see that error 14:27
huggable: rakudobugs
huggable Zoffix, Report bugs by emailing to [email@hidden.address]
jsimonet Hello, perl6.fail is not responding, I don't know if you are aware of this problem? The DNS is not responding.
Zoffix jsimonet: thanks. The domain was deliberately let to expire. The new address is fail.rakudo.party/ 14:28
jsimonet ok, thanks ! 14:29
BenGoldberg Zoffix, rakudo-bug-ed 15:21
jkva_ I'm trying to install Rakudo Star 2017.07 in Docker, but get the error that I'm missing File::Copy when running Configure.pl. What's the preferred way to make sure that my container base image has the proper modules available to install from source?
My base image runs 5.24, fwiw. 15:22
timotimo is that something like alpine linux? 15:24
i.e. "throw away everything we possibly can"?
jkva_ @timotimo: is that to me? It's running a base installation of Debian stable
timotimo OK, then at least you can just apt-get perl5 packages :) 15:25
andreoss File::Copy is core module
jkva_ Sweet! Thanks :)
jkva_ If it's core, I shouldn't get the error then? Anyway this is turning into a Perl5 question now, I'll go to the appropriate channels. my Perl6 code worked fine ;) 15:27
Ah, found the problem :) 15:29
timotimo interesting, do tell! 15:31
jkva_ timotimo: you were 100% right, just needed to `apt-get install perl` 15:33
timotimo huh, did you have something like "perl-core"? 15:34
jkva_ Which installed `libgdbm3 libperl5.24 perl-modules-5.24 rename`
timotimo or "perl-tiny"?
jkva_ Haven't a clue tbh, I'm not familiar with the config for the debian:stable baseimage
timotimo good to know in any case 15:35
jkva_ Yeah. Never used Docker until today so lots of new stuff 15:35
Zoffix Thanks. 15:59
samcv how do i fix how do i fix "Unhandled exception: Missing or wrong version of dependency " when running my system perl 6 inside the rakudo directory 16:37
and don't say, don't be in the rakudo directory. i need a workable way to get it to not look in ./ for nqp/rakudo libs
lizmat samcv: I'm afraid I don't have an answer 16:38
samcv :( 16:39
is there an env var i can change it to anything else?
gfldex lolibloggedalittle: gfldex.wordpress.com/ # <-- jnthn review welcome 16:43
and now with proper link: gfldex.wordpress.com/2017/08/27/ou...r-mystery/ 16:44
timotimo gfldex: i think you also want LAST in addition to CLOSE there 16:52
skids samcv: Well, recently %*ENV<NQP_LIB> was added, see nqp commits 152094b7 and dd25a924 16:53
timotimo i made a little bufferer for IO::Handle that works with binary modes
it has a different api from IO::Handle, though
samcv ah 16:54
timotimo gfldex: i'd expect LAST is fired also when the supply is regularly closed
oh, i might misunderstand 16:55
gfldex timotimo: testing 17:07
timotimo: LAST will not be executed 17:08
timotimo who wants to give me a very fast conversion from a Buf of 8 uint8 to one uint64? 17:11
timotimo benchable6: compare HEAD for ^10_000 { Buf.new(1, 2, 3, 4); Buf.shift + Buf.shift +< 8 + Buf.shift +< 16 + Buf.shift +< 24 } ||| for ^10_000 { Buf.new(1, 2, 3, 4); Buf.shift + Buf.shift * 64 + Buf.shift * 128 + Buf.shift * 192 } 17:21
benchable6 timotimo, starting to benchmark the 1 given commit
timotimo, gist.github.com/21cf5f1f5c66bd8c29...f6e7a097d8
timotimo that code si broken %) 17:22
on my machine those are equally fast, but i expect the time to create the bufs dominates the bitshift or multiplication time by a few orders of magnitude 17:24
AlexDaniel slaps benchable6 17:26
AlexDaniel benchable6: compare HEAD for ^10_000 { Buf.new(1, 2, 3, 4); Buf.shift + Buf.shift +< 8 + Buf.shift +< 16 + Buf.shift +< 24 } ||| for ^10_000 { Buf.new(1, 2, 3, 4); Buf.shift + Buf.shift * 64 + Buf.shift * 128 + Buf.shift * 192 } 17:31
benchable6 AlexDaniel, starting to benchmark the 1 given commit
AlexDaniel, gist.github.com/fdd1e2309da826acbf...26d77ddf9a
AlexDaniel timotimo: :(
timotimo :o 17:32
the code is wrong anyway
AlexDaniel oh, that's your code being wrong? :) 17:33
timotimo yes
AlexDaniel okay
timotimo benchable6: compare HEAD for ^100_000 { my $buf = Buf.new(1, 2, 3, 4); my int64 $a = $buf.shift + $buf.shift +< 8 + $buf.shift +< 16 + $buf.shift +< 24 } ||| for ^100_000 { my $buf = Buf.new(1, 2, 3, 4); my int64 $a = $buf.shift + $buf.shift * 64 + $buf.shift * 128 + $buf.shift * 192 }
benchable6 timotimo, starting to benchmark the 1 given commit
timotimo, ¦HEAD: «Benchmark: ␤Timing 10 iterations of 0, 1...␤«timed out after 10 seconds»»
timotimo benchable6: compare HEAD for ^10_000 { my $buf = Buf.new(1, 2, 3, 4); my int64 $a = $buf.shift + $buf.shift +< 8 + $buf.shift +< 16 + $buf.shift +< 24 } ||| for ^10_000 { my $buf = Buf.new(1, 2, 3, 4); my int64 $a = $buf.shift + $buf.shift * 64 + $buf.shift * 128 + $buf.shift * 192 }
benchable6 timotimo, starting to benchmark the 1 given commit
Geth whateverable: f7d80f3d99 | (Aleks-Daniel Jakimenko-Aleksejev)++ | bin/Benchable.p6
Fix lib path in Benchable

Issue #219.
benchable6 timotimo, gist.github.com/6b6501f8c0475c742f...fc18ca99de 17:34
timotimo benchable6: compare HEAD my $buf = Buf.new(1, 2, 3, 4); for ^10_000 { my int64 $a = $buf.AT-POS(0) + $buf.AT-POS(1) +< 8 + $buf.AT-POS(2) +< 16 + $buf.AT-POS(3) +< 24 } ||| my $buf = Buf.new(1, 2, 3, 4); for ^10_000 { my int64 $a = $buf.AT-POS(0) + $buf.AT-POS(1) * 64 + $buf.AT-POS(2) * 128 + $buf.AT-POS(3) * 192 } 17:38
benchable6 timotimo, starting to benchmark the 1 given commit
timotimo, gist.github.com/98a6b512027d4c3b80...758db3d068
AlexDaniel benchable6: compare HEAD sleep 1 ||| sleep 0.5 17:39
benchable6 AlexDaniel, starting to benchmark the 1 given commit
timotimo benchable6: compare HEAD my $buf = Buf.new(1, 2, 3, 4); for ^100_000 { my int64 $a = $buf.AT-POS(0) + $buf.AT-POS(1) +< 8 + $buf.AT-POS(2) +< 16 + $buf.AT-POS(3) +< 24 } ||| my $buf = Buf.new(1, 2, 3, 4); for ^100_000 { my int64 $a = $buf.AT-POS(0) + $buf.AT-POS(1) * 64 + $buf.AT-POS(2) * 128 + $buf.AT-POS(3) * 192 }
benchable6 AlexDaniel, ¦HEAD: «Benchmark: ␤Timing 10 iterations of 0, 1...␤«timed out after 10 seconds»»
timotimo, starting to benchmark the 1 given commit
timotimo, gist.github.com/2cc3f9e208e8c9b708...06df54f009
timotimo interesting
benchable6: compare HEAD my $buf = Buf.new(1, 2, 3, 4); for ^500_000 { my int64 $a = $buf.AT-POS(0) + $buf.AT-POS(1) +< 8 + $buf.AT-POS(2) +< 16 + $buf.AT-POS(3) +< 24 } ||| my $buf = Buf.new(1, 2, 3, 4); for ^500_000 { my int64 $a = $buf.AT-POS(0) + $buf.AT-POS(1) * 64 + $buf.AT-POS(2) * 128 + $buf.AT-POS(3) * 192 } 17:40
benchable6 timotimo, starting to benchmark the 1 given commit
timotimo, ¦HEAD: «Benchmark: ␤Timing 10 iterations of 0, 1...␤«timed out after 10 seconds»»
AlexDaniel if you do it without “compare” in two separate queries then the limit is higher I believe 17:41
timotimo ah 17:41
not so important
i know now that bitshift is faster and that's nice
but that's what i had already
so no way to get faster here
smls .tell lizmat Can you review this when you have time? github.com/rakudo/rakudo/pull/1139 17:47
yoleaux smls: I'll pass your message to lizmat.
lizmat . 17:48
yoleaux 17:47Z <smls> lizmat: Can you review this when you have time? github.com/rakudo/rakudo/pull/1139
lizmat smls: I assume this is all spectest clean? 17:49
smls On my Moar/Linux build, yes.
lizmat otoh, I don't think there are terrible many tests for this, or am I wrong ?
smls There are postcircumfix .[] and .{} tests all over the place, in roast - but I don't think they have great coverage. 17:51
lizmat: I additionally used the following test file locally: pastebin.com/raw/yE0RJjcq 17:56
lizmat smls: why not add those to roast ?
smls Dunno where to add them... 17:57
lizmat fwiw, I wouldn't know either, so maybe start a new file ? 17:58
timotimo "worse is better" 18:01
jkva_ Thanks @timotimo! 18:06
Very nice, didn't know `lines` defaulted to `argfiles` 18:07
timotimo oh that's you! :) 18:08
jkva_ Yeah. Been wanting to use Perl6 for the meetup rafflers for a while :) 18:09
timotimo you can also implement world's shortest cat: perl6 -e 'say slurp'
jkva_ It just needed to pick a random name from a file of newline-separated names, so otherwise easy enough
My first real usage of Perl6 :) 18:10
andreoss m: BEGIN { $*IN = "/usr/share/dict/words".IO.open }; $*IN.lines.pick.say 18:16
camelia ===SORRY!===
Failed to open file /usr/share/dict/words: No such file or directory
timotimo i don't think that can work, because of dynamic variables being dynamically scoped 18:18
and the rest of the code is far away from the dynamic scope of the begin block
m: BEGIN { say $*IN.perl } 18:19
camelia IO::Handle.new(path => IO::Special.new("<STDIN>"), chomp => Bool::True, nl-in => $["\n", "\r\n"], nl-out => "\n", encoding => "utf8")
timotimo hmm
andreoss works for me
i've been using $*IN, $*OUT redefined in BEGIN block for a while 18:20
is it error-prone somehow?
AlexDaniel don't you need an INIT block instead? 18:23
timotimo oh, OK
well, it probably won't survive precome if you have it in a module instead of a script
AlexDaniel also, this is exactly how you can change $*IN.nl-in when doing perl6 -npe 18:24
andreoss what -np does? 18:25
skids same as perl5. wraps the script in a get/print loop. Uses a tweaked alternate setting IIRC. 18:27
andreoss it would really nice if perl6 could detect itself being a pipe end and just silently execute code instead
i mean `echo 1 | perl6`
timotimo ? 18:28
andreoss *would be
timotimo oh you mean without the repl outputting stuff?
andreoss yes
andreoss i use -e '$*IN.slurp.EVAL' as a work-around 18:30
jkva_ timotimo: Is that `lines` shorthand in the docs, that you know of? 18:37
timotimo i think so 18:38
let me see
Zoffix jkva_: yeah: docs.perl6.org/type/IO::Handle#routine_lines
jkva_ Thanks!
timotimo zoffix is fast
Zoffix jkva_: note that in v6.d language, the default will be $*IN instead of $*ARGFILES when inside sub MAIN() {} 18:39
jkva_: words(), lines(), slurp(), get(), and getc() all default to argfiles
jkva_ Splendid, I should've seen that, even read through `lines` earlier. 18:40
Zoffix Oh, more specifically: $*ARGFILES will be set to just $*IN inside sub MAIN {}; it will still be IO::ArgFiles object.
jkva_ Zoffix: Once I get Perl6 better, this should make sense to me :) 18:42
Zoffix (why special default inside MAIN: because you usually do things with arguments inside sub MAIN, so it's not very useful for $*ARGFILES to still use the arguments as names for files; with $*ARGFILES defaulting to just $*IN, you can still use lines()/words()/etc and if you really do want to treat args as filenames, you can still make your own IO::CatHandle)
jkva_ Slightly confused on how the default of `$fh = = $*ARGFILES` works correctly on an array of filenames? 18:43
Does that get folded in into the set of the lines in all files?
Zoffix jkva_: we have a type called IO::CatHandle
jkva_: which basically switches to a new file when the first one is exhausted 18:44
jkva_ Nice.
Zoffix Or IO::Handle or IO::Pipe; and IO::CatHandle basically acts like a read-only IO::Handle (virtually identical interface; the only caveats are with seeking that can't cross file boundaries 18:46
) 18:47
jkva_ github.com/perl6/docker \o/ 19:01
Could've saved myself some work... 19:02
Zoffix Oh :) I should've mentioned we had it.
huggable: docker :is: Rakudo Docker images github.com/perl6/docker
huggable Zoffix, Added docker as Rakudo Docker images github.com/perl6/docker
jkva_ Really fast now, don't need to build in my own Dockerfile! 19:06
Zoffix \o/ 19:07
Zoffix woolfy \o/ 19:17
jkva_ woolfy \o/ 19:21
Zoffix .ask andreoss RE '$*IN.slurp.EVAL'; Would you know of a great way to detect whether the input is being piped to perl6? I googled around and answers say there's no fool-proof way. The other alternative is implementing "silent" line editor, which looks trivial to do, but `RAKUDO_LINE_EDITOR=silent perl6` is even longer than the $*IN/EVAL trick. github.com/rakudo/rakudo/blob/nom/...#L211-L217 19:26
yoleaux Zoffix: I'll pass your message to andreoss.
Skarsnik Zoffix, hm should there be something to read on 0 if it's piped? 19:27
Zoffix No idea. 19:29
geekosaur Zoffix, there's no foolproof way even in C
Zoffix Thanks.
maybe we could add a command-line switch... 19:30
geekosaur the closest you get is if it's not seekable then it's either a pipe or a fifo or a socket
(but you can argue the latter two are special cases of the former)
Zoffix geekosaur: would it be sane to check seekability when loading REPL and make it silent if STDIN is not seekable? 19:32
geekosaur Zoffix, for a REPL there's a simpler and usually even more correct check: isatty() 19:33
you generally don;t want verbosity if feeding from a file
Zoffix geekosaur++ thanks
woolfy \o/ 19:40
Pictures from The Perl Conference in Amsterdam, by Judith: Day 1: myalbum.com/album/vEDfZPrP8Jp0 ; Day 2: myalbum.com/album/ItlqEDaVG7Xb ; Day 3: myalbum.com/album/vqxcZx4xWb4Y 19:41
Geth doc: pstuifzand++ created pull request #1473:
Fix method name set-name -> set-name-age
19:49
b2gills Perhaps a flag could be added for when you don't want to use the REPL 19:50
skids Or have -e accept '-' 19:51
Zoffix I was thinking of doing the .tty check and checking if RAKUDO_LINE_EDITOR is (if it's not, use the bare REPL)
s/is/is set/;
woolfy: who's the person with one forearm? 19:52
jkva_ Zoffix: Tinita 19:57
Zoffix Ah. Thanks. 19:58
Zoffix woolfy++ nice pics 20:04
aeruder m: (^5).Supply.batch(elems => 2).tap: *.say 20:06
camelia [0 1]
[2 3]
[4]
aeruder m: (^5).Supply.batch(elems => 1).tap: *.say
camelia 0
1
2
3
4
aeruder m: (^5).Supply.batch(elems => 2, seconds => 200).tap: *.say
camelia [0 1]
[2 3]
[4]
aeruder m: (^5).Supply.batch(elems => 1, seconds => 200).tap: *.say
camelia [0]
[1]
[2]
[3]
[4]
aeruder this API drives me insane, I personally think Supply.batch ever returning self just seems broken 20:07
it seems a pretty reasonable expectation that you'd get lists out of whatever supply it returns
Zoffix aeruder: I think it returns a new Supply, not self. 20:08
aeruder but, it is actually part of the tested spec, so how do I go about proposing to change that
Zoffix: not if elems is 1 and seconds is unspecified
m: my $s = (^5).Supply; say ($s === $s.batch(elems => 1));
camelia True
mst that seems like a trivial optimisation and I don't see how it matters 20:09
aeruder except it isn't
timotimo right
batch is supposed to create one-elemen tlists
aeruder see the taps up there, now you have to do all kinds of param checking to make sure you're getting lists or not
timotimo not really
m: say 5.elems 20:10
camelia 1
aeruder m: (^5).Supply.batch(elems => 1).tap: *.say
camelia 0
1
2
3
4
aeruder m: (^5).Supply.batch(elems => 1, seconds => 500).tap: *.say
camelia [0]
[1]
[2]
[3]
[4]
timotimo m: (^5).Supply.batch(elems => 1, seconds => 500).tap(-> @foo { say @foo.perl });
camelia [0]
[1]
[2]
[3]
[4]
aeruder why is elems => 1, seconds => undef some special case
timotimo m: (^5).Supply.batch(elems => 1).tap(-> @foo { say @foo.perl });
camelia Type check failed in binding to parameter '@foo'; expected Positional but got Int (0)
in block <unit> at <tmp> line 1
timotimo there, that's not so great
aeruder exactly
but it is part of the actual tested spec for perl6 20:11
timotimo so yeah, put the test in 6.c-errata 20:11
aeruder so, i'm just wondering how to go about changing this
github.com/aeruder/rakudo/commit/1...e2a94f4736 -- like this
it seems pretty reasonable that batch just always returns a supply that produces lists 20:12
Zoffix aeruder: where's the test located? Is it part of 6.c-errata or just master
s: (^5).Supply, 'batch', \(elems => 1) 20:13
SourceBaby Zoffix, Sauce is at github.com/rakudo/rakudo/blob/4af1...ly.pm#L852
aeruder it was in some other repo, i'm pretty new to perl6 and the dev process
perl6-roast
skids Which git branch, is the question. 20:14
aeruder github.com/perl6/roast/blob/master...atch.t#L60
mst oh, right, I see, sorry
skids Yeah so the procedure for an test-incompatible change once it is agreed that the test was wrong is to add a test to 6.c-errata which serves to announce that 6.c's tests were wrong. 20:16
And then also into master afer the fix, IIRC.
(That is, the 6.c-errata branch of roast)
aeruder who "agrees" in this case? 20:17
Zoffix aeruder: submit your PR with the fix and mention that it breaks that test. The test looks wrong to me and if other devs agree, it'll be changed.
timotimo o/
aeruder well, i mean, who.. officially... are the people who need to agree
:)
Zoffix aeruder: me timotimo jnthn lizmat samcv TimToady moritz AlexDaniel 20:18
timotimo blushes
i don't belong that early in the list 20:19
aeruder i think i've actually found a whole mess of non-spec problems with Supply.batch fwiw, just getting started somewhere here
samcv hello
Zoffix The list is unordered :")
lizmat aeruder: good catch
looking at it now
timotimo ^- author of that method
Zoffix aeruder: FWIW there's #perl6-dev channel where more dev eyes would notice the discussion :)
aeruder ok, so should i just do a PR on rakudo? and mention that it breaks the tests in roast?
Zoffix Yeah
aeruder ok, let me start with that 20:20
samcv awesome :)
Aaronepower I heard it was easy to use python libraries in perl6 is that true? I want try and use BeautifulSoup in p6 20:26
timotimo it's pretty easy 20:27
Zoffix buggable: eco Inline::Python
buggable Zoffix, Inline::Python 'Use Python code and libraries in a Perl 6 program': github.com/niner/Inline-Python
Zoffix Aaronepower: I believe that ^ module is what provides that functionality.
AlexDaniel the way it handles non-positive ints is really bothering me 20:27
timotimo Aaronepower: perlgeek.de/blog-en/perl-6/2017-01...ython.html and gist.github.com/awwaiid/ef3f0abcfa96e34977b4 are good starting points i'm sure
AlexDaniel Aaronepower: by the way, why? Are you sure you don't need this? github.com/Skarsnik/perl6-gumbo 20:28
timotimo AlexDaniel: what does?
Aaronepower AlexDaniel: Huh
AlexDaniel timotimo: .batch: elems => …
0 is identical to 1, negative numbers act like infinity 20:29
Aaronepower AlexDaniel: Well I need something that has a lot of the capabilities of BeautifulSoup. I've found that a lot of libraries never come close.
AlexDaniel Rats act like infinity
timotimo oh?
aeruder AlexDaniel: yea, good point
AlexDaniel m: Supply.from-list(1..10).batch(elems => 2.5).tap({ .say })
camelia [1 2 3 4 5 6 7 8 9 10]
aeruder AlexDaniel: it really should be using >= rather than == 20:30
Zoffix in .comb we do <1 => 1
m: dd "foobar".comb: -42
camelia ("f", "o", "o", "b", "a", "r").Seq
aeruder yea, i think changing things to >= would have a similar effect 20:30
AlexDaniel Aaronepower: go for it then :) I think I've used python-gumbo with BeautifulSoup, it was fine. 20:31
Aaronepower: (using Inline::Python mentioned above)
m: dd "foobar".comb: 2.5
camelia Cannot resolve caller comb(Str: Rat); none of these signatures match:
(Str:D $: *%_)
(Str:D $: Int:D $size is copy, $limit = *, *%_)
(Str:D $: Str $pat, *%_)
(Str:D $: Str $pat, $limit, *%_)
(Str:D $: Regex:D $pattern, :$mat…
AlexDaniel well, I'm fine with it complaining 20:32
Zoffix thinks the entire codebase needs to be combed and decide what's the correct behaviour is for such cases and then do it consistently accross the board. 20:33
AlexDaniel yea
aeruder pun++ :P 20:34
AlexDaniel but we do know that defaulting to Inf is not quite right
AlexDaniel you can still work with it 20:37
m: (^5).Supply.batch(elems => 2).tap(-> List() $foo { say $foo.join(‘|’) })
camelia 0|1
2|3
4
AlexDaniel m: (^5).Supply.batch(elems => 1).tap(-> List() $foo { say $foo.join(‘|’) })
camelia 0
1
2
3
4
AlexDaniel using .list on something is a fairly common idiom if you expect one thing or a list of things at the same time 20:38
woolfy Zoffix: not my pics, but by Judith de Hont, the conference's communications officer. :-) 20:42
AlexDaniel greppable: batch 20:46
greppable6 AlexDaniel, gist.github.com/56c24fbbc311ccddfa...ac370ed576
Zoffix Noted
AlexDaniel Not exactly what I was looking for… “NA-NA-NA-NA-BATCHFILE!” 20:47
aeruder been a while, forgot that github auto-updated the pull request everytime i updated the remote branch D: 20:59
AlexDaniel lizmat: I don't understand your question. The check that was mentioned causes “flush” to happen 21:04
lizmat ah, ok, if you accept $elems to be < 1 21:05
aeruder also to handle rational (2.3)
in a reasonable way
AlexDaniel ah, now I understand the question 21:06
lizmat Int(Cool) :$elems would do that also
AlexDaniel hm, that sounds like a better way to approach it 21:07
aeruder I also use it because right now I'm defaulting the batch size to 0 in the case of !$elems
because in the timeout case, there is a distinction between 0 and 1, but in the non-timeout case there isn't 21:08
could make that more explicit tho
aeruder is still trying to figure out how to run tests correctly in roast :-/ 21:09
Skarsnik Aaronepower, duuno Beautifulsoup lookpretty standard 21:11
Aaronepower Skarsnik: Stuff like removing and stripping elements from the in memory tree is something that is usually missing. 21:12
AlexDaniel don't we have that in XML? 21:13
Skarsnik Could be added to the XML module
but I think XML has method for that?
Skarsnik and I added stuff in gumbo to prefilter stuff 21:14
Aaronepower AlexDaniel: Can XML handle html5? 21:14
Skarsnik no
AlexDaniel Aaronepower: no, that's what Gumbo is for
Skarsnik not its job 21:15
Aaronepower AlexDaniel: Oh, your comment implied that XML could do that for HTML
AlexDaniel Aaronepower: Gumbo module gives you XML::Document, so everything XML has applies
tinita waves to Zoffix
AlexDaniel Skarsnik: hm, but what if you want to get html5 back? 21:17
Skarsnik good question
AlexDaniel Skarsnik: like change something and then have everything else roundtrip
Skarsnik does not look like gumbo has an api for writing 21:18
Zoffix tinita: oh cool :) You're in #perl6 21:19
tinita Zoffix: =) 21:22
have to get back to learn more perl6 actually 21:23
Skarsnik AlexDaniel, probably need to find another lib? but generating html5 should be easier than generating it
AlexDaniel Skarsnik: I think so too. But we have nothing in the ecosystem yet 21:37
_cronus hello everybody. Is there a way to get an element from (1..16).permutations without calculating all the previous permutations? 22:13
Skarsnik sounds like something that could be done with lazy list? 22:16
andreoss m: (1..10).permutations.^name.say 22:22
yoleaux 19:26Z <Zoffix> andreoss: RE '$*IN.slurp.EVAL'; Would you know of a great way to detect whether the input is being piped to perl6? I googled around and answers say there's no fool-proof way. The other alternative is implementing "silent" line editor, which looks trivial to do, but `RAKUDO_LINE_EDITOR=silent perl6` is even longer than the $*IN/EVAL trick. github.com/rakudo/rakudo/blob/nom/...#L211-L217
camelia Seq
andreoss m: (1..10).permutations.lazy.^name.say 22:23
camelia Seq
Skarsnik fun 22:24
_cronus Skarsnik, andreoss: thanks 22:25
_cronus Skarsnik, andreoss: any pointers where I can find more info on lazy lists in the docs? I know I've seen it somewhere, but for some reason I can't find it. 22:29
andreoss my point is you probably cannot calculate an element non sequentially 22:30
andreoss github.com/rakudo/rakudo/blob/nom/...r.pm#L2296 22:32
_cronus andreoss: thanks again. 22:39
AlexDaniel aeruder++ 23:05
aeruder: are you planning to submit roast PR too? 23:08
AlexDaniel what is the easiest way to getppid? 23:51