Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-08-26

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 Cabanossi joined #perl6
00:11 BenGoldberg joined #perl6
00:12 BenGoldberg joined #perl6
00:13 skids Hrm.  I have an inexplicable situation.  Essentially I have this in nqp: nqp::say("1"); try { thing }; nqp::say("2"); ...inside a few loops in some MetaModel core code.   when run, It hangs printing a lot of "2"'s and no "1"s.
00:20 tbrowder hi #perl6
00:20 skids o/
00:22 BenGoldberg joined #perl6
00:23 tbrowder i'm trying to install module SSH::LibSSH (with zef) and get a failure expecting MAST::Frame which can't be found and i don't find it in the ecosystem
00:23 skids It seems to be running the try over and over again... I can get a CATCH block to output interleaved with the "2"s.
00:25 tbrowder skids: hello!
00:26 skids nqp/MoarVM/lib/MAST/Nodes.nqp is where MAST::Frame comes from.
00:26 skids Maybe your nqp has come unsynced with your rakudo?
00:40 ramortegui joined #perl6
00:45 Cabanossi joined #perl6
00:46 pilne joined #perl6
00:48 idiosyncrat joined #perl6
00:48 skids OK, so it seems what happened was a subsequent exception after the "try" thought it was in the "try" and control flow skipped back to the try block.
00:50 idiosyncrat left #perl6
00:57 MasterDuke skids: that's...interesting...
00:58 skids Kinda hard to golf the whole MetaModel though :-)
01:00 Kyo91_ joined #perl6
01:15 Cabanossi joined #perl6
01:28 cdg joined #perl6
01:51 ilbot3 joined #perl6
01:51 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:51 cdg joined #perl6
02:00 greppable6 joined #perl6
02:01 Geth ¦ doc/master: 4 commits pushed by (Will "Coke" Coleda)++
02:01 Geth ¦ doc/master: 9929ca95d1 | new vocab
02:01 Geth ¦ doc/master: a2aa3b9bc6 | Don't complain about the Perl 6 in --version
02:01 Geth ¦ doc/master: 90b6fd5166 | Use nbsp*
02:01 Geth ¦ doc/master: 489d9e6eb5 | fix typo
02:01 Geth ¦ doc/master: review: https://github.com/perl6/doc/compare/3556160fd8...489d9e6eb5
02:01 piojo joined #perl6
02:02 u-ou- joined #perl6
02:07 [Coke] m: $*ERR=Nil; note 3;
02:07 camelia rakudo-moar d0a5cf: OUTPUT: «No exception handler located for catch?   at SETTING::src/core/Exception.pm:395  (/home/camelia/rakudo-m-inst-2/share/perl6/runtime/CORE.setting.moarvm:print_exception)? from SETTING::src/core/Exception.pm:452  (/home/camelia/rakudo-m-inst-2/share/pe…»
02:25 skids eh... I know I didn't just fix all those TODOs... what's the roast branch to spectest on these days?
02:26 [Coke] in "multi sub", the "sub" is optional. Ditto "proto sub" ?
02:26 skids Yes and I think so.
02:26 MasterDuke skids: should be just master
02:27 skids Oh... is 6.c.errata dead now?
02:28 skids src/core/List.pm:proto flat(|) {*}  # Well, it's gotten away with here at least
02:28 MasterDuke no, but new tests are added to master
02:31 [Coke] errata is for changes that differ from the original christmas release, but hopefully in ways that clarify or reduce other issues.
02:32 [Coke] like, if a test incorrectly checked exception test or that something threw adhoc, instead of a specific exception, e.g.
02:34 noganex joined #perl6
02:40 Geth ¦ doc/coke/multi: 58dbd77e6b | (Will "Coke" Coleda)++ | xt/examples-compilation.t
02:40 Geth ¦ doc/coke/multi: add test to avoid multi sub
02:40 Geth ¦ doc/coke/multi: review: https://github.com/perl6/doc/commit/58dbd77e6b
02:40 Geth ¦ doc/coke/multi: 028f2bbcc9 | (Will "Coke" Coleda)++ | 34 files
02:40 Geth ¦ doc/coke/multi: avoid multi sub
02:40 Geth ¦ doc/coke/multi: review: https://github.com/perl6/doc/commit/028f2bbcc9
02:43 Actualeyes joined #perl6
02:53 u-ou- joined #perl6
02:54 skids At long last, I have reworked my rolevolution patch: https://gist.github.com/skids/18fa6fb1de776400abd43b6e82e9fcc2
02:59 cdg joined #perl6
03:00 travis-ci joined #perl6
03:00 travis-ci Doc build failed. Will "Coke" Coleda 'avoid multi sub'
03:00 travis-ci https://travis-ci.org/perl6/doc/builds/268586063 https://github.com/perl6/doc/compare/58dbd77e6bdf^...028f2bbcc929
03:00 travis-ci left #perl6
03:00 buggable [travis build above] ? Did not recognize some failures. Check results manually.
03:06 u-ou- joined #perl6
03:15 Cabanossi joined #perl6
03:23 u-ou- joined #perl6
03:37 Ven`` joined #perl6
03:53 raschipi joined #perl6
03:57 todd joined #perl6
03:59 piojo joined #perl6
03:59 Cabanossi joined #perl6
04:02 todd Hi All, it is imperative that I get a program going to email me status reports on a RAID assembly (Fedora 26 Linux).  Because of https://github.com/retupmoca/P6-Net-SMTP/issues/17 I can not eMail through Perl6's Net::SMTP.  I do not want to call mailx and I really, really do not want more Perl 5 code to maintain.  I was thinking my best route to eMail would be calling the system's Email::Sender::Transport::SMTP.  Do you guys have an easie
04:08 cdg joined #perl6
04:14 Juerd On a typical Unix-like system, the easiest and most reliable way to send email from scripts is to let the MTA handle it. Practically every system with an MTA will have a /usr/sbin/sendmail that will inject a message into the right spooler.
04:15 Juerd The MTA then handles SMTP to send it to a remote host. If the system does not have an MTA yet, and you're root, you could install ssmtp, which is a dummy MTA which will just send everything to a smarthost over SMTP.
04:15 skids Try an P5 module via Inline::Perl5 maybe?
04:20 todd I still look at ssmtp as this is an secure smtp problem with Net::SMTP.   I have the WORST luck trying to use Inline::Perl5.
04:23 Juerd with run(:in, </usr/sbin/sendmail -t -oi>).in { .print: "To: foo@example.org\nFrom: bar@example.com\nSubject: example\n\nHello, world!"; .close }
04:24 Juerd Just be aware that newlines in headers create new headers (unless folded) so be careful with unknown strings in the headers :)
04:25 todd where does the message body go?
04:25 Juerd todd: Just to avoid confusion: with ssmtp I meant https://wiki.debian.org/sSMTP -- i.e. simple smtp, not secure smtp
04:25 Juerd simple smtp does support secure smtp though :)
04:26 Juerd afk  # off to bed, 6:26 am here...
04:26 todd this thing needs to talk ssl on port 465
04:35 mr-foobar joined #perl6
04:37 skids Are you using ::Simple or ::Raw?
04:41 todd Net::SMTP
04:41 todd will look at what modules I import
04:41 todd use Net::SMTP; use Email::MIME;
04:42 skids Are you passing :raw to .new?
04:42 todd my $client = Net::SMTP.new(:server( $smtp ), :port( $port ), :ssl, :starttls, :debug( 1 ) )
04:42 todd don't think so.
04:43 skids Ok, maybe there's someting that can be done... looking.
04:43 todd https://github.com/retupmoca/P6-Net-SMTP/issues/17  crashes on port 465 with smtp.zoho.com
04:44 todd error:1408F119:SSL routines:SSL3_GET_RECORD:decryption failed or bad record mac
04:44 todd here is a three liner to simulate the crash
04:45 todd #!/usr/bin/env perl6 use Net::SMTP; my $client = Net::SMTP.new( :server( "smtp.zoho.com" ), :port( 465 ), :ssl, :starttls, :debug( 1 ) );
04:45 skids Yeah it's because the protocol version is not being set, I think.  OpenSSL:: has an option for that, IO::Socket::SSL not so much.  But it could also be the libssl version on that system.
04:46 skids There are a few other similar bug reports on those packages.
04:46 todd believe it or not, mailx works.
04:55 wamba joined #perl6
05:01 skids First IO::Socket::SSL needs to support passing extra options to OpenSSL::.  Then Net::SNMP needs to support passing extra options to IO::Socket::SSL.  Both of the latter could use a good dose of interface consistency and dependency injection.
05:02 todd Can I alter my code to support this?
05:03 skids Unfortunately it would be a lot of copy and paste, as the call to OpenSSL.new is hidden in a monolithic private method.
05:03 todd Is there a way to waeve that into the three liner I sent?
05:04 skids Hah, no :-)
05:04 todd okay.  How do I can the system's Email::Sender::Transport::SMTP ?
05:07 mr-foobar joined #perl6
05:09 todd call not can
05:09 skids One of the github issue users says starttls worked for him... hmmm.
05:10 todd port 465?
05:11 todd my $client = Net::SMTP.new( :server( "smtp.zoho.com" ), :port( 465 ), :starttls, :debug( 1 ) );
05:11 todd just hangs
05:13 skids No I guess I'm reading that wrong.  It looks like you get that SSL3 message if you connect to a plain connection and try to do ssl: https://github.com/sergot/io-socket-ssl/issues/17 https://github.com/sergot/openssl/issues/22 (That is for XMMS but TLS is TLS no matter what you are running over it)
05:14 skids Oh I guess your error is a bit different.
05:16 todd How about a call to a C module (enter the "dark side")?
05:17 todd Tha time out finally came bac:
05:17 todd <==  Start argument to substr out of range. Is: 3, should be in 0..0; use *-3 if you want to index relative to the end   in method get-response at /home/tony/.perl6/sources/C7BFE131D057F94A1EC6C5CBF4DFC8C731D85400 (Net::SMTP::Raw) line 13   in method start at /home/tony/.perl6/sources/B0AFFC7E1CD3A465D71AF333700CF7086E4870E5 (Net::SMTP::Simple) line 59   in method new at /home/tony/.perl6/sources/AF0C4F60F05B28648456130019BA1D9C3B2FE938 (
05:20 Guest69863 joined #perl6
05:21 skids https://github.com/sergot/openssl/issues/1 shows that SSL3 error, but supposedly OpenSSL:: had it fixed in issues 34 and 35.
05:24 skids Yeah the rest of those errors are just garbage left over from not handling the original error.
05:28 todd is zef now support on Fedora 26's repo, or do I still have to github it?  It does not show up on pbone or dnf
05:28 skids I dunno I do all my Perl6 stuff with git.
05:30 todd I try to stay with the repo's if I can
05:31 skids Have you tried openssl s_client -connect <mailhost>:465 to verify it is not some problem on the system?
05:32 todd will try.  But I do communicate with this server over tls and Thunderbird
05:32 skids ah.
05:32 todd openssl s_client -connect mail.zoho.com:465
05:32 todd hangs
05:32 todd poop!
05:32 skids Should... until you EHLO.
05:33 todd still hangs
05:34 skids ^D?
05:35 todd what does ^D? mean?
05:35 preaction Ctrl+D
05:36 mr-foobar joined #perl6
05:36 skids control-d.  Should close the connection.  If it doesn't then you really are hung and not just spinning in a protocol.
05:38 todd I am ssh'ed into a fully updates Fedora 26 server.  I am trying to zef in the pieces needed for my three line crash test
05:40 TreyHarris joined #perl6
05:41 todd zef is having fun insatlling Net::SMTP
05:41 todd Searching for missing dependencies: Email::Simple, MIME::Base64, Digest::HMAC, Digest, IO::Socket::SSL
05:42 skids Did s_client say anything at all?
05:42 todd no
05:43 todd over on the f26 server, my $client = Net::SMTP.new( :server( "smtp.zoho.com" ), :port( 465 ), :starttls, :debug( 1 ) );
05:43 todd gives
05:44 todd Type check failed in binding to parameter '@seps'; expected Positional but got Str ("\r\n")   in method get at /usr/lib64/perl6/site/sources/AF0C4F60F05B28648456130019BA1D9C3B2FE938 (Net::SMTP) line 24   in method get-response at /usr/lib64/perl6/site/sources/C7BFE131D057F94A1EC6C5CBF4DFC8C731D85400 (Net::SMTP::Raw) line 11   in method start at /usr/lib64/perl6/site/sources/B0AFFC7E1CD3A465D71AF333700CF7086E4870E5 (Net::SMTP::Simple) line
05:44 Cabanossi joined #perl6
05:45 skids Wasn't starttls on 587?
05:45 todd oops, uncomment the wrong line
05:46 todd my $client = Net::SMTP.new( :server( "smtp.zoho.com" ), :port( 465 ), :ssl, :debug( 1 ) );
05:46 todd Cannot locate native library 'libssl.so': libssl.so: cannot open shared object file: No such file or directory   in method setup at /usr/lib64/perl6/sources/24DD121B5B4774C04A7084827BFAD92199756E03 (NativeCall) line 316   in method CALL-ME at /usr/lib64/perl6/sources/24DD121B5B4774C04A7084827BFAD92199756E03 (NativeCall) line 328   in method new at /usr/lib64/perl6/site/sources/685BE85E0DDBD365D590D9B90C50E58E76D0AB36 (OpenSSL) line 36   i
05:47 skids Missing symlink or something would be my guess.
05:47 todd my $client = Net::SMTP.new( :server( "smtp.zoho.com" ), :port( 587 ), :starttls, :debug( 1 ) );
05:48 todd Type check failed in binding to parameter '@seps'; expected Positional but got Str ("\r\n")   in method get at /usr/lib64/perl6/site/sources/AF0C4F60F05B28648456130019BA1D9C3B2FE938 (Net::SMTP) line 24   in method get-response at /usr/lib64/perl6/site/sources/C7BFE131D057F94A1EC6C5CBF4DFC8C731D85400 (Net::SMTP::Raw) line 11   in method start at /usr/lib64/perl6/site/sources/B0AFFC7E1CD3A465D71AF333700CF7086E4870E5 (Net::SMTP::Simple) line
05:48 todd symlink to where?
05:48 skids some filename libssl is hiding as, with a bunch of numbers after the libssl :-)
05:49 leont joined #perl6
05:50 skids Anyway I should have gone to bed 2 hours ago.  Good luck.  Sorry I can;t keep my eyes open at this point.
05:50 todd thank you for the help!
05:50 todd I have to go too
06:06 mr-foobar joined #perl6
06:40 mr-foobar joined #perl6
06:44 Cabanossi joined #perl6
06:45 lizmat joined #perl6
07:05 |oLa| joined #perl6
07:06 |oLa|1 joined #perl6
07:08 lizmat joined #perl6
07:14 Cabanossi joined #perl6
07:27 Skarsnik joined #perl6
07:28 Skarsnik hello
07:32 lizmat Skarsnik o/
07:43 ufobat joined #perl6
08:03 espadrine joined #perl6
08:20 nadim joined #perl6
08:21 Skarsnik hm https://travis-ci.org/perl6/DBIish/builds/268607217 is that a zef issue§
08:24 cdg joined #perl6
08:36 araraloren joined #perl6
08:41 Exodist joined #perl6
08:48 timotimo yeah, that rakudo is too old
08:49 timotimo but the latest rakudo version has trouble, too
08:50 Skarsnik oh not the same error
08:51 timotimo yeah
08:51 Skarsnik damn everything fail
08:52 Skarsnik did it worked for the star release?
08:52 timotimo it should, no?
08:57 nadim joined #perl6
08:57 smls joined #perl6
08:58 Exodist joined #perl6
08:58 lizmat joined #perl6
08:58 smls Is  http://perl6.fail  down for everyone?
08:59 Skarsnik http://isup.me/
08:59 Skarsnik but yes
09:00 smls Zoffix runs that page, right? Is it planned downtime?
09:01 smls (It's very helpful for browsing Rakudo tickets...)
09:02 Skarsnik i should have a vm/chroot set for dbiis
09:02 Kyo91_ joined #perl6
09:04 timotimo i believe zoffix stopped renewing the extra domains he got
09:08 Skarsnik working with one hand is annoying x)
09:11 atroxaper joined #perl6
09:12 Exodist joined #perl6
09:13 atroxaper Hello!
09:15 atroxaper I try Dancer2 with Inline::Perl5. It works well. Do somebody know how I can run "perl6 app.p6" as a daemon. I mean perl6's process closed when I close shell.
09:17 mr-foobar joined #perl6
09:19 smls timotimo: Is it available under a different domain?
09:27 atroxaper I found 'setsid'! :))
09:35 Skarsnik timotimo, sry too tired to look at dbiish :(
09:43 timotimo smls: not entirely sure
09:44 timotimo trying to at the same time get something presentable for a lightning talk and pay attention to jnthn's talk
09:44 timotimo i think i'll close my laptop and watch attentively instead of struggling with my code :D
09:48 emo joined #perl6
09:48 cdg joined #perl6
09:51 lizmat joined #perl6
09:52 setty1 joined #perl6
10:09 darutoko joined #perl6
10:14 Cabanossi joined #perl6
10:16 nadim hi, weird error message: Type check failed in binding to parameter 'val2'; expected Any but got Mu (Mu). The line looks like: multi method get_elements (Stash $s) { $s.sort(*.key)>>.kv.map: -> ($k, $v) {$k, ' => ', $v} }  I am a bit lost
10:16 nadim passed test before I pulled the latest rakudo
10:22 rindolf joined #perl6
10:24 lichtkind joined #perl6
10:28 timotimo got a fix
10:29 timotimo but now it's lunch time and i have to go
10:29 timotimo https://gist.github.com/timo/805ace7f4fbd7d88a596c8f4473adc2a test this please
10:29 timotimo bye
10:29 samcv hmm trying to see if this setup i did for travis so it will capture core dumps from a segfault and then have gdb print a backtrace afterward
10:30 samcv but it's not triggering. so i guess i will have to just write something to force it to trigger
10:36 mr-foobar joined #perl6
10:46 samcv hmm anyone have any clue why *this* is happening https://travis-ci.org/samcv/MoarVM/jobs/268644978#L1073
10:46 samcv hmm ah maybe i haven't pushed the tags to my branch
10:46 samcv that's it :)
10:52 Exodist joined #perl6
10:56 Ven`` joined #perl6
10:57 smls m: say ((Mu) => 42).kv;
10:57 camelia rakudo-moar 6cec6b: OUTPUT: «Type check failed in binding to parameter 'val1'; expected Any but got Mu (Mu)?  in block <unit> at <tmp> line 1??»
10:57 smls nadim: ^^ golfed
10:58 smls A bug in type `Pair`, it seems.
11:02 margeas joined #perl6
11:03 smls bisectable6:  say ((Mu) => Mu).kv;
11:03 bisectable6 smls, Bisecting by exit code (old=2015.12 new=6cec6b7). Old exit code: 0
11:03 bisectable6 smls, bisect log: https://gist.github.com/03a10377df0b3e0409eaa69330750868
11:03 bisectable6 smls, (2017-08-13) https://github.com/rakudo/rakudo/commit/30584dac2fe231038c5bea557946a41310e9fd0f
11:06 mr-foobar joined #perl6
11:11 smls nadim: I reported the bug as RT #131962
11:11 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=131962
11:11 smls In the meantime, you can work around it by replacing `.kv` with `.&{.key, .value}`
11:12 smls Or by destructuting the `Pair`s inside the signature, like  `-> (:key($k), :value($v))`  or  `-> (:$key, :$value)`
11:18 smls *destructuring
11:21 smls Ah, sorry, I didn't realize that ?timotimo?'s fix referred to this very issue.
11:22 nadim smis++
11:22 nadim And I didn't realize either, thought he was talking to you
11:23 nadim How dow one clean the rakudo build artefacts?  a make clean didn't do the trick, subsequend build did fail (when I was trying to find which version was buggy)
11:24 MasterDuke make realclean frequently is more aggresive
11:25 Exodist joined #perl6
11:26 Skarsnik add a test for this pair bug? :)
11:27 moritz git clean -xdf # fairly aggressive, works always
11:28 nadim moritz: that seems to be needed, reminds me how much make can suck sometimes
11:31 nadim What would be really nice is if the error message points at where the error is (Rakudo) rather than where the error originate (my code) is there a way to get that?
11:32 smls nadim:   perl6 --ll-exception -e 'say ((Mu) => Mu).kv;
11:33 smls Which points to src/core/Rakudo/Iterator.pm:3064, which seems to be exactly the line that timotimo changed in that diff.
11:34 nadim I'm building the patched version, I'll keep that in mind next time I have so weird error.
11:35 Exodist joined #perl6
11:40 Exodist joined #perl6
11:43 lizmat joined #perl6
11:47 nadim Patch does not work, still the same error, or I did something wrong.
11:53 nadim but using .&{.key, .value} does
11:53 nadim timotimo: ^^
11:58 moritz m: say ((Mu) => Mu).kv
11:58 camelia rakudo-moar 6cec6b: OUTPUT: «Type check failed in binding to parameter 'val1'; expected Any but got Mu (Mu)?  in block <unit> at <tmp> line 1??»
11:59 Cabanossi joined #perl6
12:01 nine atroxaper: I usually just let systemd start my daemons
12:02 nine Very exciting: http://mi.cro.services/
12:03 nattefrost joined #perl6
12:09 timotimo probably needs an exact same change a few lines below
12:17 moritz nine: what, we have HTTP/2 in Perl 6? I never know
12:20 moritz *knew
12:20 moritz no mention of a license or link to sources though :(
12:23 nine jnthn promised to upload today :) License is Artistic 2
12:23 moritz https://github.com/croservices/
12:23 Aaronepower joined #perl6
12:25 smls bisectable6:  await do for ^20 { start dir("/").eager }
12:25 bisectable6 smls, Bisecting by exit code (old=2015.12 new=6cec6b7). Old exit code: 1
12:25 bisectable6 smls, bisect log: https://gist.github.com/97d96022fdfed416e67ecadf5b2b9353
12:25 bisectable6 smls, (2017-08-15) https://github.com/rakudo/rakudo/commit/231cb3f5fe8f024ce1a3694560a4cf50ec570b9d
12:26 smls \o/
12:26 smls Looks like this commit by jnthn++ fixed RT #129845
12:26 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=129845
12:26 smls Is there a way to write a spectest for something like this?
12:27 smls I mean the test-case pretty much always failed before, but was still probabilistic...
12:37 lizmat joined #perl6
12:37 moritz I guess dir('/') won't work on windows?
12:41 sena_kun joined #perl6
12:42 araraloren_ joined #perl6
12:44 Cabanossi joined #perl6
12:45 Geth ¦ ecosystem: 05dad74a71 | Altai-man++ (committed using GitHub Web editor) | META.list
12:45 Geth ¦ ecosystem: Add cro to the ecosystem
12:45 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/05dad74a71
12:51 woolfy joined #perl6
12:52 andrzejku_ joined #perl6
12:53 [Coke] moritz: need a test on win64?
12:54 smls moritz:  The test only needs `dir()` to construct a bunch of IO::Paths, it doesn't need to be directory /
12:56 smls So the test could create a temporary directory with a bunch of files in it, and use that...
12:59 moritz smls: or simply run dir('.')
12:59 smls My question was more regarding the probabilistic nature of the bug. I.e. are flappy spectests allowed if the false positives are rare?
13:00 moritz flappy tests are mostly unwanted, and should be skipped
13:00 moritz but once the bug is fixed, they shouldn't flap anymore
13:00 smls yes, now the test reliably passes
13:01 smls But if that part of Rakudo is ever broken again, the test could conceivably only fail 99% of the time instead of 100% of the time...
13:02 moritz that's fine
13:02 smls ok
13:02 moritz we'll notice a 0% -> 99% failing quote, I hope :-)
13:04 smls moritz: What path will `dir(.)` be during a spectest run?
13:04 smls eh, `dir('.')`
13:14 woolfy left #perl6
13:20 BenGoldberg joined #perl6
13:20 ChoHag joined #perl6
13:21 moritz smls: rakudo's source tree
13:21 smls ok
13:27 nine I'd rather people wouldn't make that assumption
13:27 nine A slightly better version would be "a source tree of a Perl 6 implementation", but not assuming anything at all would be much better still
13:38 sumdoc joined #perl6
13:39 sumdoc Is there any data structure in perl6 like set in python that doesn't contain repeted elements?
13:39 nine sumdoc: set ;)
13:39 nine sumdoc: or rather Set, but there's a set constructor
13:40 nine m: my $s = set 1, 1, 2, 3, 2; say $s
13:40 camelia rakudo-moar e8137b: OUTPUT: «set(1 2 3)?»
13:40 sumdoc nine OK lemme see
13:41 lizmat m: dd (1,2,3).Set
13:41 camelia rakudo-moar e8137b: OUTPUT: «set(1,3,2)?»
13:42 ChoHag joined #perl6
13:43 sumdoc lizmat what is dd
13:43 sumdoc my $string = "Pokhara is is city beautiful city of Nepal";
13:43 sumdoc my @aray= $string.split(" ").words; say @aray.Set;
13:44 sumdoc Is it alright? I just want unique elements of the sentence string in an array. nine lizmat
13:45 sumdoc Ok now I have made set with unique elements. How to access individual element of the set?
13:46 lizmat m: my $s = "Pokhara is is city beautiful city of Nepal".words.Set; dd $s.keys
13:46 camelia rakudo-moar e8137b: OUTPUT: «("beautiful", "city", "is", "Nepal", "of", "Pokhara").Seq?»
13:47 lizmat dd is the tiny data dumper, so small it lost the t
13:47 sumdoc lizmat :)
13:47 lizmat although if you just want to iterator over the unique words, you could use .unique
13:47 skids joined #perl6
13:48 lizmat m: dd "Pokhara is is city beautiful city of Nepal".words.unique
13:48 camelia rakudo-moar e8137b: OUTPUT: «("Pokhara", "is", "city", "beautiful", "of", "Nepal").Seq?»
13:48 lizmat m: dd "Pokhara is is city beautiful city of Nepal".words.unique.sort(*.fc)
13:48 camelia rakudo-moar e8137b: OUTPUT: «("beautiful", "city", "is", "Nepal", "of", "Pokhara").Seq?»
13:48 sumdoc lizmat Aye thats cool
13:48 sumdoc But what if I want to access in this set "set(beautiful, city, is, Nepal, of, Pokhara)"
13:49 lizmat m: my $s = "Pokhara is is city beautiful city of Nepal".words.Set; dd $s<is>
13:49 camelia rakudo-moar e8137b: OUTPUT: «Bool::True?»
13:49 lizmat m: my $s = "Pokhara is is city beautiful city of Nepal".words.Set; dd $s<isnot>
13:49 camelia rakudo-moar e8137b: OUTPUT: «Bool::False?»
13:51 skids m: my $s = "Pokhara is is city beautiful city of Nepal".words.Set; dd $s<is city of town>
13:51 camelia rakudo-moar e8137b: OUTPUT: «(Bool::True, Bool::True, Bool::True, Bool::False)?»
13:52 lizmat_ joined #perl6
13:55 sumdoc lizmat Alright. Can I find the total number of elements in the above set. I thought it will work but not "my $string = "Pokhara is is city beautiful city of Nepal";  $string.words.Set.elems;"
13:56 sumdoc nine ??
13:57 lizmat_ sumdoc: unique words or just number of words?
13:57 sumdoc unique words. Yeah its working "Pokhara is is city beautiful city of Nepal";  $string.words.Set.elems;"
13:57 lizmat_ m: dd "Pokhara is is city beautiful city of Nepal".words.unique.elems
13:57 camelia rakudo-moar e8137b: OUTPUT: «6?»
13:57 lizmat_ no need to make it a Set then
13:59 sumdoc Is dd and say same. They r working like they are same.dd $string.words.Set.elems; and say $string.words.Set.elems; are working similarly izmat
13:59 skids dd will be more verbose much of the time.
14:01 skids .say/.gist is for casual human use, .print/.Str/.perl and dd  is for programs and heavy debugging.
14:01 lizmat 'dd $a' is basically short for 'note $a.perl'
14:02 lizmat plus some extra features
14:03 skids m: my %a = a => { a => 2, b => [4,3,3] }; dd %a; dd %a
14:03 camelia rakudo-moar e8137b: OUTPUT: «Hash %a = {:a(${:a(2), :b($[4, 3, 3])})}?Hash %a = {:a(${:a(2), :b($[4, 3, 3])})}?»
14:03 skids oops.
14:03 skids m: my %a = a => { a => 2, b => [4,3,3] }; say %a;
14:03 camelia rakudo-moar e8137b: OUTPUT: «{a => {a => 2, b => [4 3 3]}}?»
14:03 lizmat s:n2d/dd/say/  :-)
14:03 lizmat *2nd rather  :-)
14:04 smls lizmat_: According to the git log, last year you split off the multidim candidates of postcircumfix [ ] to `multidim_slice.pm` and gave them thorough NQP implementations.
14:05 smls lizmat_: But the multidim candidates of postcircumfix { } still remain in `hash_slice.pm`, in a seemingly half-finished state (much shorter and less NQP-y code, bug RT #130947, binding being NYI, etc.)
14:05 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=130947
14:05 smls lizmat_: I'm looking into that bug, but I'm wondering how to proceed... Should those candidates be moved to `multidim_slice.pm` as well, and be reimplemented to mirror their [ ] equivalents?
14:07 lizmat smls: checking
14:11 sumdoc joined #perl6
14:12 epony joined #perl6
14:21 sumdoc lizmat for the previous string I want to write more effiicent version of this "for $string.split(" ").words -> $pokh {   say $pokh if $pokh.chars > 5; };"
14:21 sumdoc my $string = "Pokhara is beautiful city of Nepal";
14:22 sumdoc I want to return an array which returns the words with chars more than 5
14:23 lizmat m: dd "Pokhara is is city beautiful city of Nepal".words.grep(*.chars > 5)
14:23 camelia rakudo-moar e8137b: OUTPUT: «("Pokhara", "beautiful").Seq?»
14:24 lizmat m: dd "Pokhara is is city beautiful city of Nepal".words.grep(*.chars > 5).unique
14:24 camelia rakudo-moar e8137b: OUTPUT: «("Pokhara", "beautiful").Seq?»
14:25 smls sumdoc: `.split(" ").words` is redundant... '.split' returns a sequence of fields, and then the `.words` method concatenates it to a single string again and then splits that string into words all over again.
14:30 epony joined #perl6
14:31 hobbs joined #perl6
14:31 hobbs joined #perl6
14:32 sumdoc smls I see. How to return an array which returns the words in a sentence string with chars more than 5?
14:32 Zoffix smls: oh yeah, the domain expired 'cause I'm pushing for rename... Lemme configure a subdomain on rakudo.party
14:33 Zoffix sumdoc: $string.words.grep(*.chars > 5)
14:33 Guest69863 joined #perl6
14:34 Zoffix well I guess it's more 'cause the .party domains are expensive after first year and there's no point in having a whole domain just for that site.
14:34 sumdoc Zoffix Looks cool. Short and sweet
14:34 nowan joined #perl6
14:35 masak oh hai
14:35 smls o/ masak
14:36 lancew joined #perl6
14:36 masak today I had a bug because I didn't realize Bool ~~ Int ;)
14:36 sumdoc Zoffix why is this not valid list comprehension "($_ if $_.chars>5 for $string.words)
14:36 masak m: say Bool ~~ Int
14:36 camelia rakudo-moar e8137b: OUTPUT: «True?»
14:37 lucasb joined #perl6
14:37 lizmat m: dd Bool.enums   #  look at the values  :-)
14:37 camelia rakudo-moar e8137b: OUTPUT: «{:False(0), :True(1)}?»
14:38 masak yes
14:38 masak agree
14:38 smls m: enum A <Foo Bar>;  say Foo ~~ Int;
14:38 camelia rakudo-moar e8137b: OUTPUT: «True?»
14:38 masak but I still feel it's a has-a relationship rather than an is-a relationship
14:38 smls m: enum A (Foo => "a", Bar => "b");  say Foo ~~ Str;
14:38 camelia rakudo-moar e8137b: OUTPUT: «True?»
14:38 Zoffix sumdoc: it is valid.
14:38 Zoffix m: my $string = "fooffff barffff"; say ($_ if $_.chars>5 for $string.words)
14:38 camelia rakudo-moar e8137b: OUTPUT: «(fooffff barffff)?»
14:40 Zoffix smls: back up: https://fail.rakudo.party/
14:40 smls Zoffix: thank!
14:40 smls *thanks
14:40 nhywyll joined #perl6
14:40 sumdoc Zoffix I thought this would also be valid but throwing error "($lu if $lu.chars>5 for $string.words);"
14:41 smls sumdoc: Where have you declared $lu ?
14:41 buggable joined #perl6
14:42 Zoffix sumdoc: $_ variable is a special topical variable that automatically gets the value being iterated over in that construct. You can't just change it to $lu
14:42 sumdoc smls Even after declaration my $lu, its throwing error
14:43 lizmat smls: can't look at it now, but I vaguely recall that the ones I added are optimized candidates, and the old ones just take all the cases that aren't handled by the optimized candidates
14:43 * Zoffix &
14:43 smls lizmat: The {; } ones aren't just unoptimized though, they're incomplete and partially incorrect.
14:45 sumdoc Zoffix I thought that would work. This is valid in python [w for w in string if  len(w) >5]
14:46 smls sumdoc: The `for w in` part gives the loop variable the name `w` in that Python code. Perl 6 does not support that for "list comprehensions".
14:46 Zoffix sumdoc: it's just a bit different in this language. You don't even have to declare variables at all in Pythong, right?
14:46 Zoffix *Python
14:47 lizmat smls: very likely  :-)  I haven't touched them  :-)
14:47 smls sumdoc: In Perl 6, using `for` and `if` as statement modifiers (a.k.a. "list comprehension") always uses the special variable `$_` (called the "topic") as the loop variable.
14:47 khw joined #perl6
14:48 smls sumdoc: Only the block forms of `for` and `if` allow choosing a custom name for the loop variable using the arrow notation, e.g.  `for $string.words -> $w { ... }`
14:48 Zoffix m: my $string = "fooffff barffff"; say (for $string.words -> $lu { $lu if $lu.chars > 5 });
14:48 camelia rakudo-moar e8137b: OUTPUT: «(fooffff barffff)?»
14:48 Zoffix sumdoc: you could write it this way ^ to get the variable.
14:48 Zoffix But... $string.words.grep(*.chars > 5) is probably how most Rakudo programmers would write it :)
14:49 * Zoffix & for real now
14:49 smls lizmat: Should I try my hand at reimplementing the {; } candidates by copy&pasting the optimized [; ] ones and going from there?
14:49 lizmat smls: be my guest  :-)
14:50 smls ok :)
14:55 xinming joined #perl6
14:59 Cabanossi joined #perl6
15:02 ufobat joined #perl6
15:08 Actualeyes joined #perl6
15:10 AlexDaniel joined #perl6
15:10 araralonre__ joined #perl6
15:15 espadrine joined #perl6
15:17 sumdoc smls ($lu if $lu.chars>5 for $string.words -> {$lu}); or ($lu if $lu.chars>5 for $string.words -> $lu);
15:19 smls sumdoc: Neither. As I said, Perl 6 does not support custom loop variable names for the "list comprehension" versions of `for` and `if`.
15:19 smls On for the block form:  `for $string.words -> $lu { ... }`
15:20 smls That's because the -> is actually considered part of the block `-> $lu { ... }`.
15:20 sumdoc smls Oh I see
15:21 HoboWithAShotgun joined #perl6
15:21 HoboWithAShotgun So I came up with a beatiful proverb. it is full of wisdom and experience, insightful and enriching.
15:21 smls sumdoc: The block version of `for` is always of the form `for EXPRESSION BLOCK`.
15:21 HoboWithAShotgun And then I got stoned and forgot it.
15:22 * lizmat hopes there weren't any stones involved
15:23 HoboWithAShotgun I can neither deny, nor confirm that.
15:27 sumdoc I have this string my $string = "Pocket is Is empty this is Is an example"; I want to find number of unique words in this string, but I want to treat Is and is same.
15:28 sumdoc So what I did was convert all to lower case and count the items but it is showing 1
15:28 sumdoc Here is the code "say "$string".words.lc.unique.elems;"
15:28 lizmat m: "Pocket is Is empty this is Is an example".words>>.lc.unique.elems
15:28 camelia rakudo-moar e8137b: ( no output )
15:28 lizmat m: say "Pocket is Is empty this is Is an example".words>>.lc.unique.elems
15:28 camelia rakudo-moar e8137b: OUTPUT: «6?»
15:28 sena_kun m: say "Pocket is Is empty this is Is an example".lc.words.unique.elems
15:28 camelia rakudo-moar e8137b: OUTPUT: «6?»
15:29 lizmat that works too  :-)
15:30 sumdoc What could be the reason this is not working say "$string.words.lc.unique.elems;"
15:30 smls Is there a way to run only specific spectest files, but still get the "skipping fudged tests etc." magic that `make spectest` provides?
15:30 lizmat make t/spec/foo.t
15:30 smls ah, thanks
15:31 sumdoc lizmat What could be the reason this is not working say "$string.words.lc.unique.elems;"
15:31 Juerd sumdoc: .words returns a Seq, which is multiple items
15:31 Juerd sumdoc: But .lc works on a single item
15:31 sumdoc Juerd Aye I see
15:32 Juerd sumdoc: It should help to change the order: $string.lc.words.unique.elems
15:32 sumdoc Yeah changinf the order works :)
15:32 Juerd Or, to apply the .lc on the individual words: $string.words».lc.unique.elems
15:33 Juerd Oh, I now see that lizmat already said that :)
15:33 Juerd And sena_kun
15:34 sumdoc What is this  ">>" Juerd?
15:36 lizmat sumdoc: https://docs.perl6.org/language/operators#index-entry-hyper_%3C%3C-hyper_%3E%3E-hyper_«-hyper_»-Hyper_Operators
15:41 _cronus joined #perl6
15:44 _cronus hello, is it ok to paste code related a question here or should I use pastebin?
15:45 moritz _cronus: please use a pastebin
15:45 moritz unless it's only one line :-)
15:45 _cronus moritz: thanks
15:47 unclechu hi guys, is there something for compiling perl6 code to javascript?
15:47 moritz unclechu: yes, pmurias is working on rakudo-js
15:47 unclechu i just found this repo https://github.com/rurban/rakudo-js
15:48 unclechu moritz: you're talking about different one?
15:48 moritz unclechu: I'm talking about rakudo/rakudo branch js
15:49 unclechu i think you're about this one? https://github.com/rakudo/rakudo/tree/js
15:49 moritz yes
15:49 unclechu moritz: thanks
15:51 _cronus I am trying to learn perl 6 regexes. I wrote a small script - http://paste.ubuntu.com/25397783/ - but cannot understand it's behavior - specifically why it does not remove .1 from the first line. What am I missing?
15:53 wamba joined #perl6
15:55 * moritz compiles a rakudo to be able to test this
15:56 AlexDaniel lol, you have to login to “download as text”
15:56 moritz AlexDaniel: or you can just copy & paste
15:56 AlexDaniel committable6: please copy & paste it
15:56 committable6 AlexDaniel, ¦please: «Cannot find this revision (did you mean “releases”?)»
15:57 AlexDaniel c: HEAD https://gist.githubusercontent.com/AlexDaniel/eeec3e3acc5dcd5c87ea7b89ebb6235f/raw/5e8bb2eca6398f3bf333af711b5529273199b702/gistfile1.txt
15:57 committable6 AlexDaniel, Successfully fetched the code from the provided URL.
15:57 committable6 AlexDaniel, ¦HEAD(e8137b4): «AAAA.1    val.1?BBBB     val.2?AAAA     val.3?BBBB     val.4?»
15:57 moritz _cronus: I found look-arounds to be quite tricky; it works as you expect if you change it to  s:g / ^^ <-[.]>+ <( '.' \S* / /
15:57 moritz _cronus: the <( limits the match
15:57 Khisanth joined #perl6
15:58 geekosaur isn't that <-[.]> a bad perl 5 regex hack translated?
15:58 moritz no
15:58 moritz a negative char class is still a valid tool in Perl 6 regexes
15:58 * geekosaur is still waking up... not very successfully
16:01 moritz it seems to not work in the first line; if I insert another line before the AAAA.1 line, it does not work in the new first line, and works fine in the line with AAAA.1
16:03 lizmat SPW over
16:03 lizmat until later&
16:03 lancew joined #perl6
16:05 moritz m: given "abc\ndef\nghi\n" { say S/ <?after ^^ > /x/ }
16:05 camelia rakudo-moar e8137b: OUTPUT: «abcx?def?ghi??»
16:05 moritz m: given "abc\ndef\nghi\n" { say S:g/ <?after ^^ > /x/ }
16:05 camelia rakudo-moar e8137b: OUTPUT: «abcx?defx?ghix?x?»
16:06 moritz I don't understand why that is, but it's at the heart of _cronus' problem
16:07 moritz m: given "abc\ndef\nghi\n" { say S:g/ <?before ^^ > /x/ }
16:07 camelia rakudo-moar e8137b: OUTPUT: «xabc?xdef?xghi??»
16:07 _cronus moritz: thanks. Any idea why <?after does not match first line? using <?after AA does match it.
16:07 moritz _cronus: ah, you probably want <?before> instead of <?after>
16:08 moritz <?after x> means "what comes after the curerent position must match x"
16:09 mr-foobar joined #perl6
16:09 moritz or am I totally confused now?
16:09 moritz I likely am
16:09 moritz m: given "abc\ndef\nghi\n" { say S:g/ ^^ /x/ }
16:09 camelia rakudo-moar e8137b: OUTPUT: «xabc?xdef?xghi??»
16:10 smls <?after x> means "The current position must not come after an x"
16:10 moritz s/not//
16:10 smls right
16:10 moritz m: given "abc\ndef\nghi\n" { say S:g/ <?after ^^> /x/ }
16:10 camelia rakudo-moar e8137b: OUTPUT: «abcx?defx?ghix?x?»
16:11 moritz is that wrong then?
16:11 moritz isn't pos 0 after a start-of-line as well?
16:12 moritz m: given "abc\ndef\nghi\n" { say S/ <?after ^^> /X/ }
16:12 camelia rakudo-moar e8137b: OUTPUT: «abcX?def?ghi??»
16:12 moritz m: given "abc\ndef\nghi\n" { say S/ <?after ^> /X/ }
16:12 camelia rakudo-moar e8137b: OUTPUT: «abc?def?ghi?X?»
16:12 AlexDaniel o_o
16:12 smls yeah, seem broken
16:12 moritz that *is* wrong
16:12 moritz _cronus++
16:13 moritz m: given "abc\ndef\nghi\n" { say S/ <?after $> /X/ }
16:13 camelia rakudo-moar e8137b: OUTPUT: «Xabc?def?ghi??»
16:13 moritz muhaha
16:13 smls apparently <?after > doesn't like anchors, yet... :P
16:13 moritz iirc <?after> is implemented by reversing the string, or something
16:13 moritz who wants to write the bug report? :-)
16:13 smls heh, and probably forgot to reverse the meaning of the anchors accordingly... :P
16:15 moritz ok, I'll write the bug report as a failing test case, I guess
16:16 smls m: say "abc".match(/ <?after ^ > /).from;
16:16 camelia rakudo-moar e8137b: OUTPUT: «3?»
16:17 smls moritz: ^^ A test-case without S///
16:23 japhb OK, so Cro is jnthn's reveal from SPW?
16:25 sena_kun japhb, yeah.
16:25 japhb Ah, cool.  Can't wait to see that slide deck / talk video
16:26 sena_kun me too.
16:26 andrzejku_ joined #perl6
16:31 japhb .tell Cro website typos: First HTTP flip page: 'SITINT', last HTTP flip page: 'requset', first Tooling flip page: 'delcaring'.
16:31 yoleaux japhb: I'll pass your message to Cro.
16:31 japhb .tell nthn website typos: First HTTP flip page: 'SITINT', last HTTP flip page: 'requset', first Tooling flip page: 'delcaring'.
16:31 yoleaux japhb: I'll pass your message to nthn.
16:31 japhb .tell jnthn website typos: First HTTP flip page: 'SITINT', last HTTP flip page: 'requset', first Tooling flip page: 'delcaring'.
16:31 yoleaux japhb: I'll pass your message to jnthn.
16:31 japhb *sigh*
16:32 japhb There's a certain justice in typoing twice while reporting typos.
16:33 sena_kun japhb, thanks for your reports, noted. As soon as easy deployment will be done, I'll be able to fix such issues right away.
16:34 japhb Who all is on the team?
16:34 sena_kun ? Can you rephrase, please?
16:35 japhb You said you would be able to fix such issues, which implies the Cro team includes you as well (not just jnthn).  Who else is involved?
16:35 MilkmanDan joined #perl6
16:36 TimToady m: my $string = "fooffff barffff"; say (-> $lu { $lu if $lu.chars > 5 } for $string.words);
16:36 camelia rakudo-moar e8137b: OUTPUT: «(fooffff barffff)?»
16:36 sena_kun japhb, ah. just me and jnthn right now.
16:36 TimToady sumdoc: ^^^
16:37 TimToady statement modifier form allows a lambda on the left
16:37 japhb sena_kun: Do you work for Edument Central Europe as well?
16:37 sumdoc TimToady Looks good :)
16:37 sena_kun japhb, well, yes.
16:38 TimToady but basically we don't care to allow postdeclarations of variables, which is what Python is doing
16:39 TimToady postdeclaration tends to violate the one-pass parsing principle
16:39 tony-o jnthn++
16:39 tony-o cro ^^
16:39 japhb sena_kun: Ah, I didn't realize he'd managed to build a staff (last I was paying attention, jnthn was moving and acting as founding member of the new office ... but it was never clear how many people he was planning to hire).
16:40 japhb (including possibly zero)
16:42 sumdoc is there a way to make words in a string titlecase like my $string="hello sum Helo doc docile" to Hello Sum Helo Doc Docile
16:42 sumdoc like .uc .lc methods??
16:42 japhb sumdoc: .words>>.tclc.join(' ') ?
16:43 b2gills m: say "Pocket is Is empty this is Is an example".words.unique(:as(*.fc)).elems
16:43 camelia rakudo-moar e8137b: OUTPUT: «6?»
16:43 sumdoc japhb Yeah I found .wordcase method. Hope that works too
16:45 japhb sumdoc: (... goes to look at Rakudo source ...)  Yup, looks like that would work well (and by default uses .tclc as a transformer)
16:45 sumdoc But whats the difference between .tclc and .wordcase ? with examples. I couldn't make documentation.
16:45 geekosaur "complicated"
16:46 sumdoc I couldn't understand the documentation https://docs.perl6.org/type/Str#routine_wordcase
16:46 japhb m: my $string = 'this is  a      test'; say $string.wordcase; say $string.words.map(*.tclc).join(' ');
16:46 camelia rakudo-moar e8137b: OUTPUT: «This Is  A      Test?This Is A Test?»
16:47 MilkmanDan joined #perl6
16:47 japhb sumdoc: The docs are saying you can change the per-word transformation from its default of tclc, and also that you can select only some of the words to be affected.
16:49 sumdoc japhb Still confused. Give me an example plz.
16:53 japhb m: say 'This is a test'.wordcase(:filter(&uc), :where(/:i 't'/))
16:53 camelia rakudo-moar e8137b: OUTPUT: «THIS is a TEST?»
16:53 japhb sumdoc: ^^
16:54 japhb (Uppercases words containing a 't' or 'T')
16:55 nadim joined #perl6
17:04 sumdoc This gives the desired output, but is it syntactically correct?
17:04 sumdoc my $string = "Pokhara is Is beautiful City city of Nepal"; my @exam=$string.split("is") ; say @exam.join("the tourist city");
17:05 moritz how could it produce any output if it weren't syntactially correct?
17:08 sumdoc moritz I mean is the array @exam OK?
17:10 lancew joined #perl6
17:13 MilkmanDan joined #perl6
17:14 Cabanossi joined #perl6
17:19 lancew joined #perl6
17:28 epony joined #perl6
17:42 nowan joined #perl6
17:44 smls joined #perl6
17:48 sumdoc I have written a small tutorial. https://github.com/sumandoc/Getting-Started-with-Perl-6/blob/master/Week-6/handling_text_perl_6.md
17:48 sumdoc Hope to get feedback !!
17:54 smls joined #perl6
17:57 smls sumdoc: When printing lists/sequences (e.g. `say $string.split(" ");`), the output is easier to understand if each element is printed on a new line (e.g. `.say for $string.split(" ");`).
17:58 sumdoc smls OK
18:01 mniip joined #perl6
18:02 AlexDaniel sumdoc: The original course is using "" because in python there's no difference. IMO, in perl 6, using '' when no interpolation is needed makes the code easier to read
18:03 sumdoc AlexDaniel Aye
18:05 AlexDaniel sumdoc: I have a bunch of nitpicks, so don't take them too seriously, but…
18:05 AlexDaniel sumdoc: “Split sentence on space” – using .words is probably more conventional there. If you want to show .split, maybe use some other delimiter
18:07 AlexDaniel sumdoc: “$string.split(" ").words” is even weirder
18:09 AlexDaniel sumdoc: “But if we are to ignorecase then, […] $string.lc” – use .fc for case-insensitive comparisons
18:11 AlexDaniel sumdoc: “$string.split("\n")” – again, maybe .lines
18:11 smls Note that `.split(' ')` and `.words` aren't identical. One extracts the fields between single SPACE characters, the other extracts fields made up of consecutive runs of alphanumeric characters. Try the input string " Hello,   world!!  " to see the difference.
18:12 sumdoc AlexDaniel Yeah .lines
18:12 AlexDaniel sumdoc: “If the sentence contains the string […] $string.match("").Bool” – maybe .contains
18:12 Ben_Goldberg joined #perl6
18:13 smls s/alphanumeric characters/word characters (which also includes the underscore)/
18:15 sumdoc AlexDaniel corrected
18:16 AlexDaniel smls: well, .split(“\n”) and .lines are not identical too, but which one should be preferred by a beginner to do The Right Thing™?
18:16 * moritz would recommend .lines
18:17 AlexDaniel .split(“\n”) vs .lines is maybe more obvious than .split(‘ ’) vs .words. But yeah, it depends on what you need
18:17 smls joined #perl6
18:19 samcv m: my $a = " Hello world !!! "; say $a.split(' ', :skip-empty) cmp $a.words
18:19 camelia rakudo-moar e8137b: OUTPUT: «Same?»
18:20 samcv m: my $a = " Hello world\c[NBSP] !!! "; say $a.split(' ', :skip-empty) cmp $a.words
18:20 camelia rakudo-moar e8137b: OUTPUT: «More?»
18:20 samcv that's the difference between words and split(:skip-empty) afaik
18:21 smls m: my $a = " Hello world!!! "; say $a.split(' ', :skip-empty) cmp $a.words
18:21 camelia rakudo-moar e8137b: OUTPUT: «Same?»
18:22 smls Ohh, yes, it looks like I was wrong about what `.words` does.
18:23 smls Does that mean  `.words`  is equivalent to  `.split(/\s+/, :skip-empty)`  ?
18:27 smls sumdoc: In that case, maybe `.comb` would be a nice addition to your tutorial, for when you really do want words to mean "consecutive runs of word characters"...
18:27 sumdoc Perl 6 looks so vast. samcv Ehat does :skip-empty do?
18:28 smls I doesn't include empty fields in the output.
18:28 smls m: dd "Hello   world!!!  ".split(' ');
18:28 camelia rakudo-moar e8137b: OUTPUT: «("Hello", "", "", "world!!!", "", "").Seq?»
18:28 smls m: dd "Hello   world!!!  ".split(' ', :skip-empty);
18:28 camelia rakudo-moar e8137b: OUTPUT: «("Hello", "world!!!").Seq?»
18:29 smls Not entirely sure why it exists, when one can also do:
18:29 smls m: dd "Hello   world!!!  ".split(' ').grep(?*);
18:29 camelia rakudo-moar e8137b: OUTPUT: «("Hello", "world!!!").Seq?»
18:30 smls m: dd "Hello   world!!!  ".comb;
18:30 camelia rakudo-moar e8137b: OUTPUT: «("H", "e", "l", "l", "o", " ", " ", " ", "w", "o", "r", "l", "d", "!", "!", "!", " ", " ").Seq?»
18:30 smls m: dd "Hello   world!!!  ".comb(/ \w+ /);
18:30 camelia rakudo-moar e8137b: OUTPUT: «("Hello", "world")?»
18:30 smls sumdoc: ^^ `.comb` examples
18:32 sumdoc smls Aye
18:32 sumdoc thanks
18:33 sumdoc smls What if I want only alphanum characters only and not spaces like in this example "dd "Hello   world!!!  ".comb;"
18:33 smls m: dd "Hello   world!!!  ".comb(/ \w /);
18:33 camelia rakudo-moar e8137b: OUTPUT: «("H", "e", "l", "l", "o", "w", "o", "r", "l", "d")?»
18:33 sumdoc If I don't want redundant spaces when converting to characters
18:33 smls like this ^^
18:33 sumdoc smls Looks good
18:34 smls sumdoc: `.comb` is basically the opposite of `.split` - instead of specifying where the field delimiters are, you specify (using a regex) what the fields themselves are.
18:37 smls joined #perl6
18:41 sumdoc smls samcv Updated with .comb
18:50 samcv smash, or specify just a number
19:09 mando joined #perl6
19:11 AlexDaniel joined #perl6
19:22 emeric joined #perl6
19:24 |oLa| joined #perl6
19:31 TEttinger joined #perl6
19:34 ChoHag joined #perl6
19:40 kybr joined #perl6
19:43 mando left #perl6
19:46 kst joined #perl6
19:54 raschipi joined #perl6
19:54 konsolebox joined #perl6
19:55 pmurias joined #perl6
19:55 pmurias is Cro meant to be a web framework?
19:56 AlexDaniel that's what I'm wondering too
20:06 Skarsnik huggable, eco cro
20:06 huggable Skarsnik, nothing found
20:06 Skarsnik huggable, cro
20:06 huggable Skarsnik, nothing found
20:13 Rawriful joined #perl6
20:15 AlexDaniel buggable: cro
20:16 AlexDaniel buggable: eco cro
20:16 buggable AlexDaniel, cro 'Libraries for building reactive services in Perl 6.': https://github.com/croservices/cro 11 other matching results: https://modules.perl6.org/s/cro
20:30 ChoHag The urge to play with perl6 again has been increasing recently. What are the capabilities for which I'd choose it over another?
20:30 ChoHag eg. if I've got to process tonnes of not-quite-sane text, perl5.
20:30 ChoHag If I *really* like pressing the space bar, python.
20:30 ChoHag It I want complete control over everything, C.
20:30 ChoHag If I want $foo, perl6.
20:31 ChoHag What is $foo?
20:31 ChoHag Or $.foo, if you will.
20:33 raschipi People that learn Perl6 say they feel like they are fighting the language when they are forced to use something else. Perl6 will adapt to your ideas, instead of having to adapt your ideas to a harness.
20:34 raschipi Perl6 also allows clean code that shows what the code is actually supposed to do, making understanding it later much easier.
20:36 raschipi Other important feature is that Perl6 can make use of C and C++ libs, and Perl5, Python and Ruby modules very easily.
20:36 ChoHag Hmm I'd be careful on that second point.
20:36 ChoHag You can write fortran in any language. I'm sure perl 6 is no exception.
20:37 ChoHag (I picked fortran as a stand-in for "some old POS". I don't know it at all)
20:37 raschipi Yes, it's possible to write FORTRAN in Perl6.
20:37 kybr joined #perl6
20:37 ChoHag So perl 6 is even gluier than perl 5?
20:38 ChoHag Or gluier at a lower level, perhaps?
20:38 raschipi Perl6 is the glue of glues, much better than anything else.
20:38 ChoHag Well there's your catch phrase.
20:38 raschipi But it also scales very well to big applications.
20:39 ChoHag Now you're just sounding like a salesman :P
20:40 ChoHag *Every* language claims it scales well.
20:40 raschipi It's the only dynamic language with an actually good type system.
20:40 ChoHag Joke languages need not apply, although I'm sure someone's written something substantial in brainfuck.
20:40 ChoHag Someone always does.
20:41 ChoHag Now that's an interesting point.
20:41 ChoHag I'm sure someone must have contended it though. Is there discussion around that (types) available for reading?
20:42 ilbelkyr brainfuck can't even do threads :)
20:42 ChoHag I'm quite familiar with perl 6's object hieirarchy. I used it quite a bit a year or so ago.
20:42 ilbelkyr I prefer threaded intercal for that (using multiple come froms pointed at the same line)
20:42 ChoHag ilbelkyr: So I guess you're that someone?
20:43 ilbelkyr nah, I just sort-of know the C-INTERCAL maintainer via IRC
20:43 ilbelkyr that sort of thing rubs off on you :)
20:44 ChoHag Intercal has a maintainer?
20:45 ilbelkyr http://catb.org/esr/intercal/ mentions him as "co-maintainer"
20:47 raschipi We don't even see much behind INTERCAL because COBOL and FORTRAN are their own parody.
20:47 raschipi It's a blast for people used to them, though.
20:54 AlexDaniel m: for ^5 { KEEP { say ‘hello’ } }
20:54 camelia rakudo-moar e8137b: ( no output )
20:55 AlexDaniel so what is KEEP?
20:56 mr-fooba_ joined #perl6
20:56 raschipi (KEEP { say ‘hello’ }).^name
20:56 raschipi m: (KEEP { say ‘hello’ }).^name.say
20:56 camelia rakudo-moar e8137b: OUTPUT: «Nil?»
20:56 ryu0 m: Nil.say
20:56 camelia rakudo-moar e8137b: OUTPUT: «Nil?»
20:57 ryu0 a nil sayer.
20:57 AlexDaniel “Runs at every successful block exit, as part of the LEAVE queue”
20:57 AlexDaniel what is considered “successful”?
21:00 smls AlexDaniel:  https://design.perl6.org/S04.html#Definition_of_Success
21:00 raschipi m: my $a = do { KEEP { say "awooo"  }; False }; my $b = do { KEEP { say "awooo"  }; Nil }
21:00 camelia rakudo-moar e8137b: OUTPUT: «awooo?»
21:01 raschipi It runs if the block has a defined value.
21:01 AlexDaniel oh… okay
21:01 smls If it exits normally (i.e. not with an exception) and returns a defined value.
21:30 kybr joined #perl6
21:53 cpage_ joined #perl6
22:04 zakharyas joined #perl6
22:33 Ven`` joined #perl6
22:45 b2gills m: say Failure ~~ Nil
22:45 camelia rakudo-moar e8137b: OUTPUT: «True?»
22:50 lizmat joined #perl6
22:59 skids joined #perl6
23:21 MilkmanDan joined #perl6
23:26 teatime what is _True__
23:29 skids I don't grep that identifier anywhere in rakudo/nqp/MoarVM.
23:46 skids Oh, it's your IRC client, not displaying some codepoints.
23:48 quotable6 joined #perl6
23:48 Kyo91_ joined #perl6
23:48 teatime o.  my bad :)
23:49 teatime I wonder if tmux ate it.
23:50 teatime this may be a stupid question, but how come Failure ~~ Nil is true while Nil ~~ Failure is false
23:51 Skarsnik hm
23:51 Skarsnik good question
23:51 Skarsnik I thouht it was the other way around
23:51 Skarsnik Nil being a Failure
23:52 geekosaur I think of Failure as Nil with extra behavior (i.e. verbosity)
23:53 skids m: Failure.^mro.say
23:53 camelia rakudo-moar f097e5: OUTPUT: «((Failure) Nil (Cool) (Any) (Mu))?»
23:53 Skarsnik hm how you list roles of a class already
23:53 skids m: Nil.^mro.say
23:53 camelia rakudo-moar f097e5: OUTPUT: «(Nil (Cool) (Any) (Mu))?»
23:53 skids Im: IO::Path.^roles.say
23:54 skids m: IO::Path.^roles.say
23:54 camelia rakudo-moar f097e5: OUTPUT: «()?»
23:54 skids huh...
23:54 skids m: Num.^roles.say;
23:54 camelia rakudo-moar f097e5: OUTPUT: «((Real) (Numeric))?»
23:55 Skarsnik m: say int32.^roles
23:55 camelia rakudo-moar f097e5: OUTPUT: «No such method 'roles' for invocant of type 'Perl6::Metamodel::NativeHOW'. Did you mean any of these??    does?    roll??  in block <unit> at <tmp> line 1??»
23:56 Skarsnik m: say int.^roles
23:56 camelia rakudo-moar f097e5: OUTPUT: «No such method 'roles' for invocant of type 'Perl6::Metamodel::NativeHOW'. Did you mean any of these??    does?    roll??  in block <unit> at <tmp> line 1??»
23:57 skids yeah natives have lots of rough edges still.

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

Perl 6 | Reference Documentation | Rakudo