Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-10-27

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:00 Thrush Thanks for all your help, you guys.  I'm signing off.
00:04 nadim_ joined #perl6
00:20 cdg joined #perl6
00:31 Zoffix joined #perl6
00:33 bloatable6 joined #perl6
00:36 Zoffix ⚠️⚠️⚠️⚠️⚠️⚠️⚠️ ❗❗❗❗ ❕❕❕❕
00:36 Zoffix
00:36 Zoffix NOTICE: Main Development Branch Renamed from “nom” to “master”: http://rakudo.org/2017/10/27/main-development-branch-renamed-from-nom-to-master/
00:36 Zoffix
00:36 Zoffix ⚠️⚠️⚠️⚠️⚠️⚠️⚠️ ❗❗❗❗ ❕❕❕❕
00:37 geekosaur weee
00:38 * geekosaur preps to nuke rakudobrew and start over again...
00:38 AlexDaniel weeeeelll for that you'd need rakudobrew to adapt
00:38 geekosaur hm, actually I suppose that won;;t work until rakudobrew itself is updated; it knows about nom
00:38 Zoffix rakudobrew build moar master
00:38 AlexDaniel https://github.com/tadzik/rakudobrew/pull/127
00:39 AlexDaniel .tell tadzik plz https://github.com/tadzik/rakudobrew/pull/127
00:39 yoleaux AlexDaniel: I'll pass your message to tadzik.
00:43 Cabanossi joined #perl6
00:44 epony joined #perl6
00:51 timotimo how hard can it be to write a blog engine …
00:52 * Zoffix wrote the one that drives rakudo.party in an afternoon :P
00:53 timotimo heh.
00:53 timotimo what kind of features does it have? i take it it's a static site generator?
00:54 Zoffix No, dynamic. With a command to pull from repo and repo got markdown files: https://github.com/zoffixznet/perl6.party/tree/master/post
00:54 Zoffix errr. wait don't look there!
00:54 timotimo er, oops?
00:54 * Zoffix hides all the unfinished drafts :)
00:54 bitrauser spoilers D:
00:55 timotimo but how does your command differentiate between draft and release? a field in the markdown perhaps?
00:55 Zoffix And this is basically all the code for it https://github.com/zoffixznet/perl6.party/blob/master/lib/Perl5/Party/Posts.pm  and https://github.com/zoffixznet/perl6.party/blob/master/app.pl
00:55 Zoffix timotimo: the posts have metadata at the top (the `%%` things): https://raw.githubusercontent.com/zoffixznet/perl6.party/master/post/6lang-The-Naming-Discussion-Update.md
00:56 Zoffix drafts have `%% draft: true` in the metadata
00:56 timotimo neat
00:56 Zoffix On top of markdown, the features is just some shortcuts for IRC quotes, links to routine/class docs and and markdown massager to make posts suitable for copy-pasting to blogs.perl.org  :)
00:57 timotimo it also has the glot.io snippet support right?
00:57 Zoffix Oh right yeah, that too
00:57 Zoffix This: https://github.com/zoffixznet/perl6.party/blob/master/assets/js/main.js#L14-L74
00:57 timotimo this test.p6 seems extremely useful
00:57 timotimo thanks for sharing that
00:58 Zoffix + code mirror for highlights; + this for backend to access glot.io API https://github.com/zoffixznet/perl6.party/blob/master/app.pl#L49-L67
00:58 Zoffix :)
00:58 timotimo i should go to bed
00:58 timotimo have a good one! :)
00:58 Zoffix You too \o
00:58 * Zoffix de-computers too
00:58 Zoffix left #perl6
00:58 timotimo hope your recovery goes faster than mine
00:59 * AlexDaniel runs also. Hope you folks have fun renaming “nom” to “master”! :)
01:13 Cabanossi joined #perl6
01:18 bitrauser_ joined #perl6
01:24 Geth ¦ doc: ed2009e9e1 | (Tom Browder)++ (committed using GitHub Web editor) | doc/Programs/01-debugging.pod6
01:24 Geth ¦ doc: grammar fix
01:24 Geth ¦ doc: review: https://github.com/perl6/doc/commit/ed2009e9e1
01:29 ryn1x joined #perl6
01:30 HoboWithAShotgun joined #perl6
01:32 HoboWithAShotgun hello friendly friends.
01:32 HoboWithAShotgun can i have a subset that defines an array of 8 integers?
01:32 tbrowder hi, HWAS
01:33 greppable6 joined #perl6
01:33 Herby_ o/ HoboWithAShotgun
01:35 tbrowder ref: rename nom to master, i just asked for advice on #perl6-dev per the note on the rakudo site.
01:41 travis-ci joined #perl6
01:41 travis-ci Doc build errored. Tom Browder 'grammar fix'
01:41 travis-ci https://travis-ci.org/perl6/doc/builds/293450741 https://github.com/perl6/doc/compare/db2e07bfb729...ed2009e9e1a0
01:41 travis-ci left #perl6
01:41 buggable [travis build above] ✓ All failures are due to: timeout (1 failure).
01:57 ilbot3 joined #perl6
01: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!
01:58 Cabanossi joined #perl6
02:02 Xliff Is there a P6 module for creating/manipulating Google Sheet docs?
02:05 wamba joined #perl6
02:12 ufobat_ joined #perl6
02:14 Zoffix joined #perl6
02:14 jdv79 what would be a good way to get a string down to x chars long where a char is a byte?
02:15 jdv79 well, at most x chars
02:16 Zoffix HoboWithAShotgun: yeah, subset Meow of Array where {.elems == 8 and .elems.all ~~ Int };
02:16 Zoffix HoboWithAShotgun: but we have typed, shaped arrays: my Int @a[8];
02:17 Xliff OK, GoogleSheets API is RESTful, which I am not surprised about, AT ALL.
02:18 Xliff I may take a stab at this in the near future.
02:18 Zoffix m: Buf.new('foobar♥meows'.encode.head: 8).decode('latin1').say
02:18 camelia rakudo-moar 1251f771c: OUTPUT: «foobarâ™␤»
02:18 Zoffix jdv79: dunno, something like that? ^
02:18 noganex joined #perl6
02:18 Zoffix chars as bytes.. I'm not sure what you mean.
02:19 jdv79 i have a byte size limit but utf8 makes substringing less obvious
02:19 Xliff jdv79: So, force single character strings?
02:19 jdv79 no.  just get the biggest substring i can fit
02:19 Xliff Er... Single BYTE encoded stringss
02:20 Xliff So single OR multi-byte characters that fit into a buffer of a specified size?
02:20 jdv79 yes
02:22 jdv79 i just brute forced it by chopping in a loop until the byte size fites
02:23 jdv79 but that's lame
02:23 Zoffix m: sub trim-to ($str, $bytes) { $str.comb.map: { state $b = buf8.new; my $d = .encode;  return $b.decode if $b + $d > $bytes; $b.append: $d  } }; 'foobar♥meows'.&trim-to(8).say
02:23 camelia rakudo-moar 1251f771c: OUTPUT: «Attempt to return outside of any Routine␤  in block <unit> at <tmp> line 1␤␤»
02:23 Zoffix bug?
02:24 Zoffix m: sub trim-to ($str, $bytes) {  my $b = buf8.new;  for $str.comb { my $d = .encode;  return $b.decode if $b + $d > $bytes; $b.append: $d  } }; 'foobar♥meows'.&trim-to(8).say
02:24 camelia rakudo-moar 1251f771c: OUTPUT: «foobar␤»
02:24 Zoffix m: sub trim-to ($str, $bytes) {  my $b = buf8.new;  for $str.comb { my $d = .encode;  return $b.decode if $b + $d > $bytes; $b.append: $d  } }; 'foobar♥meows'.&trim-to(9).say
02:24 camelia rakudo-moar 1251f771c: OUTPUT: «foobar♥␤»
02:24 Zoffix m: sub trim-to ($str, $bytes) {  my $b = buf8.new;  for $str.comb { my $d = .encode;  return $b.decode if $b + $d > $bytes; $b.append: $d  } }; 'foobar♥meows'.&trim-to(7).say
02:24 camelia rakudo-moar 1251f771c: OUTPUT: «foobar␤»
02:24 Zoffix jdv79: something like that? vOv
02:24 jdv79 i think so - thanks
02:24 * Zoffix goes to bed
02:24 Zoffix left #perl6
02:24 jdv79 nite
02:34 ryn1x joined #perl6
02:50 thowe joined #perl6
03:00 * HoboWithAShotgun has begun hacking on Unit::SI
03:01 HoboWithAShotgun i can already write: say 12V / 0.5A; # prints 24Ω
03:04 Juerd HoboWithAShotgun: Does V*A give you W or VA?
03:04 geekosaur heh
03:13 ryn1x joined #perl6
03:14 Cabanossi joined #perl6
03:17 HoboWithAShotgun it says watts
03:19 HoboWithAShotgun this is the first iteration: https://hastebin.com/qomaqodiyo.rb incomplete of course
03:21 HoboWithAShotgun i will now engage in righteous slumber
03:41 wamba joined #perl6
03:42 Cabanossi joined #perl6
03:43 cpage_ joined #perl6
03:46 ryn1x joined #perl6
03:58 Kyo91_ joined #perl6
04:35 cdg joined #perl6
04:40 ryn1x joined #perl6
04:43 Cabanossi joined #perl6
04:45 ryn1x joined #perl6
04:46 Xliff HoboWithAShotgun: Yow! I was doing something similar, trying to port the P5 version to P6.
04:47 Xliff https://github.com/Xliff/p6-math-units
04:47 Xliff .tell HoboWithAShotgun Yow! I was doing something similar, trying to port the P5 version to P6. https://github.com/Xliff/p6-math-units
04:47 yoleaux Xliff: I'll pass your message to HoboWithAShotgun.
04:56 napo1eon joined #perl6
05:04 rjbs joined #perl6
05:07 simcop2387 joined #perl6
05:14 geekosaur joined #perl6
05:20 cosimo joined #perl6
05:21 Actualeyes joined #perl6
05:22 ryn1x joined #perl6
05:23 perigrin joined #perl6
05:34 Piotr_ joined #perl6
05:42 Cabanossi joined #perl6
05:53 bitrauser_ joined #perl6
06:00 wamba joined #perl6
06:09 wamba joined #perl6
06:12 lowbro joined #perl6
06:20 domidumont joined #perl6
06:27 domidumont joined #perl6
06:27 wamba joined #perl6
06:32 abraxxa joined #perl6
06:38 sena_kun joined #perl6
06:42 ryn1x joined #perl6
06:57 Cabanossi joined #perl6
06:59 pmurias joined #perl6
07:00 nadim_ joined #perl6
07:09 domidumont joined #perl6
07:13 lizmat joined #perl6
07:19 patrickz joined #perl6
07:22 ryn1x joined #perl6
07:34 aborazmeh joined #perl6
07:34 aborazmeh joined #perl6
07:38 darutoko joined #perl6
07:54 parv joined #perl6
07:54 sproctor joined #perl6
08:10 zakharyas joined #perl6
08:15 zakharyas joined #perl6
08:21 zakharyas joined #perl6
08:23 ryn1x joined #perl6
08:32 rindolf joined #perl6
08:32 zakharyas joined #perl6
08:35 Ven joined #perl6
08:42 lowin joined #perl6
08:42 Cabanossi joined #perl6
08:51 cdg joined #perl6
08:55 ryn1x joined #perl6
09:03 pmurias :( when searching for prefix ^ the doc page makes me go to 'https://docs.perl6.org/routine/?$CIRCUMFLEX_ACCENT'
09:13 Ven joined #perl6
09:24 nadim_ joined #perl6
09:26 zakharyas joined #perl6
09:46 Ven_ joined #perl6
09:56 sena_kun should `perl6 -Isome_path -Ianother_path some.pl6` work?
09:57 sena_kun or, rather, it doesn't fail for sure, but does it load modules as I think it should?
10:00 sena_kun ...it is not.
10:04 araujo joined #perl6
10:04 araujo joined #perl6
10:08 ryn1x joined #perl6
10:09 ufobat_ thats what i do, and it worked for me
10:09 Ven joined #perl6
10:12 HoboWithAShotgun joined #perl6
10:13 Piotr_ pmurias: are You looking for 'https://docs.perl6.org/language/operators#prefix_^' ?
10:17 pmurias Piotr_: mostly reporting that searching for that on docs.perl6.org is broken
10:20 HoboWithAShotgun Xliff: of course you do. it's not as if there were a list.
10:20 yoleaux 04:47Z <Xliff> HoboWithAShotgun: Yow! I was doing something similar, trying to port the P5 version to P6. https://github.com/Xliff/p6-math-units
10:29 Geth ¦ doc: 6ee01ac517 | (Tom Browder)++ (committed using GitHub Web editor) | doc/Programs/01-debugging.pod6
10:29 Geth ¦ doc: xref to env vars
10:29 Geth ¦ doc: review: https://github.com/perl6/doc/commit/6ee01ac517
10:37 Ven_ joined #perl6
10:45 ryn1x joined #perl6
10:48 margeas joined #perl6
10:58 Cabanossi joined #perl6
11:00 travis-ci joined #perl6
11:00 travis-ci Doc build passed. Tom Browder 'xref to env vars'
11:00 travis-ci https://travis-ci.org/perl6/doc/builds/293606710 https://github.com/perl6/doc/compare/ed2009e9e1a0...6ee01ac517ba
11:00 travis-ci left #perl6
11:01 Geth ¦ doc: 752bafa604 | (Tom Browder)++ (committed using GitHub Web editor) | doc/Programs/00-running.pod6
11:01 Geth ¦ doc: add info on new env var
11:01 Geth ¦ doc: review: https://github.com/perl6/doc/commit/752bafa604
11:58 Cabanossi joined #perl6
12:00 ryn1x joined #perl6
12:10 wamba joined #perl6
12:14 itaipu joined #perl6
12:15 Geth ¦ doc: c17d628b1f | (Aleks-Daniel Jakimenko-Aleksejev)++ | 8 files
12:15 Geth ¦ doc: “nom” → “master”
12:15 Geth ¦ doc: review: https://github.com/perl6/doc/commit/c17d628b1f
12:28 astj joined #perl6
12:31 setty1 joined #perl6
12:37 ryn1x joined #perl6
12:43 bdmatatu joined #perl6
12:50 zakharyas joined #perl6
12:51 patrickz Hey! Is there any documentation how to create modules that contain C code and thus need a compiler during install?
12:54 DrForr Not sure how much documentation there is, but I'd definitely check out Inline::Perl5, plus if you're distributing the library separately you can always use NativeCall for an interface.
12:55 synopsebot joined #perl6
12:55 patrickz I already looked at Inline::Perl5, but that module looks a bit overkill using a Configure.pl and Makefile.in.
12:57 patrickz The library is just a tiny little bit of supporting C code that is more easily done in C than perl6.
12:57 synopsebot joined #perl6
13:05 cdg joined #perl6
13:07 jnthn patrickz: I think Digest::SHA1::Native does something like that
13:08 patrickz jnthn: Will have a look.
13:18 synopsebot joined #perl6
13:26 sproctor joined #perl6
13:29 mson joined #perl6
13:33 piojo_ joined #perl6
13:35 darkmorph joined #perl6
13:41 zakharyas joined #perl6
13:42 ryn1x joined #perl6
13:44 COMBORICO joined #perl6
13:51 zakharyas joined #perl6
13:58 mempko joined #perl6
14:06 ryn1x joined #perl6
14:11 khw joined #perl6
14:12 ryn1x joined #perl6
14:31 piojo_ .tell tyil You might be interested to know that I fixed the BSON::Document date encoding/decoding to agree with the format mongodb uses
14:31 yoleaux piojo_: I'll pass your message to tyil.
14:31 tyil piojo_: awesome!
14:31 yoleaux 14:31Z <piojo_> tyil: You might be interested to know that I fixed the BSON::Document date encoding/decoding to agree with the format mongodb uses
14:31 tyil thanks
14:32 setty1 joined #perl6
14:36 piojo_ :)
14:36 piojo_ Does anyone know if DBIish is thread safe (in practice)?
14:37 moritz back when I wrote some code in it: no
14:37 moritz most of the underlying DB libraries assume that you use the DB handle on the same thread where you opened it
14:38 piojo_ moritz: I'm doing that, but something's going wrong anyway
14:39 Coleoid joined #perl6
14:41 piojo_ I posted about it on stackoverflow, because I can't exactly post a good test case here. (But maybe I should post somewhere else, because it's not syntax highlighted on SO.) https://stackoverflow.com/questions/tagged/perl6
14:46 DrForr Good, we need traffic on SO. Even though I don't (yet, sigh...) participate...
14:47 Piotr_ joined #perl6
14:50 AlexDaniel do I get it right that “latest” on travis is HEAD?
14:50 piojo_ Yeah, recently there's been one guy posting almost every day. It's cool. Fun to see questions waiting. :)
14:50 AlexDaniel or is it the latest release?
14:53 piojo_ Haha, did everybody just go to stackoverflow and upvote the recent questions and answers?
14:55 DrForr Not I, I hardly use my account. THough again that should change.
14:59 moritz piojo_: I found a bug in your example code while skimming your question
14:59 moritz see the answer on SO
15:00 moritz I didn't have the time to actually try it with the bug fixed
15:00 ivans joined #perl6
15:02 wamba joined #perl6
15:03 piojo_ moritz: Thanks a lot! I'll test it, though if I might have to wait until Monday if I can't reproduce on my home computer
15:03 piojo_ I'll let you know if that was it
15:04 piojo_ but that really looks like the problem! I forgot %h«» interpolates but %h<> doesn't
15:05 moritz but don't use %h«...» there
15:05 piojo_ I need to break the habit of using %h<> so often
15:05 moritz it splits the key on whitespace
15:05 piojo_ Oh yeah, I know it woud be wrong
15:05 piojo_ but it would also work.
15:05 piojo_ (in this case)
15:05 moritz no
15:05 moritz because it interpolates $*THREAD but not .id
15:06 piojo_ oh, indeed. haha. Then it would have to be $*THREAD.id()
15:06 piojo_ but like I said, I really need to break that habit.
15:06 moritz right
15:11 AlexDaniel answering my own question: “latest” = HEAD on the default branch
15:14 eliasr joined #perl6
15:16 knight__ joined #perl6
15:17 Actualeyes joined #perl6
15:18 ggoebel joined #perl6
15:25 ugexe https://github.com/CurtTilmes/perl6-dbi-async - this uses DBIish and uses threads to do connection pooling
15:26 lostinfog joined #perl6
15:27 ugexe and keying on $*THREAD.id doesn't mean you are keying on an id that will always point at the same thread
15:27 ugexe key on just $*THREAD I believe
15:28 jdv79 is it true that a "non-capturing group" aka [] can be made capturing by naming it?
15:28 moritz jdv79: you can do something like $<foo>=[...]
15:28 jdv79 seems to work but the docs seem conflicted about that
15:29 moritz m: 'abc' ~~ /$<newname>=[.]/
15:29 camelia rakudo-moar 4fca94743: ( no output )
15:29 moritz m: say 'abc' ~~ /$<newname>=[.]/
15:29 camelia rakudo-moar 4fca94743: OUTPUT: «「a」␤ newname => 「a」␤»
15:29 moritz m: say 'abc' ~~ /$<newname>=./
15:29 camelia rakudo-moar 4fca94743: OUTPUT: «「a」␤ newname => 「a」␤»
15:29 jdv79 yeah, weird.  the docs call [] non-capturing:)
15:29 moritz well
15:29 moritz it doesn't capture, it groups
15:29 moritz it's just that $<...>= captures the next atom
15:29 jdv79 its a named capture, isn't it?
15:29 moritz whatever it is
15:29 jdv79 haha
15:30 HoboWithAShotgun joined #perl6
15:30 jdv79 that's gonna confuse people but ok
15:30 moritz so here, with [] you just define what's part of an atom
15:30 moritz nobody said regexes were easy...
15:31 jdv79 i guess its just the docs for me.  creating a named capture using non-capturing grouping
15:31 ryn1x joined #perl6
15:31 jdv79 not sure how to reword that correctly though.  i'll bug it i guess.
15:33 perlpilot joined #perl6
15:37 Geth ¦ ecosystem: cc9b1a1600 | (Nick Logan)++ (committed using GitHub Web editor) | META.list
15:37 Geth ¦ ecosystem: Remove some dead links
15:37 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/cc9b1a1600
15:38 moritz jdv79: IMHO it's better to think of [] as just a "group"
15:38 moritz and () as a "capturing group"
15:38 moritz and $<...>=... is a modifier that makes anything after it capture
15:38 kyan joined #perl6
15:48 jdv79 hmm, how come i can't do $0.?Str
15:49 jdv79 in other words is there a way to tersely convert a match to a string if it matched and Bool false if it didn't
15:49 moritz $0 && $0.Str
15:50 jdv79 kinda like my $var = $<var>.?Str // $default-var if it worked
15:50 jdv79 i thought maybe there was something shorter
15:50 piojo_ Oh, I'm interested in that, too
15:50 jdv79 its good.  tanks.
15:51 wamba joined #perl6
15:51 piojo_ I found myself setting: my %data = from-json (%data<field> // "{}");
15:51 piojo_ and that just seemed really ugly
15:52 piojo_ not everything can be beautiful, I guess
15:53 piojo_ Err, didn't mean to use the same variable twice. Should be my %result = from-json (%data<field> // "{}");
15:53 perlpilot what was ugly about it?
15:53 moritz needs to be '{}'
15:53 jdv79 yeah, i think {} interplates away
15:54 moritz %result = $_ ?? from-json $_ !! {} given %data<field>;
15:54 perlpilot I'd call that one more ugly
15:55 piojo_ it makes more sense, though.
15:56 ugexe it would break on invalid json such as bare 0, no?
15:56 piojo_ ugexe: in my case it's coming from a database (a JSONB field), so it must be a string
15:57 piojo_ but yeah, if needed we could change it to $_.defined
15:57 Cabanossi joined #perl6
15:58 piojo_ moritz: thanks, I should learn to use trailing "given"
15:58 stmuk http://pl6anet.org/drop/rakudo-star-2017.10-RC0.tar.gz
16:00 Morfent joined #perl6
16:00 AlexDaniel :O
16:00 piojo_ stmuk: Thanks! I'll install that on windows/work
16:00 rindolf joined #perl6
16:01 AlexDaniel stmuk++
16:01 stmuk I haven't tried it on Windows yet TBH. That might be "interesting" :)
16:01 piojo_ oh, haha
16:01 piojo_ I was wondering why it was .tar.gz
16:02 piojo_ and I forgot star was for linux, too
16:02 piojo_ because it doesn't work on archlinux, I started thinking it was just a windows thing.
16:02 piojo_ I mean, I mean there's no package for archlinux
16:02 stmuk its a source tarball
16:02 piojo_ I'm sure the download works fine.
16:02 piojo_ yeah, we package our source installs
16:02 piojo_ but that's not working for rakudo star.
16:03 ugexe m: my %result; %result<foo> = Any; my $x = %result<foo>.?Str // 42; # an annoying problem with `.?Str // ...`
16:03 camelia rakudo-moar 4fca94743: OUTPUT: «Use of uninitialized value %result of type Any in string context.␤Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.␤  in block <unit> at <tmp> line 1␤»
16:03 piojo_ It's one of the snobbish distros that has complex wrapper scripts for most source builds
16:03 AlexDaniel star: say 42
16:03 camelia star-m 2017.07: OUTPUT: «42␤»
16:03 AlexDaniel what should be done to update this ↑ ?
16:04 moritz currently, I still do that manually
16:04 piojo_ moritz: you definitely solved the DBIish issue. Thanks! I'll add a note to the relevant code so no other noob can read over it and accidentally think the technique is correct.
16:04 moritz if somebody wants to automate it, even better
16:06 perlpilot m: my %result; %result<foo> = Any; my $x = (%result<foo> // 42).?Str;  # ugexe :)
16:06 camelia rakudo-moar 4fca94743: ( no output )
16:09 ryn1x joined #perl6
16:12 piojo_ I just realized perl6 is hard in exactly the same way c++ is hard
16:13 piojo_ It gives you enough rope to shoot yourself in the foot.
16:13 AlexDaniel /:-o
16:17 wander joined #perl6
16:22 El_Che piojo_: I was under the impressions that arch linux had rakudo packages
16:23 El_Che piojo_: if not, it can be added to https://github.com/nxadm/rakudo-pkg
16:23 cdg joined #perl6
16:24 El_Che piojo_: until now, no one has asked for arch support
16:24 jdv79 m: "ab" ~~ /(.)*/; my %h = :k($0>>.Str); %h<k>[0] = "c"
16:24 camelia rakudo-moar 4fca94743: OUTPUT: «Cannot modify an immutable Str (a)␤  in block <unit> at <tmp> line 1␤␤»
16:24 piojo_ El_Che: that's interesting. There's a forum thread about it, but I don't know whether they've asked for help
16:24 jdv79 why is that immmutable? didn't >>.Str just create an array of mutable strings?
16:26 ugexe m: say ((^5)>>.Str).WHAT
16:26 camelia rakudo-moar 4fca94743: OUTPUT: «(List)␤»
16:26 piojo_ I'll try installing it again (via the source-based package manager)
16:27 ugexe m: "ab" ~~ /(.)*/; my %h = :k(@ = $0>>.Str); %h<k>[0] = "c"
16:27 camelia rakudo-moar 4fca94743: ( no output )
16:28 jdv79 i forgot about the @= part
16:28 jdv79 thanks ugexe.  I knew Array.new worked but seemed verbose.
16:28 scovit joined #perl6
16:31 jdv79 i don't see taht in the docs
16:34 Kyo91_ joined #perl6
16:34 ugexe its probably mentioned somewhere for examples like -> $foo, $, $, @ { }
16:36 ugexe https://docs.perl6.org/type/Signature#index-entry-anonymous_arguments_%28Signature%29 its vaguely mentioned here
16:37 darkmorph joined #perl6
16:37 jdv79 i looked on the Lists lang page
16:37 jdv79 https://docs.perl6.org/language/list
16:37 greppable6 joined #perl6
16:38 AlexDaniel joined #perl6
16:39 jdv79 i'll but it
16:39 jdv79 *bug
16:39 ugexe well not sure why it would be
16:40 jdv79 that's where GLR type issues are laid out no?
16:40 ugexe m: say my @ = 1,2,3; say my $ = 1; # its more generic than that
16:40 camelia rakudo-moar 4fca94743: OUTPUT: «[1 2 3]␤1␤»
16:40 jdv79 that's where i went first to look
16:40 ugexe oh i thought it was type/List
16:41 ugexe not language/List
16:41 jdv79 ah
16:41 troys joined #perl6
16:43 HoboWithAShotgun joined #perl6
16:52 raiph joined #perl6
16:52 jdv79 the closer i look its not as simple as i thought.  my example is an array in both cases.  the slots are just containers or not
16:52 jdv79 seems weirder now
16:53 itaipu joined #perl6
16:56 jdv79 m: "ab" ~~ /(.)*/; my %h = :k($0>>.Str); say %h<k>.WHAT, %h<k>[0].VAR.WHAT; %h<k>[0] = ""
16:56 camelia rakudo-moar 4fca94743: OUTPUT: «(Array)(Str)␤Cannot modify an immutable Str (a)␤  in block <unit> at <tmp> line 1␤␤»
16:56 jdv79 m: "ab" ~~ /(.)*/; my %h = :k(@=$0>>.Str); say %h<k>.WHAT, %h<k>[0].VAR.WHAT; %h<k>[0] = ""
16:56 camelia rakudo-moar 4fca94743: OUTPUT: «(Array)(Scalar)␤»
16:56 jdv79 why did an array get created without containers in the first example thhere?
16:57 jdv79 and/or why did it in the second snippet?
17:00 itaipu left #perl6
17:06 ryn1x joined #perl6
17:07 AlexDaniel hm, so Hacktoberfest still counts repos you have commit bit for
17:07 AlexDaniel weird
17:07 mempko joined #perl6
17:08 AlexDaniel just registered for fun and it shows 14/4 contributions
17:08 AlexDaniel so you can claim the t-shirt if you have 4 pull requests anywhere
17:13 Piotr__ joined #perl6
17:13 AlexDaniel squashable6: next
17:13 squashable6 AlexDaniel, ⚠🍕 Next SQUASHathon in 6 days and ≈16 hours (2017-11-04 UTC-12⌁UTC+14). See https://github.com/rakudo/rakudo/wiki/Monthly-Bug-Squash-Day
17:13 AlexDaniel woo-hoo, 6 days!
17:14 AlexDaniel alright, let's decide on the topic for this month
17:14 AlexDaniel buggable: testneeded
17:14 AlexDaniel buggable: tag testneeded
17:14 buggable AlexDaniel, There are 38 tickets tagged with TESTNEEDED; See http://fail.rakudo.party/t/TESTNEEDED for details
17:19 domidumont joined #perl6
17:23 ryn1x joined #perl6
17:25 Kyo91_ joined #perl6
17:27 Cabanossi joined #perl6
17:28 number8 joined #perl6
17:30 number8 hello, everyone! i'm trying to store all regex captures in a single line doing something like $string ~~ m:g/ (pattern)? / ... but how can i store all captures in an array?
17:32 timotimo you can use comb instead, if you pass :match inside it'll give you the match objects corresponding to every match rather than just the matched string
17:33 timotimo m: my @results = "hello how are you today?".comb(/ \w(\w+)\w /, :match); .[0].say for @results
17:33 camelia rakudo-moar 4fca94743: OUTPUT: «「ell」␤「o」␤「r」␤「o」␤「oda」␤»
17:35 mempko joined #perl6
17:35 number8 timotimo: awesome, thank you. i have to read the comb documentation because i thought it only returned a list of the individual elements of a sequence...
17:36 timotimo you can also use $string.match(/ (pattern)? /, :g) for the same purpose
17:37 timotimo and i think if you my @results = $strign ~~ m:g/ (pattern)? / it'll also give you what you want
17:39 [Coke] AlexDaniel: "nom regression" indicates that it regressed when we cut over to nom from the previous master. so yes, don't rename those.
17:39 number8 i tried that last one but it stored the 「capture」 in that format, whereas i'm only interested in the capture as a string
17:40 AlexDaniel [Coke]: oh!
17:40 [Coke] (they're *old*. :)
17:40 [Coke] most of them at this point probably need a larry review and a "that's just the way it is now"
17:40 [Coke] @larry, not larry specifically
17:41 epony joined #perl6
17:58 Cabanossi joined #perl6
18:05 AlexDaniel bisectable6: uptime
18:05 bisectable6 AlexDaniel, 5 days, 15 hours, 18 minutes, and 28 seconds, 433.74KB maxrss. This is Rakudo version 2017.09-479-g7cf5ce7ef built on MoarVM version 2017.09.1-609-g1a9be0ad4 implementing Perl 6.c.
18:05 timotimo number8: aha! then i expect comb without :match will give you exactly what you want
18:13 epony joined #perl6
18:18 bisectable6 joined #perl6
18:18 benchable6 joined #perl6
18:18 committable6 joined #perl6
18:18 squashable6 joined #perl6
18:18 unicodable6 joined #perl6
18:41 HoboWithAShotgun joined #perl6
18:41 horrad joined #perl6
18:45 horrad joined #perl6
18:48 horrad joined #perl6
18:49 number8 timotimo: it did! thanks for your help :)
18:54 timotimo cool
18:58 knight__ When I have hash, and hash has some key and value is array and array contains a hash. If I do %hash<key> that returns array of hashes not one hash
18:58 knight__ for example
18:59 knight__ https://ideone.com/SyVg7z
18:59 knight__ Why it does not return a whole hash in array?
18:59 knight__ I do not understand it.
19:01 moritz m: my %hash := {1=>[{a=>3, b=>4}]}; dd %hash
19:01 camelia rakudo-moar 4fca94743: OUTPUT: «Hash % = {"1" => $[:a(3), :b(4)]}␤»
19:01 moritz the hash is flattened out
19:01 moritz m: my %hash := {1=>[{a=>3, b=>4},]}; dd %hash
19:01 camelia rakudo-moar 4fca94743: OUTPUT: «Hash % = {"1" => $[{:a(3), :b(4)},]}␤»
19:02 lizmat one argument rule
19:02 moritz m: my %hash := {1=>[{a=>3, b=>4},]}; dd %hash<1>[0]
19:02 camelia rakudo-moar 4fca94743: OUTPUT: «Hash <element> = ${:a(3), :b(4)}␤»
19:02 HoboWithAShotgun good evening sunshines
19:03 HoboWithAShotgun m: role R {}; multi sub infix:<*>(R $a, R $b) { $a * $b; }; my $a = 2 does R; my $b = 3 does R; say $a * $b
19:03 camelia rakudo-moar 4fca94743: OUTPUT: «Ambiguous call to 'infix:<*>'; these signatures all match:␤:(Int:D \a, Int:D \b --> Int:D)␤:(R $a, R $b)␤  in block <unit> at <tmp> line 1␤␤»
19:03 HoboWithAShotgun can i make this unambiguous?
19:05 ugexe m: my %hash := {1=>({a=>3, b=>4})}; say %hash<1>[0]
19:05 camelia rakudo-moar 4fca94743: OUTPUT: «{a => 3, b => 4}␤»
19:06 knight__ ugexe: interesting
19:07 knight__ I am parsing it from JSON, is there any option?
19:08 Coleoid joined #perl6
19:08 El_Che I created a Ubuntu 14.04 pkg for using it with travis on my own projects. The rakudobrew community version is too slow for long jobs. Does it make sense to provide an alternative language support based on packages? Now I just install the deb from the repo (https://travis-ci.org/nxadm/rakudo-pkg#L515), but releases could be uploaded to e.g. to bintray to provide more versions
19:11 HoboWithAShotgun m: my %hash := {1=>[{a=>3, b=>4}]}; say %(%hash<1>);
19:11 camelia rakudo-moar 4fca94743: OUTPUT: «{a => 3, b => 4}␤»
19:11 raschipi joined #perl6
19:11 HoboWithAShotgun that's really a trap imho, your code knight, should be correct
19:12 ugexe m: my %hash := {1=>[{a=>3, b=>4}, {c=>3}]}; say %(%hash<1>);
19:12 camelia rakudo-moar 4fca94743: OUTPUT: «{a      3␤b     4 => {c => 3}}␤»
19:12 AlexDaniel m: role R {}; multi sub infix:<*>(R $a, R $b) is default { $a * $b; }; my $a = 2 does R; my $b = 3 does R; say $a * $b
19:12 camelia rakudo-moar 4fca94743: OUTPUT: «MoarVM panic: Memory allocation failed; could not allocate 131072 bytes␤»
19:13 AlexDaniel m: role R {}; multi sub infix:<*>(R $a, R $b) is default { nextwith $a, $b }; my $a = 2 does R; my $b = 3 does R; say $a * $b
19:13 camelia rakudo-moar 4fca94743: OUTPUT: «6␤»
19:13 AlexDaniel HoboWithAShotgun: what about this? ↑
19:14 HoboWithAShotgun i think it's because a hash is just a list of pairs so {a=>3, b=>4} is actually [:a(3), :b(4)] and that [[:a(3), :b(4)]] gets then flattened somehow?
19:14 ugexe one argument rule
19:15 knight__ joined #perl6
19:15 knight__ sorry, my inet connection...
19:15 knight__ Somebody wrote something?
19:15 knight__ Is it "bug"?
19:16 AlexDaniel knight__: https://irclog.perlgeek.de/perl6/today
19:16 knight__ Thx
19:24 robertle joined #perl6
19:28 number8 does anyone know why $0 is Nil in a line like this: for $current_line.comb(/ (this matches and i want it captured) /) { ...
19:29 cdg joined #perl6
19:30 ugexe m: say (1..9).comb(/(1|2|3) {say $0}/)
19:30 camelia rakudo-moar 4fca94743: OUTPUT: «「1」␤「2」␤「3」␤(1 2 3)␤»
19:31 Mrofnet joined #perl6
19:31 AlexDaniel number8: do you want to capture just one thing or multiple things?
19:31 moritz number8: .comb just returns a list of strings
19:31 moritz if you want matches, use .match
19:31 HoboWithAShotgun ugexe: one argument rule?
19:31 AlexDaniel m: for ‘abb add’.comb(/ a <( .. /) { say $_ }
19:31 camelia rakudo-moar 4fca94743: OUTPUT: «bb␤dd␤»
19:31 number8 AlexDaniel: just the pattern inside parens
19:32 AlexDaniel m: for ‘abbz addz’.comb(/ a <( .. )> z /) { say $_ }
19:32 camelia rakudo-moar 4fca94743: OUTPUT: «bb␤dd␤»
19:32 poohman joined #perl6
19:32 AlexDaniel number8: I don't know what you're doing exactly, but maybe this ↑ will help
19:32 poohman hello
19:32 AlexDaniel o/
19:33 HoboWithAShotgun m: my @a = [[1]]; say @a.perl; @a = [[1], [2]]; say @a.perl
19:33 camelia rakudo-moar 4fca94743: OUTPUT: «[1]␤[[1], [2]]␤»
19:33 number8 moritz: i know, and that's partially what i want, but i also want a substring (the capture) within the string that comb returns
19:33 HoboWithAShotgun what the fuck, seriously?
19:33 AlexDaniel .hug HoboWithAShotgun
19:33 * huggable hugs HoboWithAShotgun
19:33 moritz number8: example?
19:34 ugexe https://docs.perl6.org/language/functions#Slurpy_Conventions
19:34 AlexDaniel HoboWithAShotgun: yeah, it has to be [[1],]
19:34 number8 AlexDaniel: i'm using comb to catch multiple instances of the same pattern in one line of text
19:34 poohman m: say "Test hello"
19:34 camelia rakudo-moar 4fca94743: OUTPUT: «Test hello␤»
19:35 HoboWithAShotgun i don't care about the rationale, that's wrong.
19:36 ugexe what if the solution was wrong somewhere else?
19:36 raschipi The one argument rule is by definition correct
19:36 number8 moritz: for example, i want to read a file line by line: for $filename.IO.lines -> $current_line { ...
19:36 moritz number8: we could help you much better if you provided an actual, concrete example
19:36 AlexDaniel no he is actually right, it's really weird
19:36 AlexDaniel for example
19:36 AlexDaniel m: say ((50))
19:36 camelia rakudo-moar 4fca94743: OUTPUT: «50␤»
19:36 AlexDaniel m: say [[50]]
19:36 camelia rakudo-moar 4fca94743: OUTPUT: «[50]␤»
19:36 moritz it is weird, yes
19:36 moritz but we haven't found a better solution
19:37 HoboWithAShotgun it makes every notation of a datastructure erratic
19:37 lizmat HoboWithAShotgun: no, the rule is consistent
19:37 ugexe thats a bold claim
19:37 lizmat anything iterable used as a single value / parameter, will be iterated over / flattened
19:37 HoboWithAShotgun sure you can have an array of arrays, but all arrays must have at least two elements...
19:37 raschipi m: my @a := [[1]]; say @a.perl;
19:37 camelia rakudo-moar 4fca94743: OUTPUT: «[1]␤»
19:38 moritz HoboWithAShotgun: or you just use a trailing comma
19:38 AlexDaniel HoboWithAShotgun: oh, you're misunderstanding it! [42,] is not two elements
19:38 number8 then for each line i want to find ALL instances of / .* (THIS) .*/
19:38 moritz m: say [[1,],].perl
19:38 camelia rakudo-moar 4fca94743: OUTPUT: «[[1],]␤»
19:38 AlexDaniel number8: / .* <( THIS )> .* /
19:38 raschipi m: my \a := [[1]]; say a.perl;
19:38 camelia rakudo-moar 4fca94743: OUTPUT: «[1]␤»
19:38 moritz number8: just leave out the .* on both ends
19:38 AlexDaniel or that ↑
19:39 ugexe .lines.map: { if $_ ~~ / ... / { say $0 } })
19:39 AlexDaniel depending on what your actual example is
19:39 ryn1x joined #perl6
19:39 moritz that's why I'm asking for an *actual* example
19:40 HoboWithAShotgun m: my @a = [[1,]]; say @a.perl;
19:40 camelia rakudo-moar 4fca94743: OUTPUT: «[1]␤»
19:40 moritz ugexe: or .lines.grep(/.../)
19:40 HoboWithAShotgun m: my @a = [[1,],]; say @a.perl;
19:40 camelia rakudo-moar 4fca94743: OUTPUT: «[[1],]␤»
19:40 Merfont joined #perl6
19:40 ugexe moritz: but if he wants the value its easier to grep at the end for .defined than to do another map to get the actual value
19:40 HoboWithAShotgun m: my @a = [[1,],]; say @a.elements;
19:40 camelia rakudo-moar 4fca94743: OUTPUT: «No such method 'elements' for invocant of type 'Array'␤  in block <unit> at <tmp> line 1␤␤»
19:40 AlexDaniel .elems
19:40 HoboWithAShotgun m: my @a = [[1,],]; say @a.elems;
19:40 camelia rakudo-moar 4fca94743: OUTPUT: «1␤»
19:41 HoboWithAShotgun ok, fine. it's still weird
19:41 Morfent joined #perl6
19:41 lizmat HoboWithAShotgun: that is what the GLR was all about
19:42 lizmat and this was discussed at length, for months, if not years
19:42 raschipi It was weirder before, right?
19:42 lizmat to figure out something that is consistent
19:42 HoboWithAShotgun hey, i am totally new to this
19:42 lizmat it was *not* consistent
19:42 lizmat before the GLR
19:42 lizmat there's even a signature for it
19:43 Cabanossi joined #perl6
19:43 * HoboWithAShotgun chuckles ( The Year of The Great List Refactor )
19:43 lizmat m: sub a(+@a) { @a }; dd a( (1,2,3) ); dd a( (1,2,3),(4,5,6) )
19:43 camelia rakudo-moar 4fca94743: OUTPUT: «[1, 2, 3]␤[(1, 2, 3), (4, 5, 6)]␤»
19:43 AlexDaniel HoboWithAShotgun: that's alright, but there's no reason to shout bad words :) To be fair I did that too yesterday, but that was because for a second I thought that I released 2017.10 with something really bad…
19:44 AlexDaniel HoboWithAShotgun: false alarm though :)
19:44 HoboWithAShotgun sounds like the opening credits of Babylon5
19:44 lizmat m: sub a(+@a) { @a }; dd a( (1,2,3) ); # note the (1,2,3) gets flattened, because it's the only parameter and Iterable
19:44 camelia rakudo-moar 4fca94743: OUTPUT: «[1, 2, 3]␤»
19:44 jast I didn't know Babylon 5 focused so much on refactoring
19:45 lizmat m: sub a(+@a) { @a }; dd a( (1,2,3),(4,5,6) )  # note that (1,2,3) and (4,5,6) do *not* get flattened, because there's now 2 Iterables given
19:45 camelia rakudo-moar 4fca94743: OUTPUT: «[(1, 2, 3), (4, 5, 6)]␤»
19:45 lizmat HoboWithAShotgun: ^^ hope that makes sense?
19:45 El_Che 2017.10 was already released?
19:45 AlexDaniel HoboWithAShotgun: FWIW there's at least one case where one argument rule leads to completely different behavior depending on the input… but I can't find a ticket for that
19:45 lizmat El_Che: yes, yesterday
19:46 El_Che ah crap, I missed that
19:46 AlexDaniel in fact there's 2017.10 star already, if I'm not mistaken
19:46 El_Che I saw a RC, so I thought it was a pre release
19:46 AlexDaniel ah, it may be
19:47 AlexDaniel El_Che: by the way, I pinged you right after the release :) https://irclog.perlgeek.de/perl6/2017-10-26#i_15359701
19:47 El_Che my bad
19:47 El_Che lets roll some new packages :)
19:47 AlexDaniel \o/
19:48 El_Che (I spent the time in between refactoring stuff, let's see if something broke :) )
19:49 El_Che funnu enough partly was converting smalls script from perl 5 to perl 6, and from bash to perl 5 :)
19:49 AlexDaniel El_Che: by the way, you can subscribe to perl6-compiler mailing list here: https://perl6.org/community/
19:50 Kyo91_ joined #perl6
19:50 El_Che I'll do that
19:50 AlexDaniel El_Che: (to receive release announcements)
19:53 El_Che I got some help for creating a JS page on github pages so I can always link to the latest stable build
19:53 El_Che that's handy
19:58 ryn1x joined #perl6
20:10 Mrofnet joined #perl6
20:11 raiph joined #perl6
20:13 Piotr_ joined #perl6
20:16 HoboWithAShotgun ah, guys, my cake turned out superduper. soft and moist and oozing chocolate
20:16 HoboWithAShotgun have some?
20:17 * lizmat starts saliving :-)
20:17 * lizmat loves verbing
20:18 * HoboWithAShotgun likes the term "slashdotting"
20:19 HoboWithAShotgun := solving a task/problem - by letting others do the work / - by blindly copying other peoples worjk
20:20 AlexDaniel .oO( also known as “open-source” )
20:22 HoboWithAShotgun actually i think i mixed that up with cargo-culting, what did slashdotting then mean again
20:23 timotimo getting featured on slashdot and your web server going down under the enormous traffic, that's slashdotting to me
20:30 as_ joined #perl6
20:31 geekosaur your web site/blog/whatever went viral and everyone's trying to load it at once
20:32 geekosaur also I have decided I don't like the way programmers sneer about 'cargi culting'
20:32 geekosaur like it or not, that's how the human brain works
20:33 mspo IT is heavily fashion driven
20:33 mspo that is reality
20:34 mspo marketing of technologies is weird but can pay off big time if you manage to start a trend
20:34 HoboWithAShotgun oh, i'm all for copying the closest existing piece of code and massage it into your needs, saves a lot of time sometimes
20:35 HoboWithAShotgun but: you must understand it.
20:35 geekosaur that's not the problem. the problem is the attitude we bring to it
20:36 mspo oh I was thinking of something else :)
20:37 perlpilot geekosaur: you think cargo culting is a pragmatic solution that we shouldn't look down upon?
20:37 geekosaur sigh
20:37 geekosaur what did I just say
20:38 perlpilot I dunno, that's why I'm asking for clarification.
20:38 geekosaur you may well be part of the problem then.
20:38 geekosaur 'cargo culting' is our natural way of understanding the world around us.
20:38 geekosaur guiding people to actually understand things is good,
20:39 geekosaur Being snotty about it is NOT.
20:39 perlpilot gotcha.
20:39 geekosaur and even the label is a severe put-down
20:39 lowin How do I read environment variables?
20:39 as_ %*ENV?
20:39 geekosaur m: say %*ENV<HOME>
20:39 camelia rakudo-moar 4fca94743: OUTPUT: «/home/camelia␤»
20:39 perlpilot lowin: they're in %*ENV
20:40 lowin perlpilot, I tried %*env<REMOTE_ADDR>
20:40 lowin throws an error
20:40 as_ lowercased
20:40 perlpilot lowin: "ENV" and "env" are not the same thing
20:40 lowin oh my bad
20:40 as_ hi, i have something about the new atomic operations
20:40 as_ why we neeed the utf character at all?
20:41 timotimo you don't need the character
20:41 as_ if the variable has to be declared as 'atomicint' anyway
20:41 as_ timotimo: what do you mean? ascii versions?
20:41 perlpilot as_: call it another hint.
20:41 as_ but it is hard to type
20:41 geekosaur as_, because you can operate on it normally as well if you don;t need the atomicity
20:42 geekosaur but to be atonic it *needs* to be stored a particular way
20:42 geekosaur *atomic
20:42 as_ i think if i need an atomic variable i would want perl to think about it, not me
20:42 geekosaur as well as the atomic op itself being special
20:42 as_ like "atomicint" forces all operations to be atomic
20:42 perlpilot as_: in this case *you* do need to think about it :)
20:42 Cabanossi joined #perl6
20:42 as_ that can be an acceptable tradeoff
20:42 geekosaur as_, but that is impossible
20:42 geekosaur most things perl 6 does cannot be atomic
20:43 as_ no. if i say "atomic" - what things cannot be atomic?
20:43 geekosaur they can be done under an atomic lock but they cannot themselves *be* atomic
20:44 jnthn as_: The ops are exposing low-level, hardware-provided, atomic operations.
20:44 as_ my atomicint $a; $a<ATOM>++     vs. my $i; $i++
20:44 timotimo you can't atomically divide, for example
20:44 geekosaur the only things that can be atomic are specific CPU operations with their specific restrictions
20:44 geekosaur perl 6 can expose this to some extent, but because it;s the hardware/CPU that controls it it will always be limited in any higher level language
20:45 as_ thread support is now very simple
20:45 jnthn lol
20:45 perlpilot as_: along one axis maybe
20:45 as_ but atomic operations are a bit more difficult syntactically
20:45 geekosaur so you think that can automatically be done for anything else?
20:45 jnthn Anyone who puts "thread" and "simple" in the same sentences hasn't done enough with threads ;-)
20:46 ifim joined #perl6
20:46 as_ jnth: for the user, not for you :)
20:46 geekosaur as_, perl 6 cannot rewire your CPU.
20:46 geekosaur *the CPU controls this*.
20:46 jnthn as_: There are function version if you don't want to type the atom :)
20:46 jnthn *versions
20:46 geekosaur languages do not. Operating systems do not.Programmers do not.
20:46 lowin Another stupid question. How can I get the size of an string in bytes?
20:46 perlpilot lowin: bytes or chars?
20:46 lowin bytes
20:47 as_ jnthn: i mean i don't want to type <ATOM> or its ASCII replacement as soon as i claimed the variable is an atomicint
20:47 perlpilot lowin: then you don't want a string
20:47 lowin What do I want then
20:47 geekosaur buf8
20:47 El_Che perl5 autodie is a new requirement of moar I see
20:48 [Coke] lizmat: I should go see Thor next week, yes?
20:48 jnthn lowin: A string can be represented in many different ways, (latin-1, utf8, utf16, etc.) and the number of bytes will differ.
20:48 bdmatatu joined #perl6
20:48 lizmat [Coke]: yeah, it's fun (mostly)
20:48 jnthn lowin: So you'd want to do $str.encode('utf-8').bytes for example
20:48 lowin jnthn, appreciate it. thanks
20:49 geekosaur lowin, despite what other languages may have mistaught you, a string is not a string. A string has a specific encoding and a specific representation (in perl 6, graphemes). it could also be Unicode codepoints, ISO8859 characters, etc.
20:49 lizmat [Coke]: definitely a more Guardians of the Galaxy feel than the previous Thor movies
20:49 jnthn as_: We can't do that, because native types don't actually knwo what kind of thing they are
20:49 [Coke] lizmat: cool. I've been super jazzed for it since the first trailer. :)
20:49 lizmat (and that includes using the Immigrant Song prominently in the movie)
20:49 as_ jnthn: ah - that explains (a bit)
20:49 jnthn as_: So we can't multi-dispatch on int vs atomicint for example
20:50 jnthn But also, from a language design perspective, we give different semantics different operators.
20:50 as_ jnthn: does it mean i can use simple 'int' and use atomic operations with it?
20:50 jnthn Thus + for numeric addition and ~ for string concat
20:50 * [Coke] gives up on $dayjob and goes on strike for 2 days!
20:50 geekosaur I am somewhat tempted to argue that atomicint should be a internal thing not part of perl 6 as such.
20:50 lizmat [Coke]: https://www.youtube.com/watch?v=8QxtIQ1F1ig # but you've probably already seen that
20:50 jnthn as_: You can...sort of. But atomic operations are restricted to the sizes the CPU can do them on
20:51 geekosaur [perl 6 might make visible synchronization/locking stuff at a higher level, whose implementation uses atomicint under the hood
20:51 jnthn as_: atomicint is simply an alias to whichever size is doing to work
20:51 jnthn uh, is *going* to work
20:51 lowin geekosaur, I come with C background. If you have asked me last week, I'd tell you "there is no such thing as a 'string', just an array of bytes packed together"
20:51 as_ cheers:)
20:51 jnthn So you can write portable code
20:51 geekosaur but you will get stuff like this where as_ thinks atomicint is a high level operation that can be treated in high level ways, when fandamrnally a raw CPU operation and you MUST do exactly and only what the CPU will permit
20:51 perlpilot Even with all the new Perl 6 books, it seems we need a few more
20:52 geekosaur *fundamentally it is a
20:52 cdg joined #perl6
20:52 [Coke] lizmat: heh. Nice, I hadn't seen that cut with just the song.
20:53 jnthn geekosaur: Well, it's a "make the hard things possible" kidna thing. I'd like it to be possible to implement lock-free data structures in Perl 6.
20:53 darkmorph joined #perl6
20:53 geekosaur yes. but that should be implementation layer not public layer
20:54 geekosaur because you cant make atomicint a proper Perl 6 type without breaking the CPU invariants
20:56 jnthn At the end of the day, though, we'd want to provide some standard way to access this functionality (that folks can use it their modules), and that'd mean it gets documented, and I'm not sure that sticking "this is implementation layer" and "this is public layer" in the docs will make a great deal of difference.
20:56 * [Coke] ghosts
20:56 jnthn *so that
20:57 wamba joined #perl6
20:58 lizmat El_Che: autodie needed for Moar ???
20:58 jnthn ah, gotta go away for a bit...bbl
20:58 timotimo lizmat: Configure.pl, if anything
20:58 timotimo or the exprjit compiler
20:58 El_Che lizmat: buildtime
20:58 cdg joined #perl6
20:58 El_Che it's new, I add to add it to the docker container
20:58 lizmat why would one need that as a prereq?   feels like unnecessary laziness to me
20:59 lizmat (from the person doing work on Configure.pl)
20:59 El_Che other distros had it already in the installed perl pkgs, centos splitted that
20:59 El_Che so it needed to be  added
20:59 lizmat ah, so it's not a recent change in Configure.pl causing this ?
20:59 El_Che it is
20:59 El_Che between 2017.09 en 10
21:00 El_Che lizmat: https://travis-ci.org/nxadm/rakudo-pkg/jobs/293846517#L869
21:00 El_Che (ignore the exit 0 result, and explicit exit 1 was missing on that build)à
21:01 lizmat if I look at Configure.pl, I don't see a mention of autodie in there?
21:02 timotimo probably under lib/
21:02 El_Che The same succesful build is here, for reference: https://travis-ci.org/nxadm/rakudo-pkg/jobs/293870092
21:02 lizmat tools/expr-template-compiler.pl
21:02 lizmat tools/jit-dump.pl
21:02 lizmat but those aren't needed for building ??
21:03 timotimo i think the template compiler only has to run for developers?
21:03 timotimo or do we not have the results from that ni our source tarballs?
21:03 El_Che I don't do any magic in the build
21:03 El_Che and autodie was not used in 2017.09
21:04 El_Che "cd /MoarVM*; perl Configure.pl --prefix=$PREFIX"
21:04 El_Che that's it
21:04 timotimo we don't check it into git i don't think
21:05 timotimo i *think* we could, but brrt will know for sue
21:05 timotimo sure*
21:05 lizmat the only two occurrences of autodie in the MoarVM tree are in those two files
21:05 El_Che These are the config parameters of that build: https://travis-ci.org/nxadm/rakudo-pkg/jobs/293846517#L670
21:05 lizmat changed in 2017-05-15 and 2017-07-18
21:06 lizmat ah, but they got merged between 2017.09 and 2017.10 perhaps ?
21:07 lizmat I would be in favour of removing the autodie dependency
21:09 mson joined #perl6
21:09 El_Che lizmat: did you say "remove the perl 5 dependency"? :P
21:09 lizmat no, autodie
21:09 El_Che kidding :)
21:09 lizmat perl 5 dependency removal is longer term
21:09 lizmat first we need nqp to be distributed everywhere :-)
21:10 El_Che world domination part
21:11 epony joined #perl6
21:12 mempko joined #perl6
21:13 setty1 joined #perl6
21:15 El_Che i wonder if someone uses my 386 packages. Is there a usecase for a slow rakudo?
21:16 El_Che if you need a tiny machine, there are faster solutions, I guess
21:16 * lizmat had her first 386 machine 29 years ago
21:17 El_Che All my target OS'es pass: https://travis-ci.org/nxadm/rakudo-pkg <--pkgs should be up shortly
21:17 ryn1x joined #perl6
21:17 geekosaur I can't even remember when. I do remember what, it was an Intel Inboard/386 card stuffed into an ITT XTRA
21:18 El_Che mine was 23j ago
21:18 El_Che wow
21:18 El_Che the faster consumer pc on the market for about 3 months
21:18 lizmat it was one the first on the NL
21:18 El_Che :)
21:18 lizmat market
21:19 lizmat Olivetti, with 4MB RAM  :-)
21:19 El_Che lizmat: an on other 1st in NL story? Wasn't that also the case with a mac?
21:19 lizmat and special floating point bug of the early 386 batches
21:19 lizmat I think so yes  :-)
21:20 lizmat I was also one of the first people in NL having functional email and IRC in 1977
21:20 El_Che I am feeling leet today, I have 3 open laptops at the moment :)
21:20 stmuk_ joined #perl6
21:20 El_Che lizmat: now you're showing off
21:20 El_Che :)
21:20 lizmat although they were called "personal notes" and "TERM-talk" at the time
21:21 perlpilot I don't think you had IRC in 1977
21:21 El_Che I was one of the first people I know around here, and that was 1994 :)
21:21 lizmat https://en.wikipedia.org/wiki/PLATO_(computer_system)
21:21 geekosaur bitnet relay chat? :p
21:21 El_Che here = "physical surroundings"
21:22 lizmat specifically: https://en.wikipedia.org/wiki/PLATO_(computer_system)#Online_community
21:22 geekosaur PLATO. now that's an old memory...
21:24 lizmat my distance record in chatting was from Amsterdam to Hawaii  :-)
21:24 miki76 joined #perl6
21:25 geekosaur (I didn't get to use it, in the 70s I was too busy trying to make sense of my broken internal communications to worry about someone else's >.> )
21:26 HoboWithAShotgun that's probably the nicest description for drug abuse i ever heard ^^
21:26 geekosaur noit drugs, sadly
21:26 geekosaur unless you want to count neurotransmitters without any outside interference
21:27 Piotr__ joined #perl6
21:28 lizmat geekosaur: glad you made it to #perl6 here and now nonetheless!
21:28 HoboWithAShotgun being able to willingly alter your brain chemistry, that'd be a huge advantage
21:29 geekosaur like anyone knww how to back then
21:29 geekosaur *knew
21:32 HoboWithAShotgun like anyone does know today
21:33 HoboWithAShotgun i don't mean by taking pills or so. i mean by willing it.
21:38 hoelzro joined #perl6
21:51 HoboWithAShotgun m: use Test; throws-like { fail "something happened" }, Exception, message => /something \s happened/;
21:51 camelia rakudo-moar 4fca94743: OUTPUT: «    1..3␤    ok 1 - code dies␤    ok 2 - right exception type (Exception)␤    ok 3 - .message matches /something \s happened/␤ok 1 - did we throws-like Exception?␤»
21:51 HoboWithAShotgun m: use Test; throws-like { fail "something happened" }, Exception, message => m:s/something happened/;
21:51 camelia rakudo-moar 4fca94743: OUTPUT: «Use of uninitialized value of type Any in string context.␤Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.␤  in block <unit> at <tmp> line 1␤    1..3␤    ok 1 - code dies␤    ok 2 - right exception t…»
21:51 HoboWithAShotgun m: use Test; throws-like { fail "something happened" }, Exception, message => :s/something happened/;
21:51 camelia rakudo-moar 4fca94743: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Missing required term after infix␤at <tmp>:1␤------> 3ption, message => :s/something happened/7⏏5;␤    expecting any of:␤        prefix␤        term␤»
21:52 HoboWithAShotgun m: use Test; throws-like { fail "something happened" }, Exception, message => /something happened/:s;
21:52 camelia rakudo-moar 4fca94743: OUTPUT: «5===SORRY!5===␤You can't adverb ␤at <tmp>:1␤------> 3ption, message => /something happened/:s7⏏5;␤    expecting any of:␤        pair value␤Other potential difficulties:␤    Space is not significant here; please use quotes or :s…»
21:52 HoboWithAShotgun arrrgh
21:52 * HoboWithAShotgun resorts to the docs
21:53 Zoffix joined #perl6
21:53 Zoffix HoboWithAShotgun: use rx instead of ?
21:53 Zoffix *m
21:54 Zoffix 'm' matches immediatelly against $_
21:54 geekosaur ^
21:54 Zoffix alternatively, put :s inside regex
21:54 geekosaur also the :s goes inside
21:54 geekosaur with that form
21:54 HoboWithAShotgun m: use Test; throws-like { fail "something happened" }, Exception, message => m:s/something happened/;
21:54 camelia rakudo-moar 4fca94743: OUTPUT: «Use of uninitialized value of type Any in string context.␤Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.␤  in block <unit> at <tmp> line 1␤    1..3␤    ok 1 - code dies␤    ok 2 - right exception t…»
21:54 geekosaur (with rx it goes on the 'rx')
21:54 HoboWithAShotgun m: use Test; throws-like { fail "something happened" }, Exception, message => rx:s/something happened/;
21:54 camelia rakudo-moar 4fca94743: OUTPUT: «    1..3␤    ok 1 - code dies␤    ok 2 - right exception type (Exception)␤    ok 3 - .message matches rx:s/something happened/␤ok 1 - did we throws-like Exception?␤»
21:55 HoboWithAShotgun m: say "x y" ~~ m:s/x y/
21:55 camelia rakudo-moar 4fca94743: OUTPUT: «「x y」␤»
21:55 HoboWithAShotgun i'm missing something
21:56 HoboWithAShotgun m: use Test; throws-like { fail "something happened" }, Exception, message => rx/:ssomething happened/;
21:56 camelia rakudo-moar 4fca94743: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Unrecognized regex modifier :ssomething␤at <tmp>:1␤------> 3 happened" }, Exception, message => rx/:7⏏5ssomething happened/;␤»
21:56 HoboWithAShotgun inside?
21:56 geekosaur ~~ is a special form, not a normal operator. so m// or // works there only because of that special form
21:56 Zoffix ~~ thunks; in that form it doesn't gey run until $_ is already aliased
21:56 geekosaur /:s x y/
21:56 HoboWithAShotgun m: use Test; throws-like { fail "something happened" }, Exception, message => /:s something happened/;
21:56 camelia rakudo-moar 4fca94743: OUTPUT: «    1..3␤    ok 1 - code dies␤    ok 2 - right exception type (Exception)␤    ok 3 - .message matches /:s something happened/␤ok 1 - did we throws-like Exception?␤»
21:57 Zoffix HoboWithAShotgun: yes inside, but separate it from stutf
21:57 HoboWithAShotgun ahh
21:57 HoboWithAShotgun tyvm
21:58 Zoffix left #perl6
21:59 ryn1x joined #perl6
22:01 ifim` joined #perl6
22:15 coda joined #perl6
22:18 HoboWithAShotgun m: my @a = 1,4,3; my @b = 3,4,1; say (@a <<~~>> @b).grep({$_}).elems;
22:18 camelia rakudo-moar 4fca94743: OUTPUT: «1␤»
22:18 margeas joined #perl6
22:18 HoboWithAShotgun m: my @a = 1,4,3; my @b = 3,4,1; say (@a <<~~>> @b).grep(*).elems;
22:18 camelia rakudo-moar 4fca94743: OUTPUT: «3␤»
22:19 HoboWithAShotgun m: my @a = 1,4,3; my @b = 3,4,1; say (@a <<~~>> @b).grep(* ~~ True).elems;
22:19 camelia rakudo-moar 4fca94743: OUTPUT: «Potential difficulties:␤    Smartmatch against True always matches; if you mean to test the topic for truthiness, use :so or *.so or ?* instead␤    at <tmp>:1␤    ------> 3b = 3,4,1; say (@a <<~~>> @b).grep(* ~~ 7⏏5True).elems;␤3␤»
22:19 HoboWithAShotgun m: my @a = 1,4,3; my @b = 3,4,1; say (@a <<~~>> @b).grep(*.so).elems;
22:19 camelia rakudo-moar 4fca94743: OUTPUT: «1␤»
22:20 HoboWithAShotgun helpful error messages++
22:22 * HoboWithAShotgun facepalms and replaces ( @$.si-signature Z @$signature ).grep({ $_[0] != $_[1] }).elems == 0; by
22:22 HoboWithAShotgun @$.si-signature ~~ @$signature
22:23 HoboWithAShotgun this was 3 at night code to my defense :)
22:25 niceperl joined #perl6
22:36 El_Che I must say, build time of rakudo seems to be a lot faster nowadays. Did they get faster cpus, or did you guys/gals did a great job? :)
22:37 El_Che creating a docker image of the latest ubuntu + compilation + packaging of rakudo 2017.10= 7 min 25sec
22:38 El_Che https://github.com/nxadm/rakudo-pkg/releases/tag/v2017.10
22:42 Cabanossi joined #perl6
22:52 tbrowder still looking for an emacs replacement: has anyone used ultraedit? looks like a good unicode editor, and customizable for p6.
22:53 tbrowder not free, but powerful per their site docs
22:53 El_Che tbrowder: my windows colleagues seemed to liked it 5j ago
22:53 El_Che although pretty basic
22:54 tbrowder their latest release was august.
22:54 El_Che ah, I didn't know they had mac and linux versions
22:55 tbrowder 30-day free trial, paid license alloes use on 3 machines, works on win, linux, and mac
22:56 El_Che what os do you run?
22:57 tbrowder linux mostly (debian 8) on laptops and remote server, windows for wife and rest of family
22:58 El_Che and you code on all those machines or just the linux ones? == do you need a OS independent editor
22:59 tbrowder er, i admit i use win for some things, but i don’t code on it.
23:00 El_Che :)
23:02 margeas joined #perl6
23:05 callyalater joined #perl6
23:06 callyalater m: sub a(Regex $r1) { return rx/ <$r1> a / }; my regex letter_b { b };  my $new = a(&letter_b); say $new; "ba" ~~ $new; "ca" ~~ $new; say so "ba" ~~ $new; say so "ca" ~~ $new;
23:06 camelia rakudo-moar 4fca94743: OUTPUT: «rx/ <$r1> a /␤True␤False␤»
23:07 callyalater m: sub a(Regex $r1) { return rx/ <$r1> a / }; my regex letter_b { b };  my $new = a(&letter_b); say $new; say "ba" ~~ $new; say "ca" ~~ $new; say so "ba" ~~ $new; say so "ca" ~~ $new;
23:07 camelia rakudo-moar 4fca94743: OUTPUT: «rx/ <$r1> a /␤「ba」␤Nil␤True␤False␤»
23:10 callyalater m: say ""; sub postfix:<!> (Int $n) { [*] 2..$n; }; say "{6!}";
23:10 camelia rakudo-moar 4fca94743: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Negation metaoperator not followed by valid infix␤at <tmp>:1␤------> 3ix:<!> (Int $n) { [*] 2..$n; }; say "{6!7⏏5}";␤    expecting any of:␤        infix␤        infix stopper␤»
23:10 callyalater m: sub postfix:<!> (Int $n) { [*] 2..$n; }; say ""; say "{6!}";
23:10 camelia rakudo-moar 4fca94743: OUTPUT: «␤720␤»
23:14 callyalater left #perl6
23:15 cpage_ joined #perl6
23:17 margeas joined #perl6
23:23 Geth ¦ doc: dfca757ae8 | (Tom Browder)++ (committed using GitHub Web editor) | doc/Programs/01-debugging.pod6
23:23 Geth ¦ doc: fix broken link
23:23 Geth ¦ doc: review: https://github.com/perl6/doc/commit/dfca757ae8
23:23 ryn1x joined #perl6
23:41 ryn1x joined #perl6
23:48 HoboWithAShotgun i am missing something trying to implement == for my role. I have this infix: https://hastebin.com/cetumowoda.pl
23:49 HoboWithAShotgun my testcase is simple: ok !(12V == 12A)
23:50 HoboWithAShotgun but that prints "== 12A, 12A" twice
23:50 HoboWithAShotgun so the sub gets called twice, always both operands being identical
23:50 HoboWithAShotgun that's not what i expected
23:51 Zoffix joined #perl6
23:51 Zoffix HoboWithAShotgun: what was the expected behaviour?
23:52 HoboWithAShotgun I would expect seing "== 12V, 12A", once
23:53 Zoffix HoboWithAShotgun: which candidate does callwith() call?
23:54 HoboWithAShotgun i *thought* callwidth calls the == of Int
23:55 HoboWithAShotgun because $a and $b are Ints Doing Unit::SI
23:56 Zoffix What does nextcallee.file say?
23:57 HoboWithAShotgun but even if that is wrong, it doesnt explain why i see the same value for $a and $b
23:57 HoboWithAShotgun let me quickly put that on github
23:57 Cabanossi joined #perl6
23:58 Zoffix nqp: class Foo { has %!quote_lang_cache; method x() { %!quote_lang_cache{'x'} := 42; say(nqp::existskey(%!quote_lang_cache, 'x')) } }; Foo.new.x()
23:58 camelia nqp-moarvm: OUTPUT: «1␤»
23:58 Zoffix nm, brainfart
23:59 Zoffix Oh wait no. How come nqp code is doing `my %quote_lang_cache := nqp::hash();` ? Why assign nqp::hash?

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

Perl 6 | Reference Documentation | Rakudo