Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-05-10

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:07 cpage_ joined #perl6
00:15 robertle_ joined #perl6
00:16 Cabanossi joined #perl6
00:27 Celelibi joined #perl6
00:27 aindilis joined #perl6
00:35 Cabanossi joined #perl6
00:37 robertle joined #perl6
00:44 BenGoldberg m: my $a = *-1; my $b = *-1; say $a===$b;
00:44 camelia rakudo-moar 2df706: OUTPUT: «False␤»
00:44 BenGoldberg m: my $a = *; my $b = *; say $a===$b;
00:44 camelia rakudo-moar 2df706: OUTPUT: «True␤»
00:47 BenGoldberg m: dd *-1
00:47 camelia rakudo-moar 2df706: OUTPUT: «{ ... }␤»
00:47 BenGoldberg m: dd (*-1).WHAT
00:47 camelia rakudo-moar 2df706: OUTPUT: «WhateverCode␤»
00:48 * BenGoldberg wonders how many WhateverCode objects get construced, and whether caching would improve memory consumption.
00:49 timotimo one for every occurence in the source, plus probably closure clones
01:09 robertle_ joined #perl6
01:18 BenGoldberg But a WhateverCode which doesn't refer to lexicals doesn't need to get cloned, no?
01:19 BenGoldberg On an unrelated note, is there anything in perl6 similar to perl5's $, ?
01:19 BenGoldberg Or to $" ?
01:22 MasterDuke_ the docs say no and no
01:23 eyck joined #perl6
01:48 ilbot3 joined #perl6
01:48 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:50 Cabanossi joined #perl6
01:52 lookatme joined #perl6
01:52 lookatme o/
01:53 skids o/
02:03 Actualeyes joined #perl6
02:25 mcmillhj joined #perl6
02:39 imcsk8 joined #perl6
02:50 pierre_ joined #perl6
02:56 Celelibi joined #perl6
03:10 aborazmeh joined #perl6
03:10 aborazmeh joined #perl6
03:35 Actualeyes left #perl6
03:38 Cabanossi joined #perl6
03:47 labster joined #perl6
03:49 geekosaur joined #perl6
04:01 u-ou what's a better way of saying: <multi> [ ' * ' <multi> ]*
04:14 ugexe something like `<multi> *%% '*'` maybe
04:20 skids Note the difference:
04:20 skids m: say "foo,bar," ~~ /<ident>+ %% "," (.*)/
04:20 camelia rakudo-moar 643593: OUTPUT: «「foo,bar,」␤ ident => 「foo」␤ ident => 「bar」␤ 0 => 「」␤»
04:20 skids m: say "foo,bar," ~~ /<ident>+ % "," (.*)/
04:20 camelia rakudo-moar 643593: OUTPUT: «「foo,bar,」␤ ident => 「foo」␤ ident => 「bar」␤ 0 => 「,」␤»
04:30 curan joined #perl6
04:33 u-ou cool
04:34 u-ou is there a way to make %%'s right hand operand a regex?
04:43 grondilu joined #perl6
04:43 lookatme m: say "foo,bar-foo.bar" ~~ /<ident>+ %% <[\,\.\-]> (.*)/
04:43 camelia rakudo-moar 643593: OUTPUT: «「foo,bar-foo.bar」␤ ident => 「foo」␤ ident => 「bar」␤ ident => 「foo」␤ ident => 「bar」␤ 0 => 「」␤»
04:44 lookatme u-ou, you mean this ?
04:46 u-ou yeah
04:50 Actualeyes joined #perl6
05:08 Cabanossi joined #perl6
05:09 lowbro joined #perl6
05:09 lowbro joined #perl6
05:14 CIAvash joined #perl6
05:16 samcv o/ everyone
05:16 japhdc joined #perl6
05:20 lookatme samcv, o/
05:23 japhdc Hello... On the archives of #perl6 I noticed a few reference to wanting a VirtualEnv like tool for Perl6... But it seems that share/nqp/lib/Perl6/*.moarvm and share/perl6/runtime/*.moarvm have the full compile time in the binary instead of a relative path...
05:25 samcv japhdc, yes they use hardcoded paths
05:25 lookatme I don't think so ~~
05:25 samcv i have builds/can show you how to make them relative
05:25 samcv .o0(if we're both talking about the same thing)
05:29 japhdc samcv, yes, please show me how to make those paths relative
05:29 samcv ok
05:29 samcv japhdc, this script will do it for you https://github.com/samcv/rakudo-appimage-module-test-automation/blob/master/build-appimage.sh
05:30 samcv it clones and does it all for you. but. it builds as prefix /rsu then it goes through and replaces in binary the /rsu with ././
05:30 lookatme joined #perl6
05:30 samcv and uhm. then just gotta replace the perl6 script's cause i believe the substitution is different for those. i just copy my own
05:32 samcv japhdc, https://github.com/samcv/rakudo-appimage-module-test-automation/blob/master/build-appimage.sh#L83-L96 mostly this
05:32 samcv but without the appimage part
05:33 samcv so these lines https://github.com/samcv/rakudo-appimage-module-test-automation/blob/master/build-appimage.sh#L83-L86
05:33 samcv then copy this https://github.com/samcv/rakudo-appimage-module-test-automation/blob/master/perl6-basic
05:34 samcv then after that start it up japhdc so that anything can make sure it's compiled. then after that move it however you want
05:35 samcv I have appimages premade though https://github.com/samcv/rakudo-appimage-module-test-automation/tree/gh-pages
05:36 samcv has some weirdness because it starts out in the fake directory of the appimage. but you can dl the appimage and run `theappimage --appimage-extract`
05:36 samcv and it will extract itself. then just discard the appimage binary and everything is good to go
05:37 samcv builds are nightly
05:39 lookatme great
05:39 japhdc That makes sense.... I think I see how it works and just need to give it a few tries. thanks for the thorough explanation! :-)
05:41 wamba joined #perl6
05:41 samcv ok no problem!
05:42 samcv glad my hard work can help someone out
05:42 pierre_ joined #perl6
05:42 samcv took a while to get it right. and fyi the number of spaces is semi important
05:42 samcv err
05:42 samcv /rsu (4 character) => ././
05:42 samcv so you need it to be (no trailing slash) divisible by 2
05:42 samcv and if you do /rsu make sure to chown -R $USER /rsu
05:43 samcv you can put it in any folder but. that's not the best idea. forget if i ran into problems with some perl6 moarvm bytecode having issues when i had like ./././././././././././././././
05:44 samcv err actualy one thing missing from the perl6 script that you will need
05:44 samcv i will add it
05:44 parv joined #perl6
05:49 domidumont joined #perl6
05:51 geekosaur joined #perl6
05:54 domidumont joined #perl6
05:54 Cabanossi joined #perl6
05:56 samcv japhdc, ok here you go https://github.com/samcv/rakudo-appimage-module-test-automation/blob/master/perl6-basic
05:58 japhdc samcv, ic... must add LD_LIB_PATH so that it can find libmoar.so?
05:58 samcv uh just download perl6-basic
05:58 samcv and replace the perl6 script from your build with that
05:58 domidumont joined #perl6
05:58 samcv cause other paths in there are also messed up and need to be fixed, so easier and more fool proof to just copy the scripts
05:59 samcv and use `find` to replace the binary data
06:00 japhdc will do. thank you samcv!
06:23 Cabanossi joined #perl6
06:31 Geth Swapped META.info → META6.json in 1 dists in https://github.com/perl6/ecosystem/commit/68b3f3279a
06:31 xtreak joined #perl6
06:33 raschipi joined #perl6
06:47 japhdc joined #perl6
06:54 Cabanossi joined #perl6
06:58 rindolf joined #perl6
07:00 espadrine joined #perl6
07:12 abraxxa joined #perl6
07:14 pierre_ joined #perl6
07:14 astj joined #perl6
07:19 TEttinger joined #perl6
07:21 ChoHag joined #perl6
07:23 Cabanossi joined #perl6
07:25 anton_p joined #perl6
07:31 Geth Swapped META.info → META6.json in 1 dists in https://github.com/perl6/ecosystem/commit/b6df013bec
07:55 darutoko joined #perl6
07:58 zakharyas joined #perl6
07:59 Actualeyes left #perl6
08:01 cyphase joined #perl6
08:02 jonas1 joined #perl6
08:19 vs-midi joined #perl6
08:24 vs-midi left #perl6
08:25 wamba joined #perl6
08:27 japhdc joined #perl6
08:28 xtreak joined #perl6
08:38 Cabanossi joined #perl6
08:52 colomon_ joined #perl6
08:53 z448 joined #perl6
09:00 robertle joined #perl6
09:00 z448 joined #perl6
09:07 grondilu joined #perl6
09:16 gregf_ joined #perl6
09:24 Cabanossi joined #perl6
09:44 japhdc samcv, i've been experimenting with the results of your build-appimage.sh script to allow the perl6 path to be moved, but this way it always requires that you `cd $PERL6_BASE_DIR`...
09:45 samcv japhdc, i don't see that var in my script?
09:47 japhdc samcv, just saying that if i run perl6 from outside of the base directory after doing the transformation, then the various perl6 components are unable to find each other...
09:48 samcv yep
09:48 samcv that is true
09:48 samcv so you can use an appimage if you want it to do its magic
09:48 cognominal joined #perl6
09:48 samcv because the thing is japhdc perl6 NEEDS to be in the folder to find things
09:48 samcv since everything is relative. it's all relative to that path
09:49 nadim_ joined #perl6
09:49 samcv what we need is a command line flag for perl6 that will chdir a the very first thing it does (before loading modules even)
09:49 japhdc so is the vision that apps built on perl6 are all going to have to use appimage for distribution?
09:49 samcv but i have not been able to figure out where the hell to put it
09:49 samcv for now yes
09:50 samcv japhdc, or you can hack it
09:50 samcv uh
09:50 samcv https://github.com/samcv/rakudo-appimage-module-test-automation/blob/master/perl6-stable
09:50 samcv look at my hacks here
09:51 samcv it chdirs into OWD (the dir the appimage was started from) then it figures out all of the scripts given to it on the command line are located relative to OWD
09:51 samcv then it chdirs BACK into the appimage (or in your case would be $PERL6-BASEDIR
09:51 samcv then starts it
09:51 samcv i think i remember changing all the --libpath's to be absolute. pretty sure
09:51 samcv yeah then it would break modules and stuff built into perl 6
09:51 samcv i remember
09:52 japhdc yes. that's a workaround.... but isn't requiring either compile time install path OR fixed working directory "Less Than Awesome"?
09:52 samcv pretty much
09:53 japhdc :-)
09:53 samcv so big someone to figure out where to put that perl6 code
09:53 samcv i'l add but i searched and couldn't figure out where to put it
09:53 samcv now 100% sure how the command line flags and all work tbh. like parts of it sure. but not like. all of it
09:53 samcv it's very abstracted
09:54 samcv but theoretically there's somewhere we can add a chdir in there, add a perl6 --chdir flag
09:54 samcv and then we will be gucci
09:54 samcv and perl6 will still know where its things are and you'll still be in the right $*CWD
09:55 samcv and can't put it in moarvm i already tried that. cause then moar starts up fine then all the modules are relative directories. so
09:55 samcv they become relative to whatever it was when perl6 started
10:01 domidumont joined #perl6
10:02 japhdc yes, that does make sense... sounds like the flag that does the --chdir to help perl6 find it's component parts would be the way to go if $*CWD would not be impacted... perhaps choose a name other than --chdir to make the meaning more easily discoverable
10:05 parv --startdir perhaps?
10:24 Cabanossi joined #perl6
10:38 parv joined #perl6
10:38 kyan joined #perl6
10:39 wamba joined #perl6
10:49 ChoHag joined #perl6
10:54 xtreak joined #perl6
11:05 kurahaupo joined #perl6
11:11 xtreak joined #perl6
11:24 mr-foobar joined #perl6
11:33 wamba joined #perl6
11:35 Actualeyes joined #perl6
11:37 g4 joined #perl6
11:37 g4 joined #perl6
11:38 Cabanossi joined #perl6
11:39 xtreak joined #perl6
11:47 xtreak joined #perl6
11:47 Khisanth joined #perl6
11:50 Actualeyes left #perl6
11:52 xtreak joined #perl6
11:57 xtreak_ joined #perl6
12:13 domidumont joined #perl6
12:20 domidumont joined #perl6
12:24 raschipi joined #perl6
12:36 raiph joined #perl6
12:44 mcmillhj joined #perl6
12:46 dj_goku joined #perl6
12:46 dj_goku joined #perl6
12:51 colomon_ joined #perl6
12:58 colomon joined #perl6
13:06 japhdc joined #perl6
13:07 eyck_ joined #perl6
13:09 skids joined #perl6
13:16 smash joined #perl6
13:17 Mithaldu joined #perl6
13:25 colomon joined #perl6
13:25 raiph joined #perl6
13:27 raiph joined #perl6
13:32 raiph joined #perl6
13:34 Sound joined #perl6
13:34 geekosaur joined #perl6
13:51 ChoHag joined #perl6
13:53 Cabanossi joined #perl6
13:56 haxmeister moritz: got a second?
13:58 moritz haxmeister: yes-ish
13:58 haxmeister https://paste.pound-python.org/show/GwLeLkb9J2JVQmCOvo1z/
13:58 haxmeister I have this json
13:58 haxmeister and your module
13:58 haxmeister but ignorant about how to get to the values once produced by your module :/
13:58 moritz .oO( this is where it gets personal :-)  )
13:58 haxmeister could you give a quick example?
13:59 haxmeister not personal.. I'm very newby
13:59 moritz haxmeister: that was a joke
13:59 haxmeister oh..lol
13:59 moritz haxmeister: use JSON::Tiny; my %stuff = from-json($your-json-string)
13:59 haxmeister got that
13:59 haxmeister but now a value
14:00 haxmeister hash of hash.. I dunno what to do as far as syntax :(
14:00 moritz and then something like  for %stuff.kv -> $name, %obj { say "$name has path %obj<path>" }
14:00 haxmeister kk I'll tinker with that.. ty
14:00 ChoHag joined #perl6
14:06 Exodist joined #perl6
14:06 cpage_ joined #perl6
14:10 Sound_ joined #perl6
14:15 mr-foobar joined #perl6
14:20 alimon joined #perl6
14:22 haxmeister ah I see.. say %mystuff.keys[0]
14:22 haxmeister still more..
14:23 moritz haxmeister: I can recommend http://shop.oreilly.com/product/0636920065883.do for some introductory material to Perl 6
14:23 moritz (my book isn't available for purchase right now)
14:24 moritz (though USD 50.99 is quite a price...)
14:24 haxmeister moritz: I can't make a big purchase right now.. I'll just have to dig on google and ask silly questions for now
14:24 khw joined #perl6
14:24 haxmeister but your module works and installs fine
14:25 haxmeister I just realize I have no clue how to get data out of mixed data structures in perl6
14:25 moritz haxmeister: pro tip: go to https://github.com/LaurentRosenfeld/thinkperl6
14:25 moritz clone the repo
14:26 moritz cd book && pdflatex thinkperl6.tex
14:26 moritz enjoy a free PDF version
14:26 haxmeister oh wow
14:27 haxmeister thanks a million
14:32 curt_ m: use JSON::Fast; say to-json(Int);
14:32 camelia rakudo-moar 643593: OUTPUT: «===SORRY!===␤Could not find JSON::Fast at line 1 in:␤    /home/camelia/.perl6␤    /home/camelia/rakudo-m-inst-1/share/perl6/site␤    /home/camelia/rakudo-m-inst-1/share/perl6/vendor␤    /home/camelia/rakudo-m-inst-1/share/perl6␤    CompUnit::…»
14:32 matiaslina joined #perl6
14:34 haxmeister curt?
14:41 timotimo star: use JSON::Fast; say to-json(Int);
14:41 camelia star-m 2016.10: OUTPUT: «Use of uninitialized value $obj of type Int in string context.␤Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.␤  in sub to-json at /home/camelia/star-2016.10/share/perl6/site/sources/11ED005DCC03AA42CAA87A439556…»
14:47 ChoHag joined #perl6
14:49 japhdc joined #perl6
14:49 curt_ Fix for JSON::Fast https://github.com/timo/json_fast/pull/23
14:49 stmuk joined #perl6
14:51 TEttinger joined #perl6
15:08 * [Coke] sadly adds a 1-star review to p6&parrot essentials with a note about parrot.
15:09 jdv79 is that book useful now?
15:10 jdv79 2004.  wow time flies.
15:10 * geekosaur thinks the language has drifted just a bit from then
15:12 cdg joined #perl6
15:14 sufrostico joined #perl6
15:16 klapperl joined #perl6
15:18 poohman joined #perl6
15:22 matt_ joined #perl6
15:23 kurahaupo joined #perl6
15:30 mr-foobar joined #perl6
15:33 Geth Swapped META.info → META6.json in 6 dists in https://github.com/perl6/ecosystem/commit/45fc38a106
15:34 titsuki joined #perl6
15:40 rindolf joined #perl6
15:43 kyan joined #perl6
15:48 poohman_ joined #perl6
15:53 zakharyas joined #perl6
16:06 perlpilot joined #perl6
16:13 poohman joined #perl6
16:13 ChoHag joined #perl6
16:15 domidumont joined #perl6
16:17 mcsnolte joined #perl6
16:18 domidumont joined #perl6
16:19 itaipu joined #perl6
16:24 Cabanossi joined #perl6
16:26 haxmeister odd when addressing the data structure, I can leave the dots out???..
16:26 haxmeister dots or no dots... that is the question
16:27 haxmeister %mystuff<mix-ins>[1]<shortname>; is the same as %mystuff.<mix-ins>.[1].<shortname>;
16:28 haxmeister either perl6 is really really smart.. or that's not supposed to work..lol
16:28 timotimo yeah you can leave the dots out
16:29 haxmeister man that is badass
16:29 timotimo i think of it more like "you can put dots there if you want"
16:29 haxmeister who sat around and thought of all these conveniences.. brilliance in the little stuff
16:29 timotimo well, we took enough time :)
16:29 haxmeister lol.. I like it a lot
16:29 timotimo but many things were already in relatively early
16:30 haxmeister I was tromping through tuts and docs to try and figure how I was going to extract certain values from a mixed and nested data structure.. but wow.. I was over thinking it
16:31 haxmeister #Perl6JustWorks
16:32 stmuk_ joined #perl6
16:32 timotimo yeah, it really does
16:32 timotimo have you seen autovivification?
16:32 timotimo m: my @thing; %thing<mix-ins>[2]<shortname> = "hey"; say %thing.perl
16:32 camelia rakudo-moar 643593: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Variable '%thing' is not declared. Did you mean '@thing'?␤at <tmp>:1␤------> 3my @thing; 7⏏5%thing<mix-ins>[2]<shortname> = "hey"; s␤»
16:32 timotimo m: my %thing; %thing<mix-ins>[2]<shortname> = "hey"; say %thing.perl
16:32 camelia rakudo-moar 643593: OUTPUT: «{:mix-ins($[Any, Any, {:shortname("hey")}])}␤»
16:33 haxmeister I can't make sense of all that
16:34 timotimo by addressing things inside a structure you can build a structure even if it wasn't there before
16:34 timotimo in other languages the same code would be like:
16:34 haxmeister oh you added list item to the shortname key
16:34 timotimo "if 'mix-ins' not in %thing: %thing<mix-in> = Hash.new; ..."
16:35 timotimo "if len(%thing<mix-ins>) < 2: %thing<mix-ins>[2] = Hash.new"
16:35 timotimo etc etc
16:35 timotimo BBL
16:35 haxmeister I'm digging in.. data structures are kindof important
16:36 haxmeister ty
16:36 timotimo same with pure arrays
16:36 timotimo m: my @foo; @foo[1;4;3;6;8;7] = "hi"; say @foo.perl
16:36 camelia rakudo-moar 643593: OUTPUT: «[Any, [Any, Any, Any, Any, [Any, Any, Any, [Any, Any, Any, Any, Any, Any, [Any, Any, Any, Any, Any, Any, Any, Any, [Any, Any, Any, Any, Any, Any, Any, "hi"]]]]]]␤»
16:37 timotimo you don't have to go through each dimension and make sure it has an array in there
16:37 timotimo or create a full array of arrays of arrays of arrays of arrays of arrays up front
16:38 timotimo and if you don't want to have autovivification you set a type constraint on your leaf arrays/hashes so putting a hash or array in them wouldn't be acceptable:
16:38 timotimo m: my @foo; @foo[2]<hey> = 1; say @foo; # autovivification of stuff inside @foo elements allowed
16:38 camelia rakudo-moar 643593: OUTPUT: «[(Any) (Any) {hey => 1}]␤»
16:38 timotimo m: my Str @foo; @foo[2]<hey> = 1; say @foo; # autovivification of stuff inside @foo elements allowed
16:38 camelia rakudo-moar 643593: OUTPUT: «Type check failed in assignment to @foo; expected Str but got Hash (${})␤  in block <unit> at <tmp> line 1␤␤»
16:38 haxmeister ah yes.. I do like the constraint mechanism
16:38 timotimo not allowed ^
16:39 timotimo not only access with postcircumfix:<{ }> and postcircumfix:<[ ]> autovivifies
16:39 timotimo "push" also does
16:39 timotimo and append and unshift
16:39 haxmeister first time I've seen the @foo[1;2;5;6] syntax.. for multi-dim arrays.. (learned a new neat trick)
16:39 timotimo m: my %foo; push %foo<yeah>, "hi"; say %foo.perl
16:39 camelia rakudo-moar 643593: OUTPUT: «{:yeah($["hi"])}␤»
16:39 mcmillhj joined #perl6
16:40 timotimo ^- creates an aray inside of the yeah key inside %foo
16:41 haxmeister this needs to be in a tut specifically about complex data structures (aside from class/objects)
16:41 timotimo m: my $foo; push $foo, "yeah"; say $foo.WHAT; say $foo.perl
16:41 camelia rakudo-moar 643593: OUTPUT: «(Array)␤$["yeah"]␤»
16:41 timotimo ^- creates an array inside a $foo variable
16:41 timotimo (because arrays are what you push to)
16:50 yqt joined #perl6
16:56 haxmeister my @foo[2]<mykey> = 1   the fact that this will create/nest a hash into the array and set a key/value pair just blows my mind
16:56 haxmeister changing the way I would normally use this stuff
17:03 gfldex haxmeister: multidim subscripts leave room for improvement, see: https://gfldex.wordpress.com/2017/04/17/slipping-in-a-config-file/
17:08 setty1 joined #perl6
17:08 TreyHarris print TODO[@Writing] Take a look at tut haxmeister mentioned above
17:08 TreyHarris d'oh
17:13 wamba joined #perl6
17:18 alimon joined #perl6
17:25 mcmillhj joined #perl6
17:28 robertle_ joined #perl6
17:34 japhdotcom joined #perl6
17:36 lizmat joined #perl6
17:39 Cabanossi joined #perl6
17:44 TreyHarris From the logs, it seems like some folks have written Weechat scripts for typing Perl6 unicode characters even when the terminal only offers ascii input (like latex_unicode.py). Have any of you shared your script? I'm writing one for RFC 1345 and don't want to reinvent wheels
17:45 TreyHarris (partly because latex is too verbose, partly because latex interferes with Perl6 syntax, and partly because latex_unicode.py doesn't support the full range of symbols I'd like)-
17:50 alimon joined #perl6
17:52 poohman_ joined #perl6
18:04 z448 joined #perl6
18:08 revere joined #perl6
18:11 alimon joined #perl6
18:14 espadrine joined #perl6
18:14 revere joined #perl6
18:34 TimToady joined #perl6
18:36 alphah_ joined #perl6
18:41 alphah joined #perl6
18:41 ChoHag joined #perl6
18:42 alphah_ joined #perl6
18:44 poohman joined #perl6
18:48 alphah joined #perl6
18:59 nadim_ joined #perl6
19:03 salios joined #perl6
19:04 hythm joined #perl6
19:11 lichtkind joined #perl6
19:12 ChoHag joined #perl6
19:16 user_4123 joined #perl6
19:21 hythm joined #perl6
19:27 kyan joined #perl6
19:28 Sound joined #perl6
19:28 Sound joined #perl6
19:41 hythm joined #perl6
19:44 hythm joined #perl6
19:45 tyil !p say "t" ~~ ["t", "b"]
19:45 tyil p6: say "t" ~~ ["t", "b"]
19:45 camelia rakudo-moar 65c078: OUTPUT: «False␤»
19:45 tyil hmm
19:45 tyil I was hoping this to return True
19:46 gfldex m: say <t> ∈ <t e>;
19:46 camelia rakudo-moar 65c078: OUTPUT: «True␤»
19:46 tyil I dont even know where to start creating that character :p
19:47 gfldex tyil: you could start here: https://gfldex.wordpress.com/2016/08/31/one-line-of-unicode-at-you-fingertips/
19:48 tyil I use neither irssi nor screen tho
19:48 tyil I just want to check wether a val exists in an array
19:49 gfldex tyil: this might help https://docs.perl6.org/language/unicode_entry
19:49 tyil it would, if I know what chain to make with compose for it
19:50 gfldex tyil: you could steal (most) of https://github.com/gfldex/digraphs/blob/master/bin/digraphs.pl
19:52 haxmeister recommend good XML parsing package?
19:53 Cabanossi joined #perl6
19:54 AlexDaniel joined #perl6
19:58 hythm joined #perl6
19:59 haxmeister nvm.. found them all
20:05 Zoffix joined #perl6
20:05 Ven joined #perl6
20:06 Zoffix tyil: all fancy ops have ASCII alternatives: https://docs.perl6.org/language/unicode_texas
20:06 Zoffix tyil: and you l
20:07 Zoffix tyil: and you likely want .first method unless you don't care about speed or edge cases
20:07 tyil I already found those
20:07 tyil I just want to see if a $value exists in a @array
20:08 Zoffix ∈ is  a set op, so it spends time converting the arrat to a set and then then you have the object identity issues
20:09 tyil I settled for just looping through the array to see if the value exists
20:09 Zoffix m: say 5 (elem) [1, 2, 5]
20:09 camelia rakudo-moar 65c078: OUTPUT: «True␤»
20:09 tyil because that other guy was insisting solely I stick to unicode chars that he demands I use irssi and screen for
20:10 lucs Zoffix: Hey, never got around to thank you for adding the "try out the code" thing in your P6 tweets.
20:10 tyil and I honestly just want it to work
20:10 lucs So, thanks!
20:10 Zoffix m: say 5 (elem) <1 2 5> # false Int 5 and IntStr 5 are not the same
20:10 camelia rakudo-moar 65c078: OUTPUT: «False␤»
20:10 Zoffix tyil: just use (elem) instead of that thing
20:10 cdg joined #perl6
20:10 tyil that still returned false for me, idk
20:11 Zoffix tyil: what sort of stuff is in your array/$value?
20:11 tyil a String $value and an @array of Strings
20:12 Zoffix Yeah, you probabpy have allomorphs in it
20:14 Zoffix $value (elem) @array>>.Str
20:14 Zoffix $value.Str (elem) @array>>.Str
20:14 Zoffix tyil: $value eq any @array
20:15 AndyDee joined #perl6
20:15 Zoffix m: say 5 == any <1 2 5>
20:15 camelia rakudo-moar 65c078: OUTPUT: «any(False, False, True)␤»
20:15 Zoffix m: say so 5 == any <1 2 5>
20:15 camelia rakudo-moar 65c078: OUTPUT: «True␤»
20:15 tyil http://termbin.com/kazx
20:15 tyil that was what I was originally trying
20:16 Zoffix tyil: that looks like array is the wrong type for the job
20:17 tyil what should I use instead?
20:17 Zoffix buggable: Set
20:17 Zoffix huggable: Set
20:17 huggable Zoffix, Immutable collection of distinct objects: https://docs.perl6.org/type/Set
20:18 Zoffix m: my $stuff = set <foo bar meow>; my $value = 'meow'; if $stuff{$value} { say "in it" }
20:18 camelia rakudo-moar 65c078: OUTPUT: «in it␤»
20:18 Zoffix m: my $stuff = set <foo bar meow>; my $value = 'meowaaa'; if $stuff{$value} { say "in it" }
20:18 camelia rakudo-moar 65c078: ( no output )
20:19 Zoffix m: my $stuff = set <foo bar meow>; my $value = 'meow'; if $value (elem) $stuff { say "in it" }
20:19 camelia rakudo-moar 65c078: OUTPUT: «in it␤»
20:20 Zoffix some more docs on this stuff: https://docs.perl6.org/language/setbagmix
20:21 Zoffix And there's an article on advent blog
20:21 Zoffix huggable: advent
20:21 huggable Zoffix, https://github.com/perl6/mu/blob/master/misc/perl6advent-2016/schedule
20:21 tyil that seems to work, thanks Zoffix
20:22 Zoffix this one https://perl6advent.wordpress.com/2016/12/07/
20:22 Zoffix cool
20:22 Zoffix left #perl6
20:34 colomon joined #perl6
20:39 raiph m: my $value = 'abc'; my @array = 'abc', 'def'; say @array (cont) $value # tyil: you had the args the wrong way round; `foo (cont) bar` means "array foo (cont)ains item bar"
20:39 camelia rakudo-moar 65c078: OUTPUT: «True␤»
20:39 raiph tyil: the (cont) op is the inverse of the (elem) op
20:42 tyil hmm
20:42 tyil but I just changed it around to use a set ;~;
20:43 raiph that's another way
20:43 tyil its https://github.com/scriptkitties/p6-MPD-Client/blob/master/lib/MPD/Client/Playback.pm6#L185
20:43 tyil there's probably tons of other things that could be done better
20:44 raiph i like how you have it. reads clearly to me.
20:44 AlexDaniel huggable: advent :is: https://github.com/perl6/mu/blob/master/misc/perl6advent-2017/schedule
20:44 huggable AlexDaniel, Added advent as https://github.com/perl6/mu/blob/master/misc/perl6advent-2017/schedule
20:45 tyil gonna add another page of mpd calls tomorrow probs
20:45 tyil once I have them all, I'll add it to ecosystem
20:45 tyil unless I get around to adding a proper travis test before that point already
20:46 colomon joined #perl6
21:00 Ven joined #perl6
21:04 scovit joined #perl6
21:12 jetjr joined #perl6
21:21 Celelibi joined #perl6
21:26 jetjr I'm having an issue with pattern matching a string. It's acting "greedy" but I want each match to count: https://pastebin.com/fYATRmQF
21:28 timotimo then put a ? after the **
21:28 timotimo i think
21:29 jnthn m: my $s = "ATGXXXXXTAGXXXATGXXXXXTAG"; say $s ~~ m:g/ATG .**? 5..* TAG/;
21:29 camelia rakudo-moar 65c078: OUTPUT: «(「ATGXXXXXTAG」 「ATGXXXXXTAG」)␤»
21:30 avuserow joined #perl6
21:30 jnthn All the quantifiers are greedy by default, but can be followed with a ? to make them frugal
21:30 jetjr Great! Thanks it works.
21:30 jnthn (??, +?, *?, **?)
21:33 dct joined #perl6
21:34 Ven_ joined #perl6
21:38 Cabanossi joined #perl6
21:38 perlpilot That third * in jetjr's RE was slightly difficult for me to parse.  My brain kept wanting to make it a quantifier.
21:39 timotimo :D
21:39 timotimo i wouldn't have put the TAG directly after the * like that
21:39 timotimo oh, jetjr already left
21:39 perlpilot Maybe I'm just too used to see .* in regex and so my brain naturally goes there
21:39 timotimo i would have pointed out that you're free to put spaces into your regexen
21:39 timotimo :D
21:43 z448 joined #perl6
21:44 jnthn Yeah, I re-formatted it when trying it here :P
21:45 jnthn Oh, but another space coulda been good after the . too :)
21:46 hythm m: say 1+-+-+-+-2
21:46 camelia rakudo-moar d6798b: OUTPUT: «3␤»
21:58 vike joined #perl6
21:59 AlexDaniel hythm: yea :)
21:59 AlexDaniel you can put any amount of infixes there
21:59 timotimo but those are mostly prefixes?
21:59 AlexDaniel this is what I meant…
21:59 AlexDaniel m: say 1+!!-+-?+!-+-?2
21:59 camelia rakudo-moar d6798b: OUTPUT: «1␤»
22:00 AlexDaniel was thinking not to say infix and in the end said it -_-
22:00 timotimo :D
22:00 timotimo also don't put ?? in there by accident
22:00 AlexDaniel m: say 1+!!-+-?\?+!-+-?2
22:00 camelia rakudo-moar d6798b: OUTPUT: «2␤»
22:01 hythm At first was thinking its a bug on my local rakudo version, Wanted to make sure
22:04 jnthn Perl 6's parsing rules are, in this case, really very simple
22:04 jnthn After an infix, the only possible things we can be looking for are a term or a prefix
22:05 jnthn So 1 is a term, + is an infix, after that we must parse prefixes
22:05 jnthn So it's, counting aside, "easy to read" provided you know the langauge. :P
22:05 timotimo and it's important to know if the code included a module that provides an +-+-+-+-+ infix operator :D
22:06 hythm easy to read now :p
22:06 jnthn timotimo: Then it's a different language ;-)
22:06 timotimo that's true
22:07 timotimo cat is demanding belly rubs now
22:07 jnthn :)
22:07 * jnthn demands sleep
22:07 jnthn 'night o/
22:08 timotimo nite jnthn!
22:13 AlexDaniel .oO( belly ribs? What? … ah… rubs… )
22:18 skids joined #perl6
22:23 z448 joined #perl6
22:32 labster joined #perl6
22:37 Actualeyes joined #perl6
22:53 Cabanossi joined #perl6
23:20 kurahaupo_ joined #perl6
23:32 BenGoldberg joined #perl6
23:37 sufrostico joined #perl6
23:45 krshn joined #perl6
23:46 krshn I just installed Rakudo Star 2017.04. Installed Rakudo Star for the first time. Earlier been using rakudobrew. I noticed that I am not able to use zef out-of-the-box
23:47 krshn Steps to replicate on mac-osx: Copy the Rakudo folder to Applications shortcut. Add to PATH variable as mentioned in the README. Run zef install Math::Primesieve
23:47 krshn Got the following error --
23:50 krshn https://gist.github.com/skrisna/140372f1eaa40363a74da5b0e7877649
23:50 krshn I haven't seen this before when using rakudobrew
23:51 timotimo interesting, let's see.
23:54 timotimo could you set the environment variable ZEF_PLUGIN_DEBUG so we can find out what fetcher it's trying to use? also --verbose or something for the zef commandline?
23:54 krshn Sorry, need more info. What do I set ZEF_PLUGIN_DEBUG to? 1?
23:54 timotimo any non-empty string, i expect
23:54 timotimo perhaps not 0
23:55 timotimo hm, actually, the update of the p6c ecosystem stuff doesn't really fail, just spits out some errors and continues working anyway
23:55 timotimo i can't install primesieve either but that's because i don't have the library installed
23:57 krshn https://gist.github.com/skrisna/23bc0e5a3b13fc1154ce369cc74e1609
23:58 krshn Sorry -- https://gist.github.com/skrisna/7de76ef638e4d7ce3445cc0a2b544072

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

Perl 6 | Reference Documentation | Rakudo