»ö« 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.
lookatme o/ 00:17
BenGoldberg So I have a question, which is perhaps a bit mad. I know that one of Rakudo's backends is the jvm. I know that android apps must be written in java (or at least, be made of jars containing java class files). So, can rakudo run on an android phone or tablet? 00:52
BenGoldberg wonders if he might have accidentally stumbled onto perl6's "killer app" ;)
perigrin I look forward to your excellent blog post about the trials and tribulations of getting it working 00:54
perigrin runs away and hides 00:55
BenGoldberg Ha, that's waaay beyond my skill level! 00:55
Now, if someone else created a rakudroid deployment deployment system, I'd be happy to write a game of tetris in perl6 to play on my phone ;) 00:56
perigrin so one of the hiccups is that android doesn't use the JVM 00:58
perigrin however castaway got pretty far at one point cross-compiling perl5 for the NDK APIs on android ... so someone might get further getting MOAR via the NDK. 01:01
BenGoldberg Even though android does not literally use a jvm for itself, all apps which run on it must use java bytecode, which, as they get loaded, are transparently compiled into dalvik bytecode or native instructions. 01:16
sacomo hi all, question about methods using `is export`, is there any way to make their class attributes / self. available from the exported method? bar() instead of Foo.bar() 01:19
lookatme sacomo, what do you mean, a singleton ? 01:32
And I think self is can only using inside class . :) 01:33
sacomo I read somewhere that we can use "method foo() is export {}" and access foo like with exported subs. Not sure if that is possible. I know we can export subs from inside a class, but we don't have access to self. from those subs. 01:34
I could be wrong though. I am usually wrong.
lookatme m: class Foo { method bar() is export { } }; say ::.keys 01:35
camelia ($=pod $_ $/ !UNIT_MARKER $=finish EXPORT Foo $! ::?PACKAGE GLOBALish $¢ $?PACKAGE)
lookatme m: module A { class Foo is export { method bar(Int $s) is export { say $s; } }; }; import A; say &bar(Foo, 25) 01:38
camelia 25
True
lookatme sacomo, works ^^ 01:38
sacomo hmm 01:40
piojo Is there any way to use bisectable to test precompilation problems? 02:36
MasterDuke piojo: it'd be a little tricky. does using the 'no precompilation' directive show whatever behavior you're trying to test? 02:50
piojo MasterDuke: the error still happens. It could be related to "use"ing files rather than precompilation 02:57
piojo But I still can't test it with a single file. The error doesn't happen. (I already reported it as rt.perl.org/Public/Bug/Display.html?id=132525 ) 02:58
AlexDaniel eval: spurt ‘sandbox/Foo.pm6’, ‘unit module Foo; sub foo is export { say 42 };’ 03:03
evalable6
AlexDaniel c: 2015.12,HEAD use lib ‘sandbox/’; use Foo; foo
committable6 AlexDaniel, ¦2015.12,HEAD(ae02bc2): «42␤»
AlexDaniel piojo: ↑
piojo: depends on what kind of precomp issue you're seeing (e.g. can you reproduce it with every run, or only on the first run?) 03:04
AlexDaniel eval: spurt ‘sandbox/MyModule.pm6’, ‘our sub get-array(--> Array[Pair]) { return my Pair @pairs; }’ 03:04
evalable6
AlexDaniel c: 2015.12,HEAD use lib ‘sandbox/’; use MyModule; MyModule::get-array 03:05
committable6 AlexDaniel, ¦2015.12: «» ¦HEAD(ae02bc2): «Could not find symbol '&get-array'␤ in block <unit> at /tmp/vyQheWsEH3 line 1␤␤ «exit code = 1»»
piojo eval: spurt ‘sandbox/MyModule.pm6’, ‘unit module MyModule; our sub get-array(--> Array[Pair]) { return my Pair @pairs; }’ 03:06
evalable6
piojo c: 2015.12,HEAD use lib ‘sandbox/’; use MyModule; MyModule::get-array 03:06
committable6 piojo, gist.github.com/b893b2be5f5bc343d3...b43b02641c
AlexDaniel awesome
piojo Huh, this never worked
AlexDaniel it did
look closely
c: 2015.12,HEAD use lib ‘sandbox/’; use MyModule; say MyModule::get-array 03:07
committable6 AlexDaniel, gist.github.com/e89da827024d2d9f12...ea3e57700b
AlexDaniel so, let's bisect 03:07
6c: 2015.12,HEAD use lib ‘sandbox/’; use MyModule; say MyModule::get-array
piojo AlexDaniel: oh, I was misreading the output. I've never used bisectable/committable before. 03:08
committable6 AlexDaniel, gist.github.com/936b29d5aba6c4c7e0...c4efb9a423
AlexDaniel piojo: using it like this is also new to me
ahhh
6c: use lib ‘sandbox/’; use MyModule; say MyModule::get-array
committable6 AlexDaniel, gist.github.com/86281d3cb838846f3b...2e3fd02b08 03:09
AlexDaniel ok so just bisect: should work
bisect: use lib ‘sandbox/’; use MyModule; say MyModule::get-array
bisectable6 AlexDaniel, Bisecting by exit code (old=2015.12 new=ae02bc2). Old exit code: 0
AlexDaniel, bisect log: gist.github.com/8d02a2cf2c1a32607e...0c49b48c27
AlexDaniel, (2016-02-11) github.com/rakudo/rakudo/commit/22...bccf1f08ed
AlexDaniel that doesn't look relevant 03:10
so we should probably double-check
c: 22b4ef05b1f^,22b4ef05b1f use lib ‘sandbox/’; use MyModule; say MyModule::get-array
committable6 AlexDaniel, gist.github.com/fe6c74fe514ade0118...d48d794706
AlexDaniel hm… that confirms it
piojo AlexDaniel: thanks for showing me how to do that!
But that's really not a commit I woud expect to cause this! 03:11
AlexDaniel piojo: heh, yeah, but it is (as confirmed above). sha^ gives a parent of that commit, and on a commit before there's no problem 03:13
AlexDaniel I think the issue comes from this line: + my Pair @arg-help; 03:13
and something in CORE.setting just goes crazy because of it? No idea actually
piojo AlexDaniel: Seems like I should do a more difficult bisect, manually applying 22b4ef05b to each revision and seeing if that can trigger the underlying problem 03:19
AlexDaniel piojo: sorry, what for? :) 03:20
piojo AlexDaniel: because it seems to me that 22b4ef05b isn't the real problem. It's more of a diagnostic tool. 03:21
AlexDaniel piojo: if you really want to, you can try reverting 22b4ef05b on HEAD
AlexDaniel piojo: and that will definitely make the problem go away 03:21
AlexDaniel piojo: and then, you can try changing “my Pair @arg-help;” to just “my @arg-help;” 03:22
and that'll probably make the problem go away, at least if my hypothesis is correct :)
piojo AlexDaniel: Do you have a more specific guess about what the underlying problem is that that change would help with? 03:22
BTW, the problem is also showing itself with Array[CustomClass], not just Array[Pair] 03:23
From where I stand, that commit is useful because it reveals a deep bug which may have other manifestations 03:24
AlexDaniel eval: spurt ‘sandbox/MyModule.pm6’, ‘our sub get-array(--> Array[Int]) { return my Int @pairs; }’ 03:26
evalable6
AlexDaniel c: 22b4ef05b1f^,22b4ef05b1f use lib ‘sandbox/’; use MyModule; say MyModule::get-array
committable6 AlexDaniel, ¦22b4ef05b1f^,22b4ef0: «[]␤»
AlexDaniel c: 2015.12,22b4ef05b1f^,22b4ef05b1f,HEAD use lib ‘sandbox/’; use MyModule; say MyModule::get-array
committable6 AlexDaniel, ¦2015.12,22b4ef05b1f^,22b4ef0: «[]␤» ¦HEAD(ae02bc2): «Could not find symbol '&get-array'␤ in block <unit> at /tmp/JUpgC8yueT line 1␤␤ «exit code = 1»»
AlexDaniel huh? :D 03:27
6c: use lib ‘sandbox/’; use MyModule; say MyModule::get-array
committable6 AlexDaniel, gist.github.com/921e695ee7b3732119...98652203b2
AlexDaniel bisect: use lib ‘sandbox/’; use MyModule; say MyModule::get-array
bisectable6 AlexDaniel, Bisecting by exit code (old=2015.12 new=ae02bc2). Old exit code: 0
AlexDaniel, bisect log: gist.github.com/f66026e29439175b55...3b31f3c75d
AlexDaniel, (2016-12-19) github.com/rakudo/rakudo/commit/4b...95a09a8e80
AlexDaniel ah 03:29
eval: spurt ‘sandbox/MyModule.pm6’, ‘unit module MyModule; our sub get-array(--> Array[Int]) { return my Int @pairs; }’ 03:30
evalable6
AlexDaniel c: 2015.12,22b4ef05b1f^,22b4ef05b1f,HEAD use lib ‘sandbox/’; use MyModule; say MyModule::get-array
committable6 AlexDaniel, ¦2015.12,22b4ef05b1f^,22b4ef0,HEAD(ae02bc2): «[]␤»
AlexDaniel piojo: so using Int instead of Pair is OK
piojo AlexDaniel: right, Int works. I haven't explored which types of classes show the problem. 03:31
the only big difference I see is that Int is (Cool) and custom types and pairs aren't 03:32
AlexDaniel piojo: I don't have an educated guess on why exactly it is behaving like this :) 03:33
piojo AlexDaniel: That's why I think a more labor-intensive bisect could help, if I can force the bug to reveal itself prior to the 22b4ef05 commit. Though that might not be possible if the code changed too much. 03:34
Geth doc: lefth++ created pull request #1699:
Describe how to look up class members
03:35
AlexDaniel piojo: not sure I understand. You have a non-intermittent bug and you know which commit caused it, what are you looking for now? 03:38
piojo AlexDaniel: are you suggesting a workaround for me, or a fix for the next rakudo release? If we changed this in rakudo, it seems like it would be sweeping a problem under the rug, and it could come back when a different core function uses a parameterized array. 03:47
Though the situation can be improved if I add a unit test for this
we can hope the next time this occurs, it will do a better job of illuminating whatever is wrong in nqp or moarvm
AlexDaniel piojo: am suggesting a rakudo fix, yes. Would be great to have tests that go over a bunch of types (not just Pair)
piojo AlexDaniel: my concern is just this: something is wrong with the type system, and 22b4ef05 did not cause it, since there's no error in that commit. I will try to find the underlying bug, and if I can't, I'm okay with a workaround 03:49
AlexDaniel piojo: ok, a way to do it would be to apply 22b4ef05 to some old revisions (e.g. 2015.12) and see if it breaks the same way there 03:55
piojo AlexDaniel: yes, that's my intention. It doesn't apply cleanly, so by-hand changes will be needed. I'm not sure whether it'll succeed, but it's worth the try. 03:56
thou \o Good evening 04:00
piojo AlexDaniel: thanks for showing me the module bisect, and for your tips on this :)
AlexDaniel piojo: sure, let me know if you have any other bisectable challanges :)
piojo Thanks!
perlbot chenyf pasted a new file at f.perlbot.pl/p/3jg9le -
thou Does anyone know if there's current activity refactoring Pod::To::* modules to use a common framework, and to fix outstanding [POD] bugs in Rakudo? I've been making some tweaks to Pod::To::Markdown, and am wanting to get rid of warts rather than paste over them.
thou There's a branch in Pod::To::HTML for example called autarch/use-pod-treewalker , and several other related attempts there. 04:00
AlexDaniel piojo: possibly relevant: github.com/rakudo/rakudo/blob/ae02...e.pm#L1-L2 04:00
thou A recent branch, emit-raw-HTML, is related to Rakudo's broken (IMO) implementation of Named blocks, and various Pod formatters are not coordinated on how to handle things. 04:00
It's suggested to make Pod part of the language braid to fix various parsing problems. That sounds very interesting to me!
AlexDaniel thou: tbrowder is working on some [POD] bugs in rakudo, perhaps you should talk to him 04:00
thou awesome, thanks
AlexDaniel thou: IMO almost anything POD-related is underdeveloped, so feel free to jump in and do some serious changes 04:00
Herby_ o/ 04:12
MasterDuke thou: i think moritz and DrForr and wander have all been talking about Pod::To::HTML recently 04:24
could try searching for "Pod::To::" at irclog.perlgeek.de/perl6/search and see what shows up 04:25
thou Thanks for that info! 04:31
explorer hi, does someone know if there is a library function to get the first Promise ~~ Kept but try all of them in case they all break? I have something, but I think it is a bit elaborate pastebin.com/DUV1X7Vf 04:43
Herby_ .tell ctilmes ++ on the advent article 04:47
yoleaux Herby_: I'll pass your message to ctilmes.
Herby_ dumb question but I really like the font and look of the code in gist.github.com 04:48
is it possible to get that font in Vim?
explorer I would guess you would need to change the font in your favourite terminal 04:51
AlexDaniel this is an awesome post indeed 04:51
ctilmes++
piojo Wow, this needs fixing: rosettacode.org/wiki/Determine_if_...ric#Perl_6 04:52
AlexDaniel piojo: what's exactly wrong with it? 04:55
Herby_ the new Advent of Code puzzle unlocks in about 5 minutes: adventofcode.com/
piojo My thought is that the real answer is: $_ !eq '' && try { $_ eq $_ }
AlexDaniel: it only works because <5> produces IntStr
m: say <4>.WHAT
camelia (IntStr)
piojo AlexDaniel: it fails on all real strings 04:55
piojo I'll fix it if the test try { $_ == $_ } is the right one. (Also, it needs to eliminate "" because "" is castable to a string) 04:56
Sorry, that's slower than needed 04:57
AlexDaniel piojo: what about ?($term ~~ /\d/) and ?$term.Numeric;
piojo AlexDaniel: Nice! I didn't realize .Numeric returned Failure 04:58
AlexDaniel piojo: why does it need ($term ~~ /\d/) check at all? 04:59
piojo still, I don't see why we need regexes for this
I didn't write it!
it just needs to check that the string isn't empty.
piojo oh, ?$term.Numeric fails for 0 05:01
AlexDaniel piojo: what about: defined $term.Numeric 05:02
or more explicit $term.Numeric !~~ Failure
explorer: not that I know of 05:03
piojo AlexDaniel: both seem fine. Is Str.Numeric being Failure part of the spec, or an implementation detail? 05:04
AlexDaniel piojo: part of the spec
piojo AlexDaniel: thanks, then that seems a solid and short solution :)
piojo m: say "\t".Numeric; # uh-oh 05:07
camelia 0
piojo m: say "½".Numeric; 05:08
camelia Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5½' (indicated by ⏏)
in block <unit> at <tmp> line 1
piojo m: say "1½".Numeric
camelia Cannot convert string to number: trailing characters after number in '031⏏5½' (indicated by ⏏)
in block <unit> at <tmp> line 1
piojo I don't disagree with that, actually. It seems like a source parse needs to be more thorough than a mere string conversion. 05:09
thou explorer, you could use .Supply and specify a :quit routine that does nothing
and Supply.grep() and .head() might help, too 05:10
AlexDaniel piojo: these are the tests: github.com/perl6/roast/blob/8da277....t#L83-L91
piojo: I wish it was tested more thoroughly, but maybe it is in other files 05:11
thou Or maybe :quit() doesn't work that way, I'm not positive....
AlexDaniel piojo: whitespace characters being turned into 0 is weird :( 05:12
thou hrm, looks like I jumped the gun on that solution, I didn't read .Supply() description clearly
piojo AlexDaniel: and 'i' and 'e' can be Numeric but not '½'. That seems inconsistent 05:13
No, my mistake
I wasn't using the string in that test
AlexDaniel m: react { whenever Supply.merge: (Promise.in(3), Promise.in(2))».Supply { say $_; } } 05:15
camelia True
True
AlexDaniel maybe something like this can be hacked to do what's needed? 05:16
m: react { whenever Supply.merge: (Promise.in(3), Promise.in(2))».Supply { done if $_; say ‘hello’ } }
camelia ( no output )
AlexDaniel m: react { whenever Supply.merge: (Promise.in(3), Promise.in(2))».Supply { say ‘hello’; done if $_ } }
camelia hello 05:16
AlexDaniel piojo: so that's why the regex check is there :) 05:17
piojo AlexDaniel: yep. But we're looking at this the wrong way: according to every other part of the test, this is a check about whether a string is a valid perl6 number. It's wrong to exclude '' as being a number 05:19
piojo If "1.3e+12" is a number, then "" should be considered a number as well 05:19
If the code were to detect integers and simply written decimal numbers, that would be a totally different test. 05:20
AlexDaniel uhhh I think I found some issue…
AlexDaniel huggable: 05:23
huggable AlexDaniel, nothing found
AlexDaniel huggable:
huggable AlexDaniel, nothing found
AlexDaniel huggable: gc
huggable AlexDaniel, nothing found
AlexDaniel huggable: force gc
huggable AlexDaniel, nothing found
AlexDaniel anyone remembers how to force gc?
m: use nqp; nqp::force_gc()
camelia ( no output )
AlexDaniel mch: for ^400 { my $x = 300.chr.Numeric; $=1 } 05:25
committable6 AlexDaniel, gist.github.com/522f5794fed3618f41...9b40d4da68
AlexDaniel bisect: for ^400 { my $x = 300.chr.Numeric; $=1 }
bisectable6 AlexDaniel, Bisecting by output (old=2015.12 new=ae02bc2) because on both starting points the exit code is 0
bisectable6 AlexDaniel, bisect log: gist.github.com/e796429812443838c7...a07c7b1788 05:25
AlexDaniel, (2015-12-29) github.com/rakudo/rakudo/commit/0e...28097cd28b
AlexDaniel mch: for ^10000 { my $x = 300.chr.Numeric; $=1 } 05:26
committable6 AlexDaniel, gist.github.com/370cfa2605da389369...a85545e994 05:26
AlexDaniel GH#1298 05:33
synopsebot GH#1298 [open]: github.com/rakudo/rakudo/issues/1298 GC is blowing up failures needlessly
piojo Can anyone think of a reason why a pair of strings is not being found in an array? 06:21
m: my Pair @array = ['47' => '4',]; say ('47' => '4') ∈ @array; 06:22
camelia True
piojo In a longer example, this same check is failing
When the array is constructed by "input.map( $_.map( given input.x.y { } )).flat 06:23
piojo Is there anything strange about a pair of ints that makes it not usable as a key in a set? 06:25
I mean a pair of Str
Geth doc: 9065949496 | (Alex Chen)++ | doc/Language/functions.pod6
Update functions.pod6
06:28
synopsebot Link: doc.perl6.org/language/functions
piojo m: my %data1 = ('4' => '47' => {}); my Pair @data-array = [%data1.keys[0] => %data1{%data1.keys[0]}.keys[0],]; say ('47'=>'4') ∈ @data-array; 06:30
camelia False
AlexDaniel m: my %data1 = ('4' => '47' => {}); my Pair @data-array = [%data1.keys[0] => %data1{%data1.keys[0]}.keys[0],]; say ('4'=>'47') ∈ @data-array; 06:34
camelia True
piojo m: my ($one, $two) = ('1', '2'); my Pair @data-array = [$one => $two]; say "Pair is in the list: " ~ so ($one => $two) ∈ @data-array; 06:38
camelia Pair is in the list: False
piojo Containers are breaking this!
m: my ($one, two) = ('1', '2'); my Pair @data-array = [$one => $two]; say "Pair is in the list: " ~ so ($one => $two) ∈ @data-array;
camelia 5===SORRY!5=== Error while compiling <tmp>
Invalid typename 'two' in parameter declaration.
at <tmp>:1
------> 3my ($one, two7⏏5) = ('1', '2'); my Pair @data-array = [$
piojo m: my (\one, \two) = ('1', '2'); my Pair @data-array = [one => two]; say "Pair is in the list: " ~ so (one => two) ∈ @data-array;
camelia Pair is in the list: False
piojo oh, that doesn't agree with my last test...
piojo AlexDaniel: there was another way I wrote it in which using sigilless variables made the test pass 06:39
but in the simplest version, that doesn't help
piojo 6c: 2015.12,HEAD my ($one, two) = ('1', '2'); my Pair @data-array = [$one => $two]; so ($one => $two) ∈ @data-array; 06:41
committable6 piojo, gist.github.com/fd5644d38b839e51dd...d406e08fcb
AlexDaniel 6c by itself is all releases 06:42
so either
c: 2015.12,HEAD my ($one, two) = ('1', '2'); my Pair @data-array = [$one => $two]; so ($one => $two) ∈ @data-array;
committable6 AlexDaniel, gist.github.com/831abdc41e417a4dc1...d6143de919
AlexDaniel or
piojo sorry, typo
AlexDaniel 6c: my ($one, two) = ('1', '2'); my Pair @data-array = [$one => $two]; so ($one => $two) ∈ @data-array;
piojo my ($one, $two) = ('1', '2'); my Pair @data-array = [$one => $two]; say "Pair is in the list: " ~ so ($one => $two) ∈ @data-array;
committable6 AlexDaniel, gist.github.com/6d4ecc23e13b08f0ac...ae13527927
AlexDaniel 6c: my ($one, $two) = ('1', '2'); my Pair @data-array = [$one => $two]; say "Pair is in the list: " ~ so ($one => $two) ∈ @data-array;
committable6 AlexDaniel, ¦6c (25 commits): «Pair is in the list: False␤» 06:43
piojo AlexDaniel: that means this never worked? 06:44
AlexDaniel where never = 2015.12 (first release supporting v6.c), yes 06:44
c: all my ($one, $two) = ('1', '2'); my Pair @data-array = [$one => $two]; say "Pair is in the list: " ~ so ($one => $two) ∈ @data-array; 06:45
piojo Is that because a =>b won't reliably equal a =>b due to Pair being a certain type of class?
committable6 AlexDaniel, gist.github.com/d882fd4eb666562d87...99d666708e
AlexDaniel “all” is all releases starting from 2014.01
( which is rarely useful, but sometimes you want to know :) ) 06:46
piojo m: my Pair @data-array = ['1' => '2']; say "Pair of literal strings is in the list: " ~ so ('1' => '2') ∈ @data-array;
camelia Pair of literal strings is in the list: True
piojo m: my ($one, $two) = <1 2>.map(*.Str); say so $one => $two === $one => $two; 06:47
camelia True
piojo m: my ($one, $two) = <1 2>.map(*.Str); say so $one => $two === '1' => '2'; 06:48
camelia True
AlexDaniel m: my ($one, $two) = (‘1’, ‘2’); my Pair @data-array = (‘1’ => ‘2’); my $p = ($one => $two); say $p.WHICH; say @data-array[0].WHICH; dd @data-array; dd $p; say $p ∈ @data-array 06:49
camelia Pair|69757440
Array[Pair] @data-array = Array[Pair].new("1" => "2")
Pair|Str|1|Str|2
False
Pair $p = "1" => "2"
AlexDaniel m: my ($one, $two) = (‘1’, ‘2’); my Pair @data-array = (‘1’ => ‘2’); my $p = (‘1’ => ‘2’); say $p.WHICH; say @data-array[0].WHICH; dd @data-array; dd $p; say $p ∈ @data-array
camelia Pair|Str|1|Str|2
Array[Pair] @data-array = Array[Pair].new("1" => "2")
Pair|Str|1|Str|2
True
Pair $p = "1" => "2"
AlexDaniel m: my ($one, $two) = (‘1’, ‘2’); my Pair @data-array = (‘1’ => ‘2’); my $p = (‘1’ => ‘2’); note $p.WHICH; say @data-array[0].WHICH; dd @data-array; dd $p; note $p ∈ @data-array 06:50
camelia Pair|Str|1|Str|2
Pair|Str|1|Str|2
Array[Pair] @data-array = Array[Pair].new("1" => "2")
Pair $p = "1" => "2"
True
AlexDaniel m: my ($one, $two) = (‘1’, ‘2’); my Pair @data-array = (‘1’ => ‘2’); my $p = ($one => $two); note $p.WHICH; say @data-array[0].WHICH; dd @data-array; dd $p; note $p ∈ @data-array
camelia Pair|79595008
Pair|Str|1|Str|2
Array[Pair] @data-array = Array[Pair].new("1" => "2")
Pair $p = "1" => "2"
False
AlexDaniel piojo: that's not cool :)
but maybe it makes sense?
hmmm… I don't know 06:51
piojo m: my $two = '2'; say '2' === $two; say ('1' => '2') === ('1' => '2'); say ('1' => '2') === ('1' => $two)
camelia True
True
False
piojo I'll post this on stackoverflow. thanks! 06:52
err, I need to read your output first :)
AlexDaniel m: say (‘1’ => ‘2’).WHICH; my $one = ‘1’; my $two = ‘2’; say ($one => $two).WHICH 06:53
camelia Pair|Str|1|Str|2
Pair|81741704
AlexDaniel piojo: ↑ here's the golfed version
piojo AlexDaniel: thanks, that explains it perfectly 06:57
piojo but it drives me mad that Pair can either have a static or dynamic WHICH depending on how it's defined 06:58
okay, "drives me mad" is an exaggeration
but it's troubling
piojo I thought I could either treat WHICH as a point in memory, or as a 1:1 description of the object, but not both for the same type of object! 06:59
piojo s/point in memory/object ID/ 06:59
AlexDaniel piojo: I think lizmat is our expert on whichcraft, perhaps that's who you should ping 07:04
piojo AlexDaniel: do you know if lizmat's background is c++? 07:06
piojo Since perl isn't turtles all the way down... 07:07
AlexDaniel I don't know, but there's a lot of perl foreground
piojo haha
Thanks
piojo .ask lizmat Would you say it's a bad idea to use Pair as a member in a Set (or check $pair ∈ @array)? Because it seems awkward that Pair.WHICH is sometimes static (Pair.new(1,2)) but sometimes dynamic (Pair.new($a,2)). The ambiguity makes causes hard debugging since $foo !== EVAL($foo.perl), but EVAL($foo.perl) === EVAL($foo.perl) 07:13
yoleaux piojo: I'll pass your message to lizmat.
AlexDaniel 👍 07:18
piojo stackoverflow user lisprogtor, are you me? 07:22
(stackoverflow.com/questions/476674...opertions)
buggable New CPAN upload: IRC-Client-Plugin-Github-0.1.5.tar.gz by TYIL cpan.metacpan.org/authors/id/T/TY/...1.5.tar.gz 07:23
thou .tell moritz In your Advent post, "matches" should be "fails" in this sentence: "A second call to keyval matches pretty quickly (in the call to key)." 07:29
yoleaux thou: I'll pass your message to moritz.
AlexDaniel piojo: “2 hours ago” seems to be you :D 07:40
piojo Faster than light. 07:45
DrForr o/ 08:40
lookatme ls
DrForr Desktop Music Repositories Videos 08:41
jast good thing someone else answered, my answer would have been 424 bytes of listing 08:42
DrForr Mine would have been that way too, and probably revealed private corporate data. I just pasted the bottom line though. 08:45
jast Movies bin ejabberd-17.08-rosterpatch.tgz messenger-fsm.dot.png userdotfiles.tgz 08:47
that's not too secret, I hope
DrForr Not now, anyway :) 08:58
lizmat piojo: The key of a Pair is always decontainerized, the value is not 09:31
m: Pair.new("a", my $ = 42) # you could argue that this is incorrect 09:32
camelia ( no output )
lizmat m: dd Pair.new("a", my $ = 42) # rather
camelia :a(42)
lizmat as it's the same output as:
lizmat m: dd Pair.new("a", 42) 09:32
camelia :a(42)
piojo lizmat: so a pair should not be considered a 2-tuple
lizmat it should
why do you say that ?
piojo I would expect it to treat the every value the same 09:33
but a k-v pair can treat the first element like a key
buggable New CPAN upload: Sparky-Plugin-Hello-0.0.1.tar.gz by MELEZHIK cpan.metacpan.org/authors/id/M/ME/...0.1.tar.gz
piojo lizmat: the basic problem is that I was getting bad results for: $pair ∈ @array 09:34
because $pair.WHICH isn't based on decontainerized values
that's not wrong, but I think it may be a trap. 09:35
lizmat well, then you shouldn't create your Pairs with containers
piojo lizmat: haha
lizmat m: say Pair.new("a", 42).WHICH # value type
camelia Pair|Str|a|Int|42
tbrowder o/ #perl6, can someone answer questions about scheduling an advent post on the perl6 wordpress site?
lizmat m: say Pair.new("a",my $ = 42).WHICH # container type
camelia Pair|57164056
DrForr I did it last night, ergo I'm an expert :) 09:36
(scheduled a post, that is)
piojo m: my $one = 1; my \decontainerized = $one; say decontainerized.WHICH; 09:37
camelia Int|1
piojo lizmat: is that the right way to remove a container? (Not that I'm necessarily going to store all the data without containers, but it's good to know how)
lizmat m: my $a = 1; say $a.WHICH # you could argue this is wron 09:38
camelia Int|1
lizmat piojo: you've made me realize we may need to reconsider Pair.WHICH 09:40
tbrowder ok, question 1: is the time shown in my display taken as my time zone (utc - 6) so i have to make the adjustments for midnight in utc? 09:41
lizmat piojo: need to be afk for an hour so, will get back to this
tbrowder i think the answer is yes so, for 8 dec post i need to schedule publishing on 7 dec at 1800 09:42
piojo lizmat: I'll be AFK then, but I'll log on later
tbrowder question 2: can i continue to edit the post, after scheduling, throughout its existence? 09:44
lizmat tbrowder: you can 09:45
afk&
tbrowder question 3: can the post’s title be safely changed if need be without losing the body?
tbrowder lizmat: thanks 09:46
DrForr I'd be wary of changing the title, that could affect permalinks.
moritz no, wordpress handles that fine
yoleaux 5 Dec 2017 23:16Z <DrForr> moritz: Scheduled Day 7 for Thursday 11:59 AM so we've got time for last minute critiquing.
07:29Z <thou> moritz: In your Advent post, "matches" should be "fails" in this sentence: "A second call to keyval matches pretty quickly (in the call to key)." 09:47
tbrowder ok, i feel better now, whew! i’ll post a link to my 8 dec post later today for any early criticisms. 09:48
DrForr Also, mine is ready and in the queue for 11:59 as mentioned above, feel free to change any settings. 09:49
moritz I'll change it to midnight, just so that the publication meta data matches the day in the title 09:53
DrForr: uhm, the post looks empty here :(
DrForr Huh? 09:53
moritz perl6advent.wordpress.com/?p=6867&...eview=true
that's the one, right? 09:54
DrForr Oh, no, you're off by one, I shared the wrong link.
post=6868
Let me delete the old one just so we dont' get confused.
moritz much better, thanks :-) 09:55
Geth doc: fluca1978++ created pull request #1700:
Fix readme
09:56
wander \o 10:42
tyil o/ 10:46
mscha % perl -E 'say "hello"; say "world";' | head -1 11:33
hello
% perl6 -e 'say "hello"; say "world";' | head -1
hello 11:34
Unhandled exception: Failed to write bytes to filehandle: Broken pipe
mscha Is that on purpose? It's kinda annoying. Most command-line utilities don't complain when you `| head -1` them. 11:34
DrForr I don't think it's intentional. 11:36
Not that I know where to look in the code or how to fix it or anything like that.
jnthn I think it's a result of SIGPIPE being ignored by default, which is in turn the result of fixing a bug where a spawned child process could bring down the spawning process also 11:38
See MoarVM commit 2c5974bc119384132 11:39
DrForr Also please do file a bug, at least others can weigh in on whether it's an issue or not, though I imagine it is one. 11:45
jnthn There's already an RT about this 11:48
mscha OK, thanks. I won't file a new bug report then. 11:50
jnthn Feel free to comment on the existing one. Also, patches very much welcome for anyone who can figure out how to solve the original issue without introducing this new one :) 11:52
*from anyone
Phlogistique I can't find the ":" of "foo.map: -> $i {...}" in the docs.perl6.org/language/operators page 12:07
there is an "infix :" but its description does not seem to match
am I looking at the wrong place?
moritz it's not an operator, it's method invocation syntax 12:08
Phlogistique ok.
I thought it was an operator, similar to haskell $
moritz I think it's similar in spirit, but not implemented as an operator 12:09
Phlogistique alright, thanks
jast it's documented here btw: docs.perl6.org/language/syntax#Subroutine_calls
moritz jast++ 12:10
jast and the link to 'Methods' is 404 ;)
also the link to 'Sub' 12:11
Geth doc: fluca1978++ created pull request #1702:
Fix slice table.
12:16
doc: 00b53b12f1 | (Alex Chen)++ | doc/Language/syntax.pod6
Fix broken link, jast++
12:18
synopsebot Link: doc.perl6.org/language/syntax
wander since we might merge classtut.pod6 with objects.pod6, it will be broken link some time :) 12:20
when write L<> tag in our doc, it will be better to use absolute location, like `/language/classtut#Methods`. although htmlify.p6 convert L<Class> to `/Type/Class`, but I think it makes htmlify logic mess while save(?) writer's time. 12:25
moritz wander: you can add redirects in html/.htaccess for moved/renamed pages
wander see :) 12:26
buggable New CPAN upload: Sparky-Plugin-Hello-0.0.2.tar.gz by MELEZHIK cpan.metacpan.org/authors/id/M/ME/...0.2.tar.gz 13:13
buggable New CPAN upload: Sparky-Plugin-Notify-Email-0.0.1.tar.gz by MELEZHIK cpan.metacpan.org/authors/id/M/ME/...0.1.tar.gz 14:43
piojo_ lizmat: I was just thinking that if we had an :eqv adverb for set operations and the ∈ operator, it would solve a lot of problems 15:13
Because there are times when you know your objects are equal, and times when you know the operation should work based on a looser type of equality
piojo_ lizmat: I also noticed lists aren't that different from pairs: they can also surprise about when .WHICH is a repeatable value versus dynamic. 15:16
m: say ('a').WHICH; say ('a', 'b').WHICH;
camelia Str|a
List|61131552
15:17
timotimo if you go with an equality function, you're suddenly going far up in complexity cost of operations
checking for presence of a single item in a set is amortized O(1), but if you have an equality function, you have to check against every entry of the set, which is O(n)
if you want to get the union or intersection or whatever of two sets, you're looking at O(m*n) instead of O(m+n) 15:18
piojo_ ‎timotimo: good point.
piojo_ Still, $elem ∈ @array is O(n) either way 15:19
But we care about more than that one case.
comborico1611 Have you guys check out my article in the Perl 6 Advent calendar? 15:54
!
DrForr Yep, read it this morning. 15:55
comborico1611 Ah! 15:58
That's exciting.
scimon Not sure why an intro to programming book needs to cover the Principle of Least Privilege. I mean... I had to go look it up just now. 16:14
But I am not one to talk. I've still got to write my article. Working on it. 16:16
DrForr Mine's coming up tomorrow... 16:17
I've been doing programming for the last 25+ years and I think this is the first time I'v heard of Principle of Least Privilege. Not being critical, but curious. 16:18
Oh, that. Yeah, that makes perfect sense, maybe it just needs to be restated differently. 16:20
scimon Meanwhile I'm getting my head around WHICH and putting Objects in Sets. Which is fun. 16:21
comborico1611 It may not be known by that name, but what is it commonly called? 16:23
(speaking of principle of least privilege) 16:24
scimon It's a good name it's just... It's not something I think you need to know when you're initially learning to code. IMO. 16:25
tbrowder comborico11: i scanned it—looks like some good thoughts 16:30
DrForr I find that starting without typing and adding typing later on is a great approach. You can get very deep into typing, some languages like ML and Haskell rely on it. 16:51
perlpilot As a corollary to that I guess, we have some code at $work where the author came from a Java background and put type constraints on everything and over the last several months we've been removing type constraints where they were over-zealous because it was causing problems as things were refactored or new features were added. 17:06
so, yeah, starting with minimal types and adding as-needed is the way to go.
Ulti Id say type distracts a lot from whats more important to learn starting out in programming, it puts people in the mindset programming is about correct syntax and boiler plate than solving real problems and they run into immediate frustration a number isnt just a number etc. 17:18
comborico1611 Thanks, tbrowder! 17:20
comborico1611 perlpilot, interesting. I should have added more language in the article that spoke to my preference that are programmers first language captures most of the other languages, in case they decide to move on to a different language it will be an easy transition. But I definitely learned something from your remark just now. 17:22
comborico1611 That a programmer's first* 17:23
comborico1611 Ulti, good point. I think your comment speaks to what I call Computer scientists in my article. 17:24
Ulti on twitter there was a nice example between python and perl6, reverse the order of digits in a number P6 1234.flip Py int(str(1234)[::-1]) I know which of those two is easier to teach to someone without having to get into what type is immediately
comborico1611 It is a balance between quickly being able to do something versus understanding how computer programs work. 17:25
perlpilot comborico1611++ for the advent article btw. My only suggestion would be to shorten the next one ;)
Ulti comborico1611: its more different languages pick different abstractions of how programs work, none of it is how a computer works 17:26
comborico1611 Haha. My wife said the same.
Ulti even assembly now isnt how a CPU works
comborico1611 Ulti, true. But some programming languages do much better at that than others.
Ulti given the whole thing is running a unix on the inside with a web server...
comborico1611 perlpilot, I really had to go into the details of the book review because I didn't want to just say things and not have it backed up, and I already done the work of meticulous notes. 17:27
And I felt I really had to explain how I'm not like most computer programmers. If you can even consider me a computer programmer. 17:28
Ulti if you tell computers who's boss you are a computer programmer 17:29
comborico1611 heh
Ulti I think writing a blog post about programming probably qualifies you fairly immediately
comborico1611 But you're welcome, perlilot, it was a good opportunity to be able to right such an article for you all. 17:30
Haha, you kid.
Ulti no really
perlpilot comborico1611: I agree with Ulti here.
Ulti the idea of someone having imposter syndrome about being a programmer is kind of fun 17:31
comborico1611 Heh. Time will tell if i am. 17:32
Ulti someone should make a webpage where you accidentally write a program on the landing page to a test to find out if you're a programmer and you just immediately pass
perlpilot I've known many people who primarily identify as "journalist" or "scientist" or "mathematician" or "geographer" or "surveyor" or "physicist" .. etc. who are nevertheless "computer programmers"
It's just that they come at programming from a different need or mindset than those you'd call "CS types" 17:33
comborico1611 I see. That makes sense. 17:34
perlpilot In fact, even though I got a degree in CS, I think I know more people who are *not* CS types, but are still programmers.
comborico1611 The real interesting part is that I want to master computer networking. I wonder how that looks for someone who is not the C S type. 17:39
I think it was moritz I told me a few weeks ago that he knows people that are really good at networking that don't program that much.
Who told me* 17:40
moritz yes. They know all about BGP, routing, VPLS and that stuff 17:41
comborico1611 The routing algorithms were tough for me. I skipped them... 17:42
Did you read my article, moritz?!
comborico1611 You, and that Brian d foy guy, and lawrence, are the target our audience. 17:43
Ulti I mean people working from sockets consider that network code too though
Ulti application level protocols you dont need to be down and dirty with union types inspecting packets 17:44
moritz comborico1611, did you read my book? :-) 17:52
comborico1611: I've read parts of your article, but not all
comborico1611 Haha. Nope. But my article is free. Haha 18:04
Thanks!
I don't expect you to. I'm just curious if you did. I guess I should wait for people to comment first.
hahainternet is there a way to use non string keys for a hash in a way that doesn't require overriding the WHICH method? for example, lists? 18:38
timotimo subclass the hash and implement the stuff there? :S 18:44
hahainternet timotimo: :/ that is a bit of a wart 18:46
looks like it'd be better to define custom list type and make it a 'value type' by p6's defs?
timotimo that's also possible, but i thought that falls under "overriding the WHICH method" 18:47
[Coke] what's wrong with the existing non-string-key hash variant?
hahainternet [Coke]: it uses ===, and so (1,2,3) === (1,2,3) is false 18:48
timotimo: ah, yeah my fault for constraining that
i should have asked for the nicest way, ideally not overriding WHICH
timotimo time to bring parcel back %) 18:49
hahainternet doesn't get it ☺
timotimo it was a thing that existed before the GLR
think of it as "lazi decision whether to flatten or to structurize listy things"
hahainternet roger 18:50
well i would throw a vote behind immutable lists testing equality based on values
ie 'value types'
but i don't know what issues that would cause
and i'd appreciate advice on the best way to implement my own type
MasterDuke hahainternet: you couldn't use a set instead of a list?
timotimo List is doing double-duty for lazy lists as well, so there'd have to be a lot of care taken with regards to WHICH on lazy lists vs fully reified lazy lists etc 18:51
hahainternet MasterDuke: the same issue occurs doesn't it?
hmm, apparently not
lists and sets are unfortunately not synonymous
perhaps a Tuple type? ;)
timotimo yeah, sets are lists minus ordering and multi-containering
DrForr waves at MasterDuke 18:52
hahainternet i assume i should be able to construct this as List but Tuple or similar if my Tuple type implements WHICH based on values? 18:54
MasterDuke DrForr: hello hello. btw, do you know if your talk is online yet? since i got in late i missed it
DrForr Dunno. 18:55
DrForr Let me check. 18:55
timotimo hahainternet: and take extra care to decontainerize everything and anything that comes in
timotimo and not allowing anything mutable in it 18:56
hahainternet the mutable part is certainly important
but as long as i called WHICH on any container, that should be fine right?
i suppose given it returns basically plaintext
that's not safe
timotimo well, if you want to have something compare truthfully against something you put into a hash, you'll have to be able to produce the same WHICH
DrForr I don't see 2017 up at all yet. 18:57
It wsn't much of a talk; I was on early enough that I just did a brief routine and then got some audience participation going.
hahainternet interesting that sets seem to encode their contents in some form
-> Set.pm 18:58
(in calls to WHICH i mean)
timotimo it's a sha1 hash
hahainternet roger, i shall adopt the asme
as that is safe
timotimo zefram found a million different ways to create things that are very much not the same, but have the same WHICH
basically WHICH-injection attacks :)
hahainternet indeed, which is quite a serious issue 18:59
but hashing the contents makes perfect sense
and is what's used elsewhere safely, so that answers my q
lizmat FWIW, I would be in favour of List.WHICH as a value type if it doesn't have any containers 19:03
[Coke] what's wrong with the existing non-string-key hash variant? 19:06
(oops)
lizmat ? 19:07
hahainternet lizmat: can you elucidate on the issue with containers? couldn't it 'simply' call WHICH on them also and hash them?
lizmat hahainternet: what we don't want is that the .WHICH of an object changes over the lifetime of the object 19:08
hahainternet ah, so it should be memoizable etc
i'm with you
lizmat if you would call .WHICH on it like that, you would be able to change either the content of the object without .WHICH changing (it being memoized) 19:09
lizmat or change .WHICH if it was not memoized 19:09
either one of those are bad
hahainternet roger, it's semi irrelevant for my use case at the second but i understand why it's an issue now
hahainternet i would say a Tuple type or similar would be a good match there, a List which cannot store containers? I don't know the fine grained details though ☺ 19:10
lizmat now, List.WHICH not having a value type .WHICH is really an optimization issue
DrForr Design question - I'm doing a rewrite of Pod::To::HTML so that it can hopefully be subclassed. The core is an object tree of Pod::Heading.new( :content(Pod::Item.new(...)) and so on. I'm writing one multi method visit(Pod::Item $node){} per class that Pod::To::RawHTML's children can subclass and pervert at will. Short of trying to injet a 'walk' method into the Pod::* class hierarchy, is there a better way to do what I"m after? 19:21
It's not too fragile in that I can have a multi method visit( $node ) {} that catches stuff I'm not aware of, but I"m ondering if there's a better way. 19:25
hahainternet seems i can't use 'but' as it creates some sort of implicit middle type with its own WHICH implementation 19:26
geekosaur that's its purpose 19:32
it's generating a class on the fly with the lhs's type and the rhs's type mixed in 19:33
timotimo i believe most which implementations will put their type name (longname?) in the beginning 19:34
and mixing in something will influence the type's name
m: say (1 but "foo").^name
camelia Int+{<anon|64479952>}
lizmat DrForr: that feels like an iterator to me ? 19:35
DrForr Ah, right, thanks for the reminder.
DrForr I'll do it this way then switch over... 19:36
hahainternet geekosaur: yeah understood, i was hoping i'd be able to override things on it 19:38
defining a proper class seems sufficient though
geekosaur yes
'but's the quick and dirty one, if you need more control then you need to make the mixin yourself 19:39
(although in fact you can use it to make behavior changes. x but { method x { ... } } iirc
it's just annoying enough that you;re usually better off making a real mixin class 19:40
thou DrForr, have you looked at this branch in Pod::To::HTML? github.com/perl6/Pod-To-HTML/tree/...od/To/HTML 20:00
yoleaux 05:26 MST <tbrowder> thou: can you list the pod bugs you need to have fixed?
DrForr No, I hadn't. And that's about what I was looking for. 20:01
thou++ 20:02
thou DrForr, I'm maintaining Pod::To::Markdown, I'm hoping to rewrite based on Pod::TreeWalker 20:03
thou I'd like to rewrite all of them w/ common underlying framework 20:03
hahainternet so i'm running into a problem in experimenting with this in that I can't find a way to build a class that `is List` that can be constructed without replacing each list element with a scalar container 20:04
i hope that is clear, it's tricky to know how to explain it
DrForr fires of a 'git clone'... 20:06
*off
El_Che it's not that bad, don't burn it
git revert will do :)
thou tbrowder, I'm especially concerned with 114480, and the recently-"fixed" =Html as raw HTML changes, and Pod::Block::Named in general is not right, IMO. The Pod::Raw is what named blocks are supposed to be for. The things that are currently called named blocks shouldn't be, e.g. the current Pod::Block::Named with .name 'para' should be a normal Block::Para (core should join the lines together for us, that shouldn't be something Pod formatters are handling!). 20:09
tbrowder, I'm basing my "should" language on what S26 says, as I *love* S26 in all ways and think it's a flawless design which can never be improved upon. 20:11
Or, at least, the status quo is certainly no improvement on S26. Hopefully I can get assent on that much. ;-) 20:12
DrForr, there's a couple older branches in there attempting the same thing. I haven't dug into them, but Pod::TreeWalker is fairly complete. There's also an old branch of docs that uses autarch's Pod::To::HTML branch. It has a subclassed renderer IIRC that you might find interesting. 20:15
DrForr If you're woring with Pod::TreeWalker I'm happy with starting with that as a basis.
*working 20:16
hahainternet so from what i can tell, the | operator will change list contents into scalar containers of their content for all the invocations i have tried
including Captures, which is a bit odd
DrForr I admit I'm a touch surprised yet gratified to see autarch doing P6 work, helps ratify things a bit. 20:17
thou So far I don't have anything worked up, I've just been exploring the universe of what's been done. I wanted to reach you / tbrowder / wander / whoever before forging ahead. 20:18
thou 'tis stale for 2 years, but I agree I was pretty happy. He wrote a nice blog post around that time saying that he was enjoying working with it. 20:18
DrForr Good to know. I've been thinking of making a clean break from the current Pod::To::HTML because the existing code is pretty much impossible to subclass. 20:19
thou And apparently got a new job shortly after, ...
MasterDuke dpk: you run yoleaux, correct? it dropped from #perl6, #perl6-dev, and #moarvm 20:59
dpk fixed 21:00
it's been doing that a lot lately. dunno why
it's supposed to restart automatically when it loses connection
MasterDuke dpk: cool, thanks
thou advent admins: it may be considered LTA to have an unanswered question from 2009 as the only comment on perl6advent.wordpress.com/about/ ? I think it'd be ethical to remove that comment, and would improve user experience IMO. 21:14
Also, I guess it is a reasonable question to have answered on the About page, too. :-D 21:15
tbrowder thou: i’ve taken a look at RT #114480 and a possible solution with what we have now with no grammar change, just all in src/Perl6/Pod.nqp and src/core/Pod.pm. It would invove adding attrs to the Perl 6 Pod::Block::Table class and could be backwardly compatible if need be. Otherwise, I would make each cell a pod formatting class.
synopsebot RT#114480 [open]: rt.perl.org/Ticket/Display.html?id=114480 [POD] Pod table cell contents should be parsed as para
thou tbrowder, I think incremental improvement is good. I am interested in making grammar fixes, but (especially if I'm doing it) those can take longer to work out. 21:17
hahainternet so, it seems that if you use a slip in List.new() it will containerise every element of that list, the only obvious reason i can see is perhaps that List's new Signature is **@things, and I believe that is coercing the slip (or Capture) to an array, enforcing the containers 21:18
tbrowder But before any of that happens I would like to see LLfourn’s PR merged (PR #651) to simplify twines 21:19
hahainternet when a function takes a capture, that doesn't seem to happen, although i don't know if captures destructure embedded lists 21:22
but i'd like some comment on whether this is correct behaviour, as it's certainly surprising
OVH seems to be having proper internet issues too so apologies if i don't reply promptly if anyone wants to comment 21:23
thou I've been thinking about creating a facade, maybe in userspace (i.e., Pod::TreeWalker, Perl6::Pod, or something) that takes the current parse and munges it with whatever hacks needed. E.g., to fix my pet peeve about named blocks, it would rewrite ::Named objects to ::Para or ::Heading or whatever is appropriate, etc. Then the user-facing tools (Pod::To::HTML, etc.) could be rewritten to use the facade whenever, and then as the grammar is fixed the facade 21:24
can be reduced until eventually it's just passing everything through. That would enable gradually fixing the parsing without breaking stuff too much, maybe. It sounds kind of baroque to describe it but I think it could be doable.
perlpilot thou: "as the grammar is fixed"? you're an optimist ;) 21:25
thou Well, I see I opened 114480 5 years ago, and now tbrowder has a fix planned, so it seems like I have good reason for my optimism! 21:27
DrForr gets a skeleton together for the new BlogspotHTML parser. 21:28
s/parser/walker-and-generator/
thou cool 21:29
DrForr 'end' "events" don't seem to be firing. 21:33
DrForr Ah, nm, 'start' needs to return True. Probably useful for something. 21:38
thou tbrowder, is PR #651 in progress still? 21:42
thou DrForr, yes, it's like `find ... -prune`, to skip chunks of Pod that you're not interested in 21:43
DrForr Ah, right, chidren in a heading, that sort of thing. 21:44
*children
tbrowder thou: it looks like it stalled, but should be fixable. i haven't talked to anyone about it except to make a comment there.
moritz \o 21:45
thou So it likely needs merged into current and spectest updates, at the very least.
moritz it looks like the regex+grammar book is being release right now 21:46
proof-readers are getting their ebook copy now
and www.apress.com/us/book/9781484232279 lists it as available (though a commenter on the p6 advent thread mentioned it disappears later in the checkout process)
thou congratulations! 21:47
El_Che moritz: nice to hear
tbrowder anyone having trouble with Zoffix's advent highlighter?
El_Che moritz: finished your previous book today
tbrowder I keep getting exceptions and am about to go back to the original one.
moritz ... and github.com/apress/perl-6-regexes-and-grammars/ is live (source code examples)
DrForr tbrowder: Did yesterday with either timeout or socket fail. 21:48
moritz El_Che: that's nice. Please write a review on amazon! :-)
El_Che moritz: I will
moritz tbrowder: thanks
tbrowder moritz: for...?
timotimo tbrowder: will you tell us what kind of exceptions you're getting? 21:50
moritz sorry, meant thou :-)
mis-tab-completed 21:51
tbrowder www.irccloud.com/pastebin/Nf7DvjGl/
thou ;)
tbrowder i've upgraded or forced install of all the modules mentioned. my src file isn't in pretty form which could be the problem i guess. 21:52
tbrowder i have the github gist auth token defined in the required env var 21:53
timotimo did you look ta the gist it made? 21:55
hahainternet hey timotimo, got a second?
timotimo hahainternet: i'll be a bit distracted, but maybe i'll be able to help 21:55
what's up?
hahainternet nevermind, lizmat just fixed it lol
tbrowder no...
hahainternet timotimo: github.com/rakudo/rakudo/commit/d8...4122802698 21:56
lizmat: many thanks ♥
timotimo cool
hahainternet sorry to bug you, you authored the original line at issue you see 21:57
timotimo gist.github.com/tbrowder/5b639366a...28465d93e1 - tbrowder does that ring any bells?
tbrowder yep--i think the code is too ugly to handle at the moment...i'll report later if i have any trouble after clean up 21:58
timotimo which one was the line you stumbled upon ooc?
hahainternet timotimo: the method signature 21:59
timotimo i was much less smarter then ... 22:02
Morfent how come i can call idn2_to_ascii_8z(''), but trying to call idn2_to_ascii_8z('', 0) or idn2_to_ascii_8z('', 0, $code) throws X::Multi::NoMatch? hastebin.com/bogiqapepu.pl 22:03
timotimo does it get better if you make the proto's signature Str, $?, $? or something? 22:06
Morfent nope 22:07
timotimo and without a proto entirely? 22:08
Morfent Cannot use 'our' with individual multi candidates. Please declare an our-scoped proto instead 22:09
timotimo ah
ok, can you try "is export" instead of "our proto"
i.e. no "our" in front of the multis, either
tbrowder timotimo: looks like this line which was not within code brackets: "===SORRY!=== Cannot iterate object with P6opaque representation" 22:11
thou multi sub idn2_to_ascii_8z(Str $input, int32 $flags) {
("in:", $input, " flags:", $flags).gist;
}
say idn2_to_ascii_8z('HI', 0);
^ That fails, but remove 'multi' and it succeeds 22:12
with multi, Int works, but int32 doesn't 22:13
hahainternet lizmat: the behaviour seems the same to me after doing `rakudobrew build moar d80df073ada4d4bc3e32afc2d11f974122802698` 22:16
i'll see if i can figure out what i'm doing wrong tomorrow, thanks for looking though! 22:17
guess i should add a test
lizmat yes, pls :-)
tbrowder timotimo: even within ``` the line causes a failure.
Voldenet well, that's because Int isn't int32
m: multi sub idn2_to_ascii_8z(Str $input, int32 $flags --> Str) { "" }; idn2_to_ascii_8z("", 0); #fails 22:18
camelia Cannot resolve caller idn2_to_ascii_8z(Str, Int); none of these signatures match:
(Str $input, int32 $flags --> Str)
in block <unit> at <tmp> line 1
Voldenet m: use nqp; multi sub idn2_to_ascii_8z(Str $input, int32 $flags --> Str) { "" }; idn2_to_ascii_8z("", nqp::unbox_i(0)); #works
camelia ( no output )
DrForr There, did a subclassable renderer for the NAME, AUTHOR &c tags.
Zoffix hahainternet: along with lizmat's fix, you.d need `List.new: |@a.List` or `List.new: |@a».<>` 22:21
Morfent ah there we go 22:22
thanks thou
Zoffix Morfent: thou: Ints automatically get downgraded to int32 (or other natives) only for `only` routines. For multies, the match need to be exact (you'd need to pass a native to natives). So you'd either need an `Int` candidate or call with `idn2_to_ascii_8z('', my int32 = 0)` 22:23
hahainternet Zoffix: sorry i was getting some food, i am already doing that :)
the problem is that the list becomes containerised
Zoffix `idn2_to_ascii_8z('', my int32 $ = 0)`, I mean
hahainternet: for which code?
thou thanks, Zoffix++
hahainternet Zoffix: List.new(<1 2 3>».Int) or similar exhibits it
sorry i have to eat this before it gets cold, i'll be around briefly afterwards if i can help to resolve this 22:24
it seems using a capture works, but i don't know nqp well enough to help there
Zoffix hahainternet: you don't need ».Int part on it. You don't have containers in the first place and that will create a List with a single item in it: the other list 22:24
hahainternet Zoffix: i think i've tried every combination, so an example would be superb :) 22:25
Zoffix hahainternet: you're missing the slip
hahainternet: not sure what example to use, considering the code you showed above doesn't need a List.new 22:26
hahainternet m: say List.new(|<1 2 3 4>)[0].VAR.^name 22:27
camelia IntStr
hahainternet interesting
i get a different result locally
Zoffix hahainternet: did you build lizmat's commit?
hahainternet i thought so
Zoffix hahainternet: perl6 -v 22:27
hahainternet i specified it to build moar, but i guess i'll go off and build it indivdualy
2017.10-4-g4fca94743 22:28
so i guess not :/
Zoffix hahainternet: that's over a month old
hahainternet yes, i guess rakudobrew did not switch correctly
Zoffix hahainternet: you didn't switch
It doesn't switch automatically, unless you just re-do `rakudobrew build moar` to re-build the head 22:29
hahainternet Zoffix: seems if you do 'build moar commitid' then do 'switch moard-commitid' it will say it is switching, but do nothing :) 22:29
that solves why that's happening though at least
doing a self-upgrade atm just in case 22:30
Zoffix hahainternet: works fine for me. Do you even need multiple versions of rakudo tho?
hahainternet Zoffix: probably not, moar-blead or just moar for including lizmat's commit?
hahainternet or just moar commitid? 22:30
Zoffix hahainternet: just moar 22:31
huggable: sauce
huggable Zoffix, Install untested latest development version of Rakudo from source: github.com/zoffixznet/r#table-of-contents
Zoffix hahainternet: ^ or you can toss rakudobrew altogether and not deal with its quirks 22:31
hahainternet roger that, thank you
Zoffix hahainternet: anyway, that will fix `List.new(|<1 2 3 4>)[0].VAR.^name` for you. But that'd fail for very large lists 22:32
m: List.new: |(^10_0000)
camelia Too many arguments in flattening array.
in block <unit> at <tmp> line 1
Zoffix hahainternet: so you should consider coersing some other way. Like, just use .List coercer instead of List.new
m: (^10_0000).List
camelia ( no output )
Zoffix But as I've said, <1 2 3 4> is already a List. Not sure why List.new is needed.
hahainternet Zoffix: this was originally about creating a subclass that 'is List' but has a WHICH behaving as a value type 22:33
and degenerated into finding why suddenly my list was full of containers
Zoffix Ah
OK.
Zoffix &
hahainternet that limit in flattening above seems exceedingly strange 22:35
i'd like to read why that's a thing 22:36
timotimo you mean "too many arguments in flattening argument list"? 22:38
hahainternet yeah, it seems like it means you can't really construct anything analogous to a list 22:39
tbqh it seems stranger than that, because why would there be an arbitrary limit on list flattening? 22:40
timotimo because of how arguments are passed
MasterDuke it's not really a limit on how big a list can be flattened (i believe), but on how many arguments can be passed to a function 22:41
timotimo m: say(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1) 22:42
camelia 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
timotimo hm, that's enough
mspo 1, damn it!
hahainternet so i don't mean to sound negative, but doesn't that mean 'is List' can't actually work, as if your list is long enough, you can't construct your new type? 22:44
perhaps it just means you can't use the default List constructor :/
jnthn You can use .from-iterator instead 22:51
jnthn Which, I'd hope, respects subclassing 22:53
timotimo m: say [//] 1 xx 100000
camelia 1
timotimo m: say [//] 1 xx 10000000
camelia 1
timotimo ISTR that also gave the "too many items in flattening list" error at one point
bisect: say [//] 1 xx 100000
bisectable6 timotimo, On both starting points (old=2015.12 new=d80df07) the exit code is 0 and the output is identical as well
timotimo, Output on both points: «1␤»
timotimo OK!
jnthn In general, though, avoid flattening huge numbers of arguments.
timotimo well, for other ops maybe
timotimo but then we got [+] special-cased 22:54
jnthn It's a sure-fire way to make sure things will run slow.
lizmat what's the idiom again to mix in an attribute into an existing object and assign a value to that attribute in one go ? 23:02
jnthn $obj does RoleName($value) 23:05
lizmat jnthn++ 23:05
comborico1611 What does the ++ do? 23:10
lizmat increases karma for jnthn on an imaginary karma keeper
tbrowder .tell timotimo the old advent md2html from Zoffix seems to do fine.
yoleaux tbrowder: I'll pass your message to timotimo.
comborico1611 Oh. Thanks! 23:11
lizmat sleep& 23:12