Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-12-06

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:15 mson joined #perl6
00:17 lookatme joined #perl6
00:17 lookatme o/
00:28 Cabanossi joined #perl6
00:35 mniip joined #perl6
00:38 mcmillhj joined #perl6
00:47 BenGoldberg joined #perl6
00:48 Spock2428 joined #perl6
00:49 cdg joined #perl6
00:52 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" ;)
00:54 patrickz joined #perl6
00:54 perigrin I look forward to  your excellent blog post about the trials and tribulations of getting it working
00:55 * perigrin runs away and hides
00:55 BenGoldberg Ha, that's waaay beyond my skill level!
00:56 BenGoldberg 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:58 Cabanossi joined #perl6
00:58 perigrin so one of the hiccups is that android doesn't use the JVM
00:59 evalable6 joined #perl6
01:01 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:08 cpage_ joined #perl6
01:16 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:19 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:20 kitsunenokenja joined #perl6
01:21 cdg joined #perl6
01:27 ctilmes joined #perl6
01:28 Cabanossi joined #perl6
01:28 pilne joined #perl6
01:32 lookatme sacomo, what do you mean, a singleton ?
01:33 lookatme And I think self is can only using inside class . :)
01:34 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 sacomo I could be wrong though. I am usually wrong.
01:35 jeromelanteri joined #perl6
01:35 lookatme m: class Foo { method bar() is export { } }; say ::.keys
01:35 camelia rakudo-moar ae02bc299: OUTPUT: «($=pod $_ $/ !UNIT_MARKER $=finish EXPORT Foo $! ::?PACKAGE GLOBALish $¢ $?PACKAGE)␤»
01:38 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 rakudo-moar ae02bc299: OUTPUT: «25␤True␤»
01:38 Actualeyes joined #perl6
01:38 lookatme sacomo, works ^^
01:40 sacomo hmm
01:46 someuser joined #perl6
01:46 someuser_ joined #perl6
01:47 mcmillhj joined #perl6
01:55 AlexDaniel joined #perl6
01:58 bisectable6_ joined #perl6
01:58 bisectable6 joined #perl6
02:02 ryn1x joined #perl6
02:02 mcmillhj joined #perl6
02:14 ZzZombo joined #perl6
02:23 mcmillhj joined #perl6
02:28 Cabanossi joined #perl6
02:29 cpage_ joined #perl6
02:36 piojo Is there any way to use bisectable to test precompilation problems?
02:57 ilbot3 joined #perl6
02:57 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
02:58 piojo But I still can't test it with a single file. The error doesn't happen. (I already reported it as https://rt.perl.org/Public/Bug/Display.html?id=132525 )
03:01 cpage_ joined #perl6
03:03 AlexDaniel eval: spurt ‘sandbox/Foo.pm6’, ‘unit module Foo; sub foo is export { say 42 };’
03:03 evalable6 AlexDaniel, rakudo-moar ae02bc299: OUTPUT: «»
03:03 AlexDaniel c: 2015.12,HEAD use lib ‘sandbox/’; use Foo; foo
03:03 committable6 AlexDaniel, ¦2015.12,HEAD(ae02bc2): «42␤»
03:03 AlexDaniel piojo: ↑
03:04 AlexDaniel 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 yoleaux joined #perl6
03:04 AlexDaniel eval: spurt ‘sandbox/MyModule.pm6’, ‘our sub get-array(--> Array[Pair]) { return my Pair @pairs; }’
03:04 evalable6 AlexDaniel, rakudo-moar ae02bc299: OUTPUT: «»
03:05 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»»
03:05 pew_ joined #perl6
03:06 piojo eval: spurt ‘sandbox/MyModule.pm6’, ‘unit module MyModule; our sub get-array(--> Array[Pair]) { return my Pair @pairs; }’
03:06 evalable6 piojo, rakudo-moar ae02bc299: OUTPUT: «»
03:06 piojo c: 2015.12,HEAD use lib ‘sandbox/’; use MyModule; MyModule::get-array
03:06 committable6 piojo, https://gist.github.com/b893b2be5f5bc343d3abb8b43b02641c
03:06 AlexDaniel awesome
03:06 piojo Huh, this never worked
03:06 AlexDaniel it did
03:06 AlexDaniel look closely
03:07 AlexDaniel c: 2015.12,HEAD use lib ‘sandbox/’; use MyModule; say MyModule::get-array
03:07 committable6 AlexDaniel, https://gist.github.com/e89da827024d2d9f12c354ea3e57700b
03:07 AlexDaniel so, let's bisect
03:07 AlexDaniel 6c: 2015.12,HEAD use lib ‘sandbox/’; use MyModule; say MyModule::get-array
03:08 piojo AlexDaniel: oh, I was misreading the output. I've never used bisectable/committable before.
03:08 committable6 AlexDaniel, https://gist.github.com/936b29d5aba6c4c7e0e1f8c4efb9a423
03:08 AlexDaniel piojo: using it like this is also new to me
03:08 AlexDaniel ahhh
03:08 AlexDaniel 6c: use lib ‘sandbox/’; use MyModule; say MyModule::get-array
03:09 committable6 AlexDaniel, https://gist.github.com/86281d3cb838846f3bea872e3fd02b08
03:09 AlexDaniel ok so just bisect: should work
03:09 AlexDaniel bisect: use lib ‘sandbox/’; use MyModule; say MyModule::get-array
03:09 bisectable6 AlexDaniel, Bisecting by exit code (old=2015.12 new=ae02bc2). Old exit code: 0
03:09 bisectable6 AlexDaniel, bisect log: https://gist.github.com/8d02a2cf2c1a32607e6caa0c49b48c27
03:09 bisectable6 AlexDaniel, (2016-02-11) https://github.com/rakudo/rakudo/commit/22b4ef05b1f72b50d63e4599d5e037bccf1f08ed
03:09 dayangkun joined #perl6
03:10 AlexDaniel that doesn't look relevant
03:10 AlexDaniel so we should probably double-check
03:10 AlexDaniel c: 22b4ef05b1f^,22b4ef05b1f use lib ‘sandbox/’; use MyModule; say MyModule::get-array
03:10 committable6 AlexDaniel, https://gist.github.com/fe6c74fe514ade011805b2d48d794706
03:10 AlexDaniel hm… that confirms it
03:10 piojo AlexDaniel: thanks for showing me how to do that!
03:11 piojo But that's really not a commit I woud expect to cause this!
03:13 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 Cabanossi joined #perl6
03:13 AlexDaniel I think the issue comes from this line:  +        my Pair @arg-help;
03:13 AlexDaniel and something in CORE.setting just goes crazy because of it? No idea actually
03:18 someuser1 joined #perl6
03:18 someuser2 joined #perl6
03:19 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:20 AlexDaniel piojo: sorry, what for? :)
03:21 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
03:21 AlexDaniel piojo: and that will definitely make the problem go away
03:22 AlexDaniel piojo: and then, you can try changing “my Pair @arg-help;” to just “my @arg-help;”
03:22 AlexDaniel and that'll probably make the problem go away, at least if my hypothesis is correct :)
03:22 piojo AlexDaniel: Do you have a more specific guess about what the underlying problem is that that change would help with?
03:23 piojo BTW, the problem is also showing itself with Array[CustomClass], not just Array[Pair]
03:24 piojo From where I stand, that commit is useful because it reveals a deep bug which may have other manifestations
03:26 AlexDaniel eval: spurt ‘sandbox/MyModule.pm6’, ‘our sub get-array(--> Array[Int]) { return my Int @pairs; }’
03:26 evalable6 AlexDaniel, rakudo-moar ae02bc299: OUTPUT: «»
03:26 AlexDaniel c: 22b4ef05b1f^,22b4ef05b1f use lib ‘sandbox/’; use MyModule; say MyModule::get-array
03:26 committable6 AlexDaniel, ¦22b4ef05b1f^,22b4ef0: «[]␤»
03:26 AlexDaniel c: 2015.12,22b4ef05b1f^,22b4ef05b1f,HEAD use lib ‘sandbox/’; use MyModule; say MyModule::get-array
03:26 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»»
03:27 AlexDaniel huh? :D
03:27 AlexDaniel 6c: use lib ‘sandbox/’; use MyModule; say MyModule::get-array
03:27 committable6 AlexDaniel, https://gist.github.com/921e695ee7b3732119985898652203b2
03:27 AlexDaniel bisect: use lib ‘sandbox/’; use MyModule; say MyModule::get-array
03:27 bisectable6 AlexDaniel, Bisecting by exit code (old=2015.12 new=ae02bc2). Old exit code: 0
03:27 bisectable6 AlexDaniel, bisect log: https://gist.github.com/f66026e29439175b55f2293b31f3c75d
03:27 bisectable6 AlexDaniel, (2016-12-19) https://github.com/rakudo/rakudo/commit/4b529c8281f9e8687721d82dd6e60495a09a8e80
03:29 AlexDaniel ah
03:30 AlexDaniel eval: spurt ‘sandbox/MyModule.pm6’, ‘unit module MyModule; our sub get-array(--> Array[Int]) { return my Int @pairs; }’
03:30 evalable6 AlexDaniel, rakudo-moar ae02bc299: OUTPUT: «»
03:30 AlexDaniel c: 2015.12,22b4ef05b1f^,22b4ef05b1f,HEAD use lib ‘sandbox/’; use MyModule; say MyModule::get-array
03:30 committable6 AlexDaniel, ¦2015.12,22b4ef05b1f^,22b4ef0,HEAD(ae02bc2): «[]␤»
03:30 AlexDaniel piojo: so using Int instead of Pair is OK
03:31 piojo AlexDaniel: right, Int works. I haven't explored which types of classes show the problem.
03:32 piojo the only big difference I see is that Int is (Cool) and custom types and pairs aren't
03:33 AlexDaniel piojo: I don't have an educated guess on why exactly it is behaving like this :)
03:34 ufobat_ joined #perl6
03:34 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:35 Geth ¦ doc: lefth++ created pull request #1699: Describe how to look up class members
03:35 Geth ¦ doc: review: https://github.com/perl6/doc/pull/1699
03:39 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:44 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:44 piojo Though the situation can be improved if I add a unit test for this
03:45 piojo we can hope the next time this occurs, it will do a better job of illuminating whatever is wrong in nqp or moarvm
03:45 AlexDaniel piojo: am suggesting a rakudo fix, yes. Would be great to have tests that go over a bunch of types (not just Pair)
03:49 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:50 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:51 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:51 thou joined #perl6
03:51 thou \o Good evening
03:52 piojo AlexDaniel: thanks for showing me the module bisect, and for your tips on this :)
03:53 AlexDaniel piojo: sure, let me know if you have any other bisectable challanges :)
03:53 piojo Thanks!
03:54 perlbot chenyf pasted a new file at https://f.perlbot.pl/p/3jg9le -
03:54 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.
03:55 jcallen joined #perl6
03:55 thou There's a branch in Pod::To::HTML for example called autarch/use-pod-treewalker , and several other related attempts there.
03:56 AlexDaniel piojo: possibly relevant: https://github.com/rakudo/rakudo/blob/ae02bc2994f078f547b297aedf4aaa4627ced392/src/core/core_prologue.pm#L1-L2
03:56 perlpilot_ joined #perl6
03:57 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.
03:58 thou It's suggested to make Pod part of the language braid to fix various parsing problems. That sounds very interesting to me!
03:58 Cabanossi joined #perl6
03:58 AlexDaniel thou: tbrowder is working on some [POD] bugs in rakudo, perhaps you should talk to him
03:58 thou awesome, thanks
03:58 nightfrog joined #perl6
03:59 AlexDaniel thou: IMO almost anything POD-related is underdeveloped, so feel free to jump in and do some serious changes
04:00 klapperl joined #perl6
04:02 kannan joined #perl6
04:09 Herby_ joined #perl6
04:09 Herby_ o/
04:09 explorer joined #perl6
04:09 mcmillhj joined #perl6
04:10 jhill_ joined #perl6
04:11 Cabanossi joined #perl6
04:12 someuser joined #perl6
04:12 SourceBaby joined #perl6
04:12 someuser joined #perl6
04:16 raiph joined #perl6
04:24 MasterDuke thou: i think moritz and DrForr and wander have all been talking about Pod::To::HTML recently
04:25 MasterDuke could try searching for "Pod::To::" at https://irclog.perlgeek.de/perl6/search and see what shows up
04:26 mcmillhj joined #perl6
04:27 wamba joined #perl6
04:31 thou Thanks for that info!
04:42 mcmillhj joined #perl6
04:43 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 https://pastebin.com/DUV1X7Vf
04:47 Herby_ .tell ctilmes ++ on the advent article
04:47 yoleaux Herby_: I'll pass your message to ctilmes.
04:48 Herby_ dumb question but I really like the font and look of the code in gist.github.com
04:48 Herby_ is it possible to get that font in Vim?
04:51 explorer I would guess you would need to change the font in your favourite terminal
04:51 mcmillhj joined #perl6
04:51 AlexDaniel this is an awesome post indeed
04:51 AlexDaniel ctilmes++
04:52 piojo Wow, this needs fixing: https://rosettacode.org/wiki/Determine_if_a_string_is_numeric#Perl_6
04:55 AlexDaniel piojo: what's exactly wrong with it?
04:55 Herby_ the new Advent of Code puzzle unlocks in about 5 minutes: http://adventofcode.com/
04:55 piojo My thought is that the real answer is: $_ !eq '' && try { $_ eq $_ }
04:55 piojo AlexDaniel: it only works because <5> produces IntStr
04:55 piojo m: say <4>.WHAT
04:55 camelia rakudo-moar ae02bc299: OUTPUT: «(IntStr)␤»
04:55 piojo AlexDaniel: it fails on all real strings
04:56 TimToady joined #perl6
04:56 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:57 piojo Sorry, that's slower than needed
04:57 AlexDaniel piojo: what about ?($term ~~ /\d/) and ?$term.Numeric;
04:58 cpage_ joined #perl6
04:58 piojo AlexDaniel: Nice! I didn't realize .Numeric returned Failure
04:59 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
04:59 piojo I didn't write it!
04:59 piojo it just needs to check that the string isn't empty.
05:00 mcmillhj joined #perl6
05:01 Actualeyes joined #perl6
05:01 piojo oh, ?$term.Numeric fails for 0
05:02 AlexDaniel piojo: what about: defined $term.Numeric
05:02 AlexDaniel or more explicit $term.Numeric !~~ Failure
05:03 AlexDaniel explorer: not that I know of
05:04 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
05:04 piojo AlexDaniel: thanks, then that seems a solid and short solution :)
05:07 piojo m: say "\t".Numeric; # uh-oh
05:07 camelia rakudo-moar ae02bc299: OUTPUT: «0␤»
05:08 piojo m: say "½".Numeric;
05:08 camelia rakudo-moar ae02bc299: OUTPUT: «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␤␤»
05:08 piojo m: say "1½".Numeric
05:08 camelia rakudo-moar ae02bc299: OUTPUT: «Cannot convert string to number: trailing characters after number in '1⏏5½' (indicated by ⏏)␤  in block <unit> at <tmp> line 1␤␤»
05:09 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
05:10 thou and Supply.grep() and .head() might help, too
05:10 AlexDaniel piojo: these are the tests: https://github.com/perl6/roast/blob/8da27758cc12f935de253707212141ae552cbcd5/S03-operators/context-forcers.t#L83-L91
05:11 AlexDaniel 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....
05:12 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
05:13 piojo AlexDaniel: and 'i' and 'e' can be Numeric but not '½'. That seems inconsistent
05:13 piojo No, my mistake
05:13 piojo I wasn't using the string in that test
05:15 AlexDaniel m: react { whenever Supply.merge: (Promise.in(3), Promise.in(2))».Supply { say $_; } }
05:15 camelia rakudo-moar ae02bc299: OUTPUT: «True␤True␤»
05:16 AlexDaniel maybe something like this can be hacked to do what's needed?
05:16 AlexDaniel m: react { whenever Supply.merge: (Promise.in(3), Promise.in(2))».Supply { done if $_; say ‘hello’ } }
05:16 camelia rakudo-moar ae02bc299: ( no output )
05:16 AlexDaniel m: react { whenever Supply.merge: (Promise.in(3), Promise.in(2))».Supply { say ‘hello’; done if $_ } }
05:16 camelia rakudo-moar ae02bc299: OUTPUT: «hello␤»
05:16 mcmillhj joined #perl6
05:17 AlexDaniel piojo: so that's why the regex check is there :)
05:19 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 angelds joined #perl6
05:19 piojo If "1.3e+12" is a number, then "" should be considered a number as well
05:20 piojo 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…
05:23 AlexDaniel huggable:
05:23 huggable AlexDaniel, nothing found
05:23 AlexDaniel huggable:
05:23 huggable AlexDaniel, nothing found
05:23 AlexDaniel huggable: gc
05:23 huggable AlexDaniel, nothing found
05:23 AlexDaniel huggable: force gc
05:23 huggable AlexDaniel, nothing found
05:23 AlexDaniel anyone remembers how to force gc?
05:23 AlexDaniel m: use nqp; nqp::force_gc()
05:23 camelia rakudo-moar ae02bc299: ( no output )
05:25 AlexDaniel mch: for ^400 { my $x = 300.chr.Numeric; $=1 }
05:25 committable6 AlexDaniel, https://gist.github.com/522f5794fed3618f41bb299b40d4da68
05:25 AlexDaniel bisect: for ^400 { my $x = 300.chr.Numeric; $=1 }
05:25 bisectable6 AlexDaniel, Bisecting by output (old=2015.12 new=ae02bc2) because on both starting points the exit code is 0
05:25 bisectable6 AlexDaniel, bisect log: https://gist.github.com/e796429812443838c7f48ea07c7b1788
05:25 bisectable6 AlexDaniel, (2015-12-29) https://github.com/rakudo/rakudo/commit/0e89a7a307bb6b8419dc8c777d563d28097cd28b
05:26 AlexDaniel mch: for ^10000 { my $x = 300.chr.Numeric; $=1 }
05:26 cdg joined #perl6
05:26 committable6 AlexDaniel, https://gist.github.com/370cfa2605da3893696b59a85545e994
05:32 mcmillhj joined #perl6
05:33 AlexDaniel GH#1298
05:33 synopsebot GH#1298 [open]: https://github.com/rakudo/rakudo/issues/1298 GC is blowing up failures needlessly
05:48 mcmillhj joined #perl6
05:56 xxpor_ joined #perl6
06:04 releasable6 joined #perl6
06:04 greppable6 joined #perl6
06:04 mcmillhj joined #perl6
06:05 squashable6 joined #perl6
06:20 mcmillhj joined #perl6
06:21 piojo Can anyone think of a reason why a pair of strings is not being found in an array?
06:22 piojo m: my Pair @array = ['47' => '4',]; say ('47' => '4') ∈ @array;
06:22 camelia rakudo-moar ae02bc299: OUTPUT: «True␤»
06:22 piojo In a longer example, this same check is failing
06:23 piojo When the array is constructed by "input.map( $_.map( given input.x.y { } )).flat
06:25 piojo Is there anything strange about a pair of ints that makes it not usable as a key in a set?
06:25 piojo I mean a pair of Str
06:27 Cabanossi joined #perl6
06:28 Geth ¦ doc: 9065949496 | (Alex Chen)++ | doc/Language/functions.pod6
06:28 Geth ¦ doc: Update functions.pod6
06:28 Geth ¦ doc: review: https://github.com/perl6/doc/commit/9065949496
06:28 synopsebot Link: https://doc.perl6.org/language/functions
06:30 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 rakudo-moar ae02bc299: OUTPUT: «False␤»
06:34 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 rakudo-moar ae02bc299: OUTPUT: «True␤»
06:36 mcmillhj joined #perl6
06:37 darutoko joined #perl6
06:38 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 rakudo-moar ae02bc299: OUTPUT: «Pair is in the list: False␤»
06:38 piojo Containers are breaking this!
06:38 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 rakudo-moar ae02bc299: OUTPUT: «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 = [$␤»
06:38 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 rakudo-moar ae02bc299: OUTPUT: «Pair is in the list: False␤»
06:38 piojo oh, that doesn't agree with my last test...
06:39 piojo AlexDaniel: there was another way I wrote it in which using sigilless variables made the test pass
06:39 piojo but in the simplest version, that doesn't help
06:41 piojo 6c: 2015.12,HEAD my ($one, two) = ('1', '2'); my Pair @data-array = [$one => $two]; so ($one => $two) ∈ @data-array;
06:42 committable6 piojo, https://gist.github.com/fd5644d38b839e51dd819ad406e08fcb
06:42 AlexDaniel 6c by itself is all releases
06:42 AlexDaniel so either
06:42 AlexDaniel c: 2015.12,HEAD my ($one, two) = ('1', '2'); my Pair @data-array = [$one => $two]; so ($one => $two) ∈ @data-array;
06:42 committable6 AlexDaniel, https://gist.github.com/831abdc41e417a4dc10194d6143de919
06:42 AlexDaniel or
06:42 piojo sorry, typo
06:42 AlexDaniel 6c: my ($one, two) = ('1', '2'); my Pair @data-array = [$one => $two]; so ($one => $two) ∈ @data-array;
06:42 piojo my ($one, $two) = ('1', '2'); my Pair @data-array = [$one => $two]; say "Pair is in the list: " ~ so ($one => $two) ∈ @data-array;
06:42 committable6 AlexDaniel, https://gist.github.com/6d4ecc23e13b08f0acc1f8ae13527927
06:42 AlexDaniel 6c: my ($one, $two) = ('1', '2'); my Pair @data-array = [$one => $two]; say "Pair is in the list: " ~ so ($one => $two) ∈ @data-array;
06:43 committable6 AlexDaniel, ¦6c (25 commits): «Pair is in the list: False␤»
06:44 kyan joined #perl6
06:44 piojo AlexDaniel: that means this never worked?
06:44 AlexDaniel where never = 2015.12 (first release supporting v6.c), yes
06:45 AlexDaniel 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?
06:45 committable6 AlexDaniel, https://gist.github.com/d882fd4eb666562d87de4f99d666708e
06:45 AlexDaniel “all” is all releases starting from 2014.01
06:46 AlexDaniel ( 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;
06:46 camelia rakudo-moar ae02bc299: OUTPUT: «Pair of literal strings is in the list: True␤»
06:47 piojo m: my ($one, $two) = <1 2>.map(*.Str); say so $one => $two === $one => $two;
06:47 camelia rakudo-moar ae02bc299: OUTPUT: «True␤»
06:48 piojo m: my ($one, $two) = <1 2>.map(*.Str); say so $one => $two === '1' => '2';
06:48 camelia rakudo-moar ae02bc299: OUTPUT: «True␤»
06:49 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 rakudo-moar ae02bc299: OUTPUT: «Pair|69757440␤Array[Pair] @data-array = Array[Pair].new("1" => "2")␤Pair|Str|1|Str|2␤False␤Pair $p = "1" => "2"␤»
06:49 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
06:49 camelia rakudo-moar ae02bc299: OUTPUT: «Pair|Str|1|Str|2␤Array[Pair] @data-array = Array[Pair].new("1" => "2")␤Pair|Str|1|Str|2␤True␤Pair $p = "1" => "2"␤»
06:50 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 rakudo-moar ae02bc299: OUTPUT: «Pair|Str|1|Str|2␤Pair|Str|1|Str|2␤Array[Pair] @data-array = Array[Pair].new("1" => "2")␤Pair $p = "1" => "2"␤True␤»
06:50 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
06:50 camelia rakudo-moar ae02bc299: OUTPUT: «Pair|79595008␤Pair|Str|1|Str|2␤Array[Pair] @data-array = Array[Pair].new("1" => "2")␤Pair $p = "1" => "2"␤False␤»
06:50 AlexDaniel piojo: that's not cool :)
06:50 AlexDaniel but maybe it makes sense?
06:51 AlexDaniel 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)
06:51 camelia rakudo-moar ae02bc299: OUTPUT: «True␤True␤False␤»
06:52 piojo I'll post this on stackoverflow. thanks!
06:52 piojo err, I need to read your output first :)
06:52 mcmillhj joined #perl6
06:53 AlexDaniel m: say (‘1’ => ‘2’).WHICH; my $one = ‘1’; my $two = ‘2’; say ($one => $two).WHICH
06:53 camelia rakudo-moar ae02bc299: OUTPUT: «Pair|Str|1|Str|2␤Pair|81741704␤»
06:53 AlexDaniel piojo: ↑ here's the golfed version
06:57 piojo AlexDaniel: thanks, that explains it perfectly
06:58 piojo but it drives me mad that Pair can either have a static or dynamic WHICH depending on how it's defined
06:58 piojo okay, "drives me mad" is an exaggeration
06:58 piojo but it's troubling
06:59 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 ZzZombo joined #perl6
06:59 piojo s/point in memory/object ID/
07:04 lowbro joined #perl6
07:04 lowbro joined #perl6
07:04 AlexDaniel piojo: I think lizmat is our expert on whichcraft, perhaps that's who you should ping
07:04 wamba joined #perl6
07:06 piojo AlexDaniel: do you know if lizmat's background is c++?
07:07 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
07:07 piojo haha
07:07 piojo Thanks
07:08 mcmillhj joined #perl6
07:10 geospeck joined #perl6
07:12 Cabanossi joined #perl6
07:13 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.
07:14 domidumont joined #perl6
07:18 AlexDaniel 👍
07:21 domidumont joined #perl6
07:21 avalenn joined #perl6
07:21 aindilis joined #perl6
07:22 piojo stackoverflow user lisprogtor, are you me?
07:22 piojo (https://stackoverflow.com/questions/47667461/perl6-user-defined-comparison-function-in-set-opertions)
07:23 buggable New CPAN upload: IRC-Client-Plugin-Github-0.1.5.tar.gz by TYIL https://cpan.metacpan.org/authors/id/T/TY/TYIL/Perl6/IRC-Client-Plugin-Github-0.1.5.tar.gz
07:25 mcmillhj joined #perl6
07:29 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.
07:31 parv joined #perl6
07:32 5EXAAUWM3 left #perl6
07:35 reportable6 joined #perl6
07:38 relaxed joined #perl6
07:40 AlexDaniel piojo: “2 hours ago” seems to be you :D
07:41 mcmillhj joined #perl6
07:45 piojo Faster than light.
07:50 wamba joined #perl6
07:52 mson joined #perl6
07:57 mcmillhj joined #perl6
07:59 itaylor57 joined #perl6
07:59 cdg joined #perl6
08:02 cdg_ joined #perl6
08:09 pnu__ joined #perl6
08:10 iviv joined #perl6
08:13 mcmillhj joined #perl6
08:20 mcmillhj joined #perl6
08:21 pdcawley joined #perl6
08:21 ZzZombo joined #perl6
08:27 mithaldu_ joined #perl6
08:32 pdcawley joined #perl6
08:32 Ven`` joined #perl6
08:32 pdcawley joined #perl6
08:33 pdcawley joined #perl6
08:34 pdcawley joined #perl6
08:34 angelds joined #perl6
08:35 dakkar joined #perl6
08:35 pdcawley joined #perl6
08:39 llfourn joined #perl6
08:40 DrForr o/
08:40 lookatme ls
08:41 DrForr Desktop     Music     Repositories    Videos
08:42 Cabanossi joined #perl6
08:42 jast good thing someone else answered, my answer would have been 424 bytes of listing
08:45 zostay joined #perl6
08:45 DrForr Mine would have been that way too, and probably revealed private corporate data. I just pasted the bottom line though.
08:47 jast Movies                         bin                            ejabberd-17.08-rosterpatch.tgz messenger-fsm.dot.png          userdotfiles.tgz
08:47 jast that's not too secret, I hope
08:58 DrForr Not now, anyway :)
08:59 rindolf joined #perl6
09:01 zakharyas joined #perl6
09:03 zakharyas joined #perl6
09:30 melezhik joined #perl6
09:31 lizmat piojo: The key of a Pair is always decontainerized, the value is not
09:32 lizmat m: Pair.new("a", my $ = 42)  # you could argue that this is incorrect
09:32 camelia rakudo-moar ae02bc299: ( no output )
09:32 lizmat m: dd Pair.new("a", my $ = 42)  # rather
09:32 camelia rakudo-moar ae02bc299: OUTPUT: «:a(42)␤»
09:32 lizmat as it's the same output as:
09:32 angelds joined #perl6
09:32 lizmat m: dd Pair.new("a", 42)
09:32 camelia rakudo-moar ae02bc299: OUTPUT: «:a(42)␤»
09:32 piojo lizmat: so a pair should not be considered a 2-tuple
09:32 lizmat it should
09:32 lizmat why do you say that ?
09:33 piojo I would expect it to treat the every value the same
09:33 piojo but a k-v pair can treat the first element like a key
09:33 buggable New CPAN upload: Sparky-Plugin-Hello-0.0.1.tar.gz by MELEZHIK https://cpan.metacpan.org/authors/id/M/ME/MELEZHIK/Perl6/Sparky-Plugin-Hello-0.0.1.tar.gz
09:34 piojo lizmat: the basic problem is that I was getting bad results for: $pair ∈ @array
09:34 piojo because $pair.WHICH isn't based on decontainerized values
09:35 piojo 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
09:35 piojo lizmat: haha
09:35 lizmat m: say Pair.new("a", 42).WHICH  # value type
09:35 camelia rakudo-moar ae02bc299: OUTPUT: «Pair|Str|a|Int|42␤»
09:35 tbrowder o/ #perl6, can someone answer questions about scheduling an advent post on the perl6 wordpress site?
09:35 lizmat m: say Pair.new("a",my $ = 42).WHICH  # container type
09:35 camelia rakudo-moar ae02bc299: OUTPUT: «Pair|57164056␤»
09:36 DrForr I did it last night, ergo I'm an expert :)
09:36 DrForr (scheduled a post, that is)
09:37 piojo m: my $one = 1; my \decontainerized = $one; say decontainerized.WHICH;
09:37 camelia rakudo-moar ae02bc299: OUTPUT: «Int|1␤»
09:37 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)
09:38 lizmat m: my $a = 1; say $a.WHICH   # you could argue this is wron
09:38 camelia rakudo-moar ae02bc299: OUTPUT: «Int|1␤»
09:40 lizmat piojo: you've made me realize we may need to reconsider Pair.WHICH
09:41 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
09:42 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
09:44 geospeck joined #perl6
09:44 tbrowder question 2: can i continue to edit the post, after scheduling, throughout its existence?
09:45 lizmat tbrowder: you can
09:45 lizmat afk&
09:45 tbrowder question 3: can the post’s title be safely changed if need be without losing the body?
09:46 tbrowder lizmat: thanks
09:46 DrForr I'd be wary of changing the title, that could affect permalinks.
09:46 moritz no, wordpress handles that fine
09:46 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.
09:47 yoleaux 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:48 tbrowder ok, i feel better now, whew! i’ll post a link to my 8 dec post later today for any early criticisms.
09:49 DrForr Also, mine is ready and in the queue for 11:59 as mentioned above, feel free to change any settings.
09:53 moritz I'll change it to midnight, just so that the publication meta data matches the day in the title
09:53 moritz DrForr: uhm, the post looks empty here :(
09:53 itaylor57 joined #perl6
09:53 DrForr Huh?
09:54 moritz https://perl6advent.wordpress.com/?p=6867&amp;preview=true
09:54 moritz that's the one, right?
09:54 DrForr Oh, no, you're off by one, I shared the wrong link.
09:54 DrForr post=6868
09:54 DrForr Let me delete the old one just so we dont' get confused.
09:55 moritz much better, thanks :-)
09:56 Geth ¦ doc: fluca1978++ created pull request #1700: Fix readme
09:56 Geth ¦ doc: review: https://github.com/perl6/doc/pull/1700
10:04 chansen_ joined #perl6
10:26 cdg joined #perl6
10:27 Cabanossi joined #perl6
10:30 margeas joined #perl6
10:31 ZzZombo joined #perl6
10:37 AlexDaniel joined #perl6
10:42 wander joined #perl6
10:42 wander \o
10:46 tyil o/
10:51 Grauwolf joined #perl6
11:00 wamba joined #perl6
11:00 ExtraCrispy joined #perl6
11:13 virtualsue joined #perl6
11:17 sena_kun joined #perl6
11:19 domidumont joined #perl6
11:33 mscha joined #perl6
11:33 mscha % perl -E 'say "hello"; say "world";' | head -1
11:33 mscha hello
11:33 mscha % perl6 -e 'say "hello"; say "world";' | head -1
11:34 mscha hello
11:34 mscha Unhandled exception: Failed to write bytes to filehandle: Broken pipe
11:34 S007 joined #perl6
11:34 mscha Is that on purpose?  It's kinda annoying.  Most command-line utilities don't complain when you `| head -1` them.
11:36 DrForr I don't think it's intentional.
11:36 DrForr Not that I know where to look in the code or how to fix it or anything like that.
11:38 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:39 jnthn See MoarVM commit 2c5974bc119384132
11:45 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:48 jnthn There's already an RT about this
11:50 mscha OK, thanks.  I won't file a new bug report then.
11:52 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 jnthn *from anyone
12:07 konsolebox joined #perl6
12:07 Phlogistique I can't find the ":" of "foo.map: -> $i {...}" in the https://docs.perl6.org/language/operators page
12:07 Phlogistique there is an "infix :" but its description does not seem to match
12:07 Phlogistique am I looking at the wrong place?
12:08 moritz it's not an operator, it's method invocation syntax
12:08 Phlogistique ok.
12:08 Phlogistique I thought it was an operator, similar to haskell $
12:09 moritz I think it's similar in spirit, but not implemented as an operator
12:09 Phlogistique alright, thanks
12:09 jast it's documented here btw: https://docs.perl6.org/language/syntax#Subroutine_calls
12:10 moritz jast++
12:10 jast and the link to 'Methods' is 404 ;)
12:11 jast also the link to 'Sub'
12:12 setty1 joined #perl6
12:16 traxex joined #perl6
12:16 Geth ¦ doc: fluca1978++ created pull request #1702: Fix slice table.
12:16 Geth ¦ doc: review: https://github.com/perl6/doc/pull/1702
12:18 Geth ¦ doc: 00b53b12f1 | (Alex Chen)++ | doc/Language/syntax.pod6
12:18 Geth ¦ doc: Fix broken link, jast++
12:18 Geth ¦ doc: review: https://github.com/perl6/doc/commit/00b53b12f1
12:18 synopsebot Link: https://doc.perl6.org/language/syntax
12:20 wander since we might merge classtut.pod6 with objects.pod6, it will be broken link some time :)
12:25 wander 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
12:26 wander see :)
12:31 woolfy joined #perl6
12:32 woolfy left #perl6
12:33 ZzZombo joined #perl6
12:34 xcm joined #perl6
12:42 Cabanossi joined #perl6
12:46 cdg joined #perl6
12:57 ZzZombo joined #perl6
13:08 cschwenz joined #perl6
13:09 cschwenz left #perl6
13:13 buggable New CPAN upload: Sparky-Plugin-Hello-0.0.2.tar.gz by MELEZHIK https://cpan.metacpan.org/authors/id/M/ME/MELEZHIK/Perl6/Sparky-Plugin-Hello-0.0.2.tar.gz
13:22 mcmillhj joined #perl6
13:23 geospeck joined #perl6
13:32 abraxxa joined #perl6
13:36 domidumont joined #perl6
13:42 domidumont1 joined #perl6
13:47 mcmillhj joined #perl6
13:48 cdg joined #perl6
13:54 Morfent joined #perl6
13:56 zakharyas joined #perl6
14:02 xtreak joined #perl6
14:31 comborico1611 joined #perl6
14:43 sjn joined #perl6
14:43 buggable New CPAN upload: Sparky-Plugin-Notify-Email-0.0.1.tar.gz by MELEZHIK https://cpan.metacpan.org/authors/id/M/ME/MELEZHIK/Perl6/Sparky-Plugin-Notify-Email-0.0.1.tar.gz
14:44 eliasr joined #perl6
15:04 Actualeyes joined #perl6
15:05 geospeck joined #perl6
15:06 silug joined #perl6
15:07 scimon joined #perl6
15:10 piojo_ joined #perl6
15:12 Cabanossi joined #perl6
15:13 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 piojo_ 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
15:14 mson joined #perl6
15:16 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:17 piojo_ m: say ('a').WHICH; say ('a', 'b').WHICH;
15:17 camelia rakudo-moar ae02bc299: OUTPUT: «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
15:17 timotimo 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)
15:18 timotimo 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.
15:19 piojo_ Still, $elem ∈ @array is O(n) either way
15:19 piojo_ But we care about more than that one case.
15:28 zakharyas joined #perl6
15:29 mcmillhj joined #perl6
15:30 rindolf joined #perl6
15:36 philomath_ joined #perl6
15:38 traxex_ joined #perl6
15:44 luiz_lha joined #perl6
15:47 khw joined #perl6
15:54 comborico1611 Have you guys check out my article in the Perl 6 Advent calendar?
15:54 comborico1611 !
15:55 DrForr Yep, read it this morning.
15:58 comborico1611 Ah!
15:58 comborico1611 That's exciting.
16:02 mcmillhj joined #perl6
16:03 troys joined #perl6
16:04 wamba joined #perl6
16:04 traxex joined #perl6
16:14 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:16 scimon But I am not one to talk. I've still got to write my article. Working on it.
16:17 DrForr Mine's coming up tomorrow...
16:18 DrForr 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:20 DrForr Oh, that. Yeah, that makes perfect sense, maybe it just needs to be restated differently.
16:21 scimon Meanwhile I'm getting my head around WHICH and putting Objects in Sets. Which is fun.
16:23 comborico1611 It may not be known by that name, but what is it commonly called?
16:24 comborico1611 (speaking of principle of least privilege)
16:25 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:30 tbrowder comborico11: i scanned it—looks like some good thoughts
16:33 damnlie joined #perl6
16:42 st_elmo joined #perl6
16:51 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:54 pok_ joined #perl6
16:54 damnlie joined #perl6
17:02 ShalokShalom left #perl6
17:06 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 perlpilot so, yeah, starting with minimal types and adding as-needed is the way to go.
17:06 ChoHag joined #perl6
17:07 mcmillhj joined #perl6
17:18 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:20 comborico1611 Thanks, tbrowder!
17:21 natrys joined #perl6
17:22 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 wamba joined #perl6
17:23 comborico1611 That a programmer's first*
17:24 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
17:25 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  ;)
17:26 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.
17:26 Ulti even assembly now isnt how a CPU works
17:26 comborico1611 Ulti, true. But some programming languages do much better at that than others.
17:26 Ulti given the whole thing is running a unix on the inside with a web server...
17:27 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:28 comborico1611 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:29 Ulti if you tell computers who's boss you are a computer programmer
17:29 comborico1611 heh
17:29 Ulti I think writing a blog post about programming probably qualifies you fairly immediately
17:29 araujo joined #perl6
17:29 AlexDaniel joined #perl6
17:30 comborico1611 But you're welcome, perlilot, it was a good opportunity to be able to right such an article for you all.
17:30 comborico1611 Haha, you kid.
17:30 Ulti no really
17:30 perlpilot comborico1611: I agree with Ulti here.
17:31 Ulti the idea of someone having imposter syndrome about being a programmer is kind of fun
17:31 albongo joined #perl6
17:32 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
17:32 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"
17:33 perlpilot It's just that they come at programming from a different need or mindset than those you'd call "CS types"
17:34 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.
17:35 domidumont joined #perl6
17:39 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 comborico1611 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.
17:40 comborico1611 Who told me*
17:40 khisanth_ joined #perl6
17:41 moritz yes. They know all about BGP, routing, VPLS and that stuff
17:42 comborico1611 The routing algorithms were tough for me. I skipped them...
17:42 comborico1611 Did you read my article, moritz?!
17:43 ChoHag joined #perl6
17:43 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
17:44 traxex joined #perl6
17:44 Ulti application level protocols you dont need to be down and dirty with union types inspecting packets
17:45 wamba joined #perl6
17:47 geospeck joined #perl6
17:49 cdg joined #perl6
17:52 moritz comborico1611, did you read my book? :-)
17:52 moritz comborico1611: I've read parts of your article, but not all
17:54 domidumont1 joined #perl6
17:59 setty1 joined #perl6
18:04 comborico1611 Haha. Nope. But my article is free. Haha
18:04 comborico1611 Thanks!
18:04 comborico1611 I don't expect you to. I'm just curious if you did. I guess I should wait for people to comment first.
18:08 traxex joined #perl6
18:14 rindolf joined #perl6
18:30 rindolf joined #perl6
18:35 mson joined #perl6
18:38 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:44 timotimo subclass the hash and implement the stuff there? :S
18:46 hahainternet timotimo: :/ that is a bit of a wart
18:46 hahainternet looks like it'd be better to define custom list type and make it a 'value type' by p6's defs?
18:47 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?
18:48 hahainternet [Coke]: it uses ===, and so (1,2,3) === (1,2,3) is false
18:48 hahainternet timotimo: ah, yeah my fault for constraining that
18:48 hahainternet i should have asked for the nicest way, ideally not overriding WHICH
18:49 timotimo time to bring parcel back %)
18:49 * hahainternet doesn't get it ☺
18:49 timotimo it was a thing that existed before the GLR
18:49 timotimo think of it as "lazi decision whether to flatten or to structurize listy things"
18:50 hahainternet roger
18:50 hahainternet well i would throw a vote behind immutable lists testing equality based on values
18:50 hahainternet ie 'value types'
18:50 hahainternet but i don't know what issues that would cause
18:50 hahainternet and i'd appreciate advice on the best way to implement my own type
18:50 MasterDuke hahainternet: you couldn't use a set instead of a list?
18:51 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?
18:51 hahainternet hmm, apparently not
18:51 hahainternet lists and sets are unfortunately not synonymous
18:51 hahainternet perhaps a Tuple type? ;)
18:51 timotimo yeah, sets are lists minus ordering and multi-containering
18:52 DrForr waves at MasterDuke
18:54 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
18:55 DrForr Dunno.
18:55 DrForr Let me check.
18:55 timotimo hahainternet: and take extra care to decontainerize everything and anything that comes in
18:55 wamba joined #perl6
18:56 timotimo and not allowing anything mutable in it
18:56 hahainternet the mutable part is certainly important
18:56 hahainternet but as long as i called WHICH on any container, that should be fine right?
18:56 hahainternet i suppose given it returns basically plaintext
18:56 hahainternet that's not safe
18:56 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
18:57 DrForr I don't see 2017 up at all yet.
18:57 DrForr 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.
18:58 hahainternet interesting that sets seem to encode their contents in some form
18:58 hahainternet -> Set.pm
18:58 hahainternet (in calls to WHICH i mean)
18:58 timotimo it's a sha1 hash
18:58 hahainternet roger, i shall adopt the asme
18:58 hahainternet as that is safe
18:58 timotimo zefram found a million different ways to create things that are very much not the same, but have the same WHICH
18:58 timotimo basically WHICH-injection attacks :)
18:59 hahainternet indeed, which is quite a serious issue
18:59 hahainternet but hashing the contents makes perfect sense
18:59 hahainternet and is what's used elsewhere safely, so that answers my q
19:03 lizmat FWIW, I would be in favour of List.WHICH as a value type if it doesn't have any containers
19:06 [Coke] what's wrong with the existing non-string-key hash variant?
19:06 [Coke] (oops)
19:07 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?
19:08 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
19:08 hahainternet i'm with you
19:09 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 lizmat either one of those are bad
19:09 hahainternet roger, it's semi irrelevant for my use case at the second but i understand why it's an issue now
19:09 cdg joined #perl6
19:10 rindolf joined #perl6
19:10 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
19:21 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:25 DrForr 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 thou joined #perl6
19:26 hahainternet seems i can't use 'but' as it creates some sort of implicit middle type with its own WHICH implementation
19:32 geekosaur that's its purpose
19:33 geekosaur it's generating a class on the fly with the lhs's type and the rhs's type mixed in
19:34 timotimo i believe most which implementations will put their type name (longname?) in the beginning
19:34 timotimo and mixing in something will influence the type's name
19:34 timotimo m: say (1 but "foo").^name
19:34 camelia rakudo-moar ae02bc299: OUTPUT: «Int+{<anon|64479952>}␤»
19:35 lizmat DrForr: that feels like an iterator to me ?
19:35 DrForr Ah, right, thanks for the reminder.
19:36 DrForr I'll do it this way then switch over...
19:36 unicodable6 joined #perl6
19:36 committable6 joined #perl6
19:38 hahainternet geekosaur: yeah understood, i was hoping i'd be able to override things on it
19:38 hahainternet defining a proper class seems sufficient though
19:38 geekosaur yes
19:39 geekosaur 'but's the quick and dirty one, if you need more control then you need to make the mixin yourself
19:39 geekosaur (although in fact you can use it to make behavior changes. x but { method x { ... } } iirc
19:40 geekosaur it's just annoying enough that you;re usually better off making a real mixin class
19:45 cdg joined #perl6
19:53 rindolf joined #perl6
20:00 thou DrForr, have you looked at this branch in Pod::To::HTML? https://github.com/perl6/Pod-To-HTML/tree/autarch/use-pod-treewalker/lib/Pod/To/HTML
20:00 yoleaux 05:26 MST <tbrowder> thou: can you list the pod bugs you need to have fixed?
20:01 DrForr No, I hadn't. And that's about what I was looking for.
20:02 DrForr thou++
20:03 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:04 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 hahainternet i hope that is clear, it's tricky to know how to explain it
20:06 Cabanossi joined #perl6
20:06 * DrForr fires of a 'git clone'...
20:06 DrForr *off
20:06 El_Che it's not that bad, don't burn it
20:06 El_Che git revert will do :)
20:09 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:11 thou 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:12 thou Or, at least, the status quo is certainly no improvement on S26. Hopefully I can get assent on that much. ;-)
20:15 thou 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.
20:16 DrForr *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
20:16 hahainternet including Captures, which is a bit odd
20:17 DrForr I admit I'm a touch surprised yet gratified to see autarch doing P6 work, helps ratify things a bit.
20:18 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:19 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, ...
20:21 thou DrForr, other than what's obvious about subclassing from Pod::TreeWalker, I've got an idea that we'll all need to do similar work with formatting Declarators. So we ought to develop some classes to represent the doc-interesting parts of Callables, for example. Look at signature2md in the current Pod::To::Markdown, and similar nonsense in ::HTML.
20:23 cdg joined #perl6
20:24 DrForr Not sure what you mean by Declarator, and with what I'm thinking I'd much prefer to let someone subclass my work and override to add formatting.
20:24 DrForr I'll take a look though.
20:24 DrForr I'm also pondering Pod::To::{DocBook,LaTeX}.
20:24 squashable6 joined #perl6
20:25 thou OK.  Pod::Block::Declarator is generated from #| This routine rocks!\nsub rockin() { ... }
20:25 DrForr Ah, gotcha.
20:25 DrForr I hadn't written that particular test, had forgotten the name.
20:25 SHODAN joined #perl6
20:26 thou Yes, and tbrowder is making Pod::To::Man, and there's sure to be more on the way.
20:26 DrForr I might even rename the curent class to Pod::To::BareHTML and do the subclassing myself.
20:28 DrForr Crap, n superscript 't' in Unicode... at least not in the U+2090 range...
20:32 rindolf joined #perl6
20:32 BooK joined #perl6
20:32 El_Che DrForr: you've a few nativecall modules. How do you debug (see) C datastructures without creating a CStruct (I just need to see if the data is created correctly before calling the next wrapped sub, I am not using the data myself)
20:33 ggherdov joined #perl6
20:33 benchable6 joined #perl6
20:34 Morfent how would i write the proto for a multi sub whose signatures are (Str, int32 $ = 0 --> Str) and (Str, int32, int32 is rw --> Str) ?
20:34 DrForr I think if you look at Inline::Scheme::Guile you'll see some C functions I created as debug utilities.
20:35 El_Che DrForr: thx, I got somewhat stuck
20:35 mcmillhj joined #perl6
20:36 El_Che netsplit fest
20:36 ccakes joined #perl6
20:37 DrForr It was mostly on the C side, I inserted calls to display methods that'd dump out C stuff with a quickie printf call.
20:37 xcm joined #perl6
20:38 cgfbee joined #perl6
20:38 El_Che DrForr: nativecall was a lot of fun until it wasn't :)
20:38 lizmat Morfent: proto sub foo(|) {*}
20:40 DrForr Oh... I did a talk on the NativeCall I did for the Scheme interpreter and halfway in I got an incredible craving for Krispy Kreme chocolate glazed eyeba...er, donuts.
20:40 Morfent thanks
20:41 DrForr The fun part was bouncing a generic list of C objects from Scheme to the NativeCall gateway, back into C code, then back out to be deserialized into Perl.
20:42 thou Morfent, you might try proto sub foo(Str, |) {*}, to compile-time check the common first arg
20:42 El_Che hybris
20:42 Morfent i have it written as proto idn2_to_ascii_8z(Str, |) returns Str { * } atm
20:43 thou right
20:46 pdcawley joined #perl6
20:47 natrys joined #perl6
20:47 mingdao joined #perl6
20:47 APic joined #perl6
20:47 pecastro joined #perl6
20:47 go|dfish joined #perl6
20:47 cpage joined #perl6
20:47 salva joined #perl6
20:47 MasterDuke Morfent: fyi, "returns" might be deprecated in the future, the preferred way is "-->" inside the signature
20:47 committable6 joined #perl6
20:47 unicodable6 joined #perl6
20:48 AlexDaniel joined #perl6
20:48 mithaldu_ joined #perl6
20:48 someuser joined #perl6
20:48 SourceBaby joined #perl6
20:48 pochi joined #perl6
20:48 Geth joined #perl6
20:48 synopsebot joined #perl6
20:48 dalek joined #perl6
20:48 jast joined #perl6
20:48 ilogger2_ joined #perl6
20:48 kshannon_ joined #perl6
20:48 awwaiid joined #perl6
20:48 captain-adequate joined #perl6
20:48 freeze joined #perl6
20:48 ab5tract joined #perl6
20:48 smash_ joined #perl6
20:48 tbrowder joined #perl6
20:49 go|dfish joined #perl6
20:49 mcmillhj joined #perl6
20:52 APic joined #perl6
20:59 MasterDuke dpk: you run yoleaux, correct? it dropped from #perl6, #perl6-dev, and #moarvm
20:59 yoleaux joined #perl6
21:00 dpk fixed
21:00 dpk it's been doing that a lot lately. dunno why
21:00 dpk it's supposed to restart automatically when it loses connection
21:00 MasterDuke dpk: cool, thanks
21:07 cdg joined #perl6
21:08 mcmillhj joined #perl6
21:09 khisanth_ joined #perl6
21:14 thou advent admins: it may be considered LTA to have an unanswered question from 2009 as the only comment on https://perl6advent.wordpress.com/about/ ? I think it'd be ethical to remove that comment, and would improve user experience IMO.
21:15 thou 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.
21:15 synopsebot RT#114480 [open]: https://rt.perl.org/Ticket/Display.html?id=114480 [POD] Pod table cell contents should be parsed as para
21:17 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:18 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:19 tbrowder But before any of that happens I would like to see LLfourn’s PR merged (PR #651) to simplify twines
21:22 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 hahainternet but i'd like some comment on whether this is correct behaviour, as it's certainly surprising
21:23 hahainternet OVH seems to be having proper internet issues too so apologies if i don't reply promptly if anyone wants to comment
21:24 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 thou 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.
21:25 perlpilot thou: "as the grammar is fixed"?  you're an optimist  ;)
21:26 comborico1611 joined #perl6
21:27 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:28 * DrForr gets a skeleton together for the new BlogspotHTML parser.
21:28 DrForr s/parser/walker-and-generator/
21:29 rgrau joined #perl6
21:29 thou cool
21:30 comborico1611 joined #perl6
21:31 kitsunenokenja joined #perl6
21:33 DrForr 'end' "events" don't seem to be firing.
21:38 cdg_ joined #perl6
21:38 DrForr Ah, nm, 'start' needs to return True. Probably useful for something.
21:42 thou tbrowder, is PR #651 in progress still?
21:43 raiph joined #perl6
21:43 thou DrForr, yes, it's like `find ... -prune`, to skip chunks of Pod that you're not interested in
21:44 DrForr Ah, right, chidren in a heading, that sort of thing.
21:44 DrForr *children
21:44 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.
21:45 moritz \o
21:45 thou So it likely needs merged into current and spectest updates, at the very least.
21:46 moritz it looks like the regex+grammar book is being release right now
21:46 moritz proof-readers are getting their ebook copy now
21:46 moritz and https://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)
21:47 thou congratulations!
21:47 El_Che moritz: nice to hear
21:47 tbrowder anyone having trouble with Zoffix's advent highlighter?
21:47 El_Che moritz: finished your previous book today
21:47 tbrowder I keep getting exceptions and am about to go back to the original one.
21:47 moritz ... and https://github.com/apress/perl-6-regexes-and-grammars/ is live (source code examples)
21:48 DrForr tbrowder: Did yesterday with either timeout or socket fail.
21:48 moritz El_Che: that's nice. Please write a review on amazon! :-)
21:48 El_Che moritz: I will
21:48 moritz tbrowder: thanks
21:48 tbrowder moritz: for...?
21:50 timotimo tbrowder: will you tell us what kind of exceptions you're getting?
21:50 moritz sorry, meant thou :-)
21:51 moritz mis-tab-completed
21:51 tbrowder https://www.irccloud.com/pastebin/Nf7DvjGl/
21:51 thou ;)
21:52 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 comborico1611 joined #perl6
21:53 tbrowder i have the github gist auth token defined in the required env var
21:54 ctilmes joined #perl6
21:55 timotimo did you look ta the gist it made?
21:55 hahainternet hey timotimo, got a second?
21:55 timotimo hahainternet: i'll be a bit distracted, but maybe i'll be able to help
21:55 timotimo what's up?
21:55 hahainternet nevermind, lizmat just fixed it lol
21:55 tbrowder no...
21:56 hahainternet timotimo: https://github.com/rakudo/rakudo/commit/d80df073ada4d4bc3e32afc2d11f974122802698
21:56 hahainternet lizmat: many thanks ♥
21:56 timotimo cool
21:57 hahainternet sorry to bug you, you authored the original line at issue you see
21:57 timotimo https://gist.github.com/tbrowder/5b639366ac6fa74e881e1c28465d93e1 - tbrowder does that ring any bells?
21:58 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?
21:59 hahainternet timotimo: the method signature
22:02 troys joined #perl6
22:02 nebuchadnezzar joined #perl6
22:02 vike joined #perl6
22:02 squain joined #perl6
22:02 japhb joined #perl6
22:02 phogg joined #perl6
22:02 cosimo joined #perl6
22:02 raydiak__ joined #perl6
22:02 bartolin joined #perl6
22:02 spider-mario joined #perl6
22:02 profan joined #perl6
22:02 f3ew joined #perl6
22:02 timotimo i was much less smarter then ...
22:03 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? https://hastebin.com/bogiqapepu.pl
22:03 raiph joined #perl6
22:06 timotimo does it get better if you make the proto's signature Str, $?, $? or something?
22:07 Morfent nope
22:08 timotimo and without a proto entirely?
22:09 Morfent Cannot use 'our' with individual multi candidates. Please declare an our-scoped proto instead
22:09 timotimo ah
22:09 timotimo ok, can you try "is export" instead of "our proto"
22:09 timotimo i.e. no "our" in front of the multis, either
22:11 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) {
22:11 thou ("in:", $input, " flags:", $flags).gist;
22:11 thou }
22:11 thou say idn2_to_ascii_8z('HI', 0);
22:12 thou ^ That fails, but remove 'multi' and it succeeds
22:13 thou with multi, Int works, but int32 doesn't
22:16 hahainternet lizmat: the behaviour seems the same to me after doing `rakudobrew build moar d80df073ada4d4bc3e32afc2d11f974122802698`
22:17 hahainternet i'll see if i can figure out what i'm doing wrong tomorrow, thanks for looking though!
22:17 hahainternet guess i should add a test
22:17 lizmat yes, pls :-)
22:17 tbrowder timotimo: even within ``` the line causes a failure.
22:17 Voldenet well, that's because Int isn't int32
22:18 Voldenet m: multi sub idn2_to_ascii_8z(Str $input, int32 $flags --> Str) { "" }; idn2_to_ascii_8z("", 0); #fails
22:18 camelia rakudo-moar d80df073a: OUTPUT: «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␤␤»
22:18 Voldenet m: use nqp; multi sub idn2_to_ascii_8z(Str $input, int32 $flags --> Str) { "" }; idn2_to_ascii_8z("", nqp::unbox_i(0)); #works
22:18 camelia rakudo-moar d80df073a: ( no output )
22:18 DrForr There, did a subclassable renderer for the NAME, AUTHOR &c tags.
22:20 Zoffix joined #perl6
22:21 Zoffix hahainternet: along with lizmat's fix, you.d need `List.new: |@a.List` or `List.new: |@a».<>`
22:22 Morfent ah there we go
22:22 Morfent thanks thou
22:23 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 :)
22:23 hahainternet the problem is that the list becomes containerised
22:23 Zoffix `idn2_to_ascii_8z('', my int32 $ = 0)`, I mean
22:23 Zoffix hahainternet: for which code?
22:23 thou thanks, Zoffix++
22:23 hahainternet Zoffix: List.new(<1 2 3>».Int) or similar exhibits it
22:24 hahainternet 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 hahainternet it seems using a capture works, but i don't know nqp well enough to help there
22:24 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:25 hahainternet Zoffix: i think i've tried every combination, so an example would be superb :)
22:25 Zoffix hahainternet: you're missing the slip
22:26 Zoffix hahainternet: not sure what example to use, considering the code you showed above doesn't need a List.new
22:27 hahainternet m: say List.new(|<1 2 3 4>)[0].VAR.^name
22:27 camelia rakudo-moar d80df073a: OUTPUT: «IntStr␤»
22:27 hahainternet interesting
22:27 hahainternet i get a different result locally
22:27 Zoffix hahainternet: did you build lizmat's commit?
22:27 hahainternet i thought so
22:27 itaipu joined #perl6
22:27 Zoffix hahainternet: perl6 -v
22:27 hahainternet i specified it to build moar, but i guess i'll go off and build it indivdualy
22:28 hahainternet 2017.10-4-g4fca94743
22:28 hahainternet so i guess not :/
22:28 Zoffix hahainternet: that's over a month old
22:28 hahainternet yes, i guess rakudobrew did not switch correctly
22:28 Zoffix hahainternet: you didn't switch
22:29 Zoffix 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 hahainternet that solves why that's happening though at least
22:30 hahainternet 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?
22:30 hahainternet Zoffix: probably not, moar-blead or just moar for including lizmat's commit?
22:30 hahainternet or just moar commitid?
22:31 Zoffix hahainternet: just moar
22:31 Zoffix huggable: sauce
22:31 huggable Zoffix, Install untested latest development version of Rakudo from source: https://github.com/zoffixznet/r#table-of-contents
22:31 cdg joined #perl6
22:31 Zoffix hahainternet: ^ or you can toss rakudobrew altogether and not deal with its quirks
22:31 hahainternet roger that, thank you
22:32 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 Zoffix m: List.new: |(^10_0000)
22:32 camelia rakudo-moar d80df073a: OUTPUT: «Too many arguments in flattening array.␤  in block <unit> at <tmp> line 1␤␤»
22:32 Zoffix hahainternet: so you should consider coersing some other way. Like, just use .List coercer instead of List.new
22:32 Zoffix m: (^10_0000).List
22:32 camelia rakudo-moar d80df073a: ( no output )
22:33 Zoffix But as I've said, <1 2 3 4> is already a List. Not sure why List.new is needed.
22:33 hahainternet Zoffix: this was originally about creating a subclass that 'is List' but has a WHICH behaving as a value type
22:33 hahainternet and degenerated into finding why suddenly my list was full of containers
22:33 Zoffix Ah
22:33 Zoffix OK.
22:33 * Zoffix &
22:33 Zoffix left #perl6
22:35 hahainternet that limit in flattening above seems exceedingly strange
22:36 hahainternet i'd like to read why that's a thing
22:38 timotimo you mean "too many arguments in flattening argument list"?
22:39 hahainternet yeah, it seems like it means you can't really construct anything analogous to a list
22:40 hahainternet 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
22:41 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:42 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 rakudo-moar d80df073a: OUTPUT: «111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111␤»
22:42 timotimo hm, that's enough
22:42 mspo 1, damn it!
22:44 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 hahainternet perhaps it just means you can't use the default List constructor :/
22:49 cdg_ joined #perl6
22:50 mcsnolte joined #perl6
22:51 jnthn You can use .from-iterator instead
22:53 jnthn Which, I'd hope, respects subclassing
22:53 timotimo m: say [//] 1 xx 100000
22:53 camelia rakudo-moar d80df073a: OUTPUT: «1␤»
22:53 timotimo m: say [//] 1 xx 10000000
22:53 camelia rakudo-moar d80df073a: OUTPUT: «1␤»
22:53 timotimo ISTR that also gave the "too many items in flattening list" error at one point
22:53 timotimo bisect: say [//] 1 xx 100000
22:53 bisectable6 timotimo, On both starting points (old=2015.12 new=d80df07) the exit code is 0 and the output is identical as well
22:53 bisectable6 timotimo, Output on both points: «1␤»
22:53 timotimo OK!
22:53 jnthn In general, though, avoid flattening huge numbers of arguments.
22:53 timotimo well, for other ops maybe
22:54 timotimo but then we got [+] special-cased
22:54 jnthn It's a sure-fire way to make sure things will run slow.
23:02 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:05 jnthn $obj does RoleName($value)
23:05 mson joined #perl6
23:05 lizmat jnthn++
23:09 llfourn joined #perl6
23:10 comborico1611 What does the ++ do?
23:10 lizmat increases karma for jnthn on an imaginary karma keeper
23:10 tbrowder .tell timotimo the old advent md2html from Zoffix seems to do fine.
23:10 yoleaux tbrowder: I'll pass your message to timotimo.
23:11 Geth joined #perl6
23:11 comborico1611 Oh. Thanks!
23:12 lizmat sleep&
23:15 Sgeo joined #perl6
23:20 kerframil joined #perl6
23:23 daxim joined #perl6
23:23 tinita joined #perl6
23:30 Aceeri joined #perl6
23:42 Cabanossi joined #perl6
23:49 raschipi joined #perl6

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo