»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
00:03 mcmillhj joined, pharv left 00:04 pharv joined, pharv left, pharv joined, comborico1611 left 00:07 klapperl joined 00:08 mcmillhj left 00:13 simpleseeker joined 00:14 simpleseeker left 00:15 pharv left 00:16 pharv joined 00:18 simpleseeker joined 00:27 stmuk_ joined 00:29 stmuk left 00:30 simpleseeker left 00:46 mcmillhj joined 00:47 simpleseeker joined 00:51 mcmillhj left 00:56 Zoffix left 00:59 simpleseeker left 01:02 mcmillhj joined 01:05 FROGGS left 01:06 mcmillhj left 01:10 w_richard_w1 joined 01:12 zachk left, w_richard_w left 01:16 AlexDaniel left 01:19 FROGGS joined, mcmillhj joined 01:23 pharv left 01:24 mcmillhj left 01:25 Herby_ left 01:32 pharv joined 01:38 mcmillhj joined 01:42 athenot left, mcmillhj left 01:44 athenot joined 01:46 ilbot3 left 01:50 mcmillhj joined 01:53 pharv left 01:55 mcmillhj left, pharv joined 01:56 ilbot3 joined, ChanServ sets mode: +v ilbot3, pharv left 01:57 pharv joined 01:59 FROGGS_ joined 02:03 FROGGS left 02:06 mcmillhj joined 02:10 mcmillhj left 02:17 mcmillhj joined 02:22 mcmillhj left 02:30 mcmillhj joined 02:34 mcmillhj left 02:46 pilne left 02:48 andrzejku_ joined, andrzejku left 03:04 xtreak joined 03:08 mcmillhj joined 03:13 mcmillhj left 03:18 BenGoldberg left 03:19 ribasushi joined 03:20 xtreak left 03:21 mcmillhj joined, xtreak joined 03:25 mcmillhj left 03:28 w_richard_w joined 03:30 Actualeyes joined 03:31 w_richard_w1 left 03:44 mcmillhj joined 03:49 mcmillhj left 03:59 mcmillhj joined 04:03 mcmillhj left 04:20 cpup left 04:22 Herby__ joined
Herby__ o/ 04:22
\o 04:28
I'm trying to learn the basic of Testing my programs. I have a function that returns a hash with strings for values. How do I go about testing that? 04:35
04:37 curan joined 04:38 cpup joined
Herby__ or should I test keys in the hash separately? my %h = get-keys(x); is %h<info>, "stuff"; 04:41
04:44 mcmillhj joined 04:45 mryan joined 04:48 espadrine_ joined 04:49 espadrine left, mcmillhj left 04:58 rindolf joined 04:59 mcmillhj joined 05:03 mcmillhj left 05:08 jmerelo joined
Herby__ I'm guessing is-deeply is what I want 05:10
05:11 ufobat_ joined 05:13 rindolf left 05:16 sauvin joined 05:20 FROGGS_ left, rindolf joined 05:22 sauvin left 05:26 mcmillhj joined 05:28 wamba joined 05:29 sauvin joined 05:31 mcmillhj left 05:32 robertle left 05:37 mcmillhj joined 05:38 mryan left
Herby__ I'm guessing is-deeply is what I want 05:38
sorry, wrong window
jmerelo p6: sprintf '<%#.0o>', 0o1 05:40
camelia ( no output )
jmerelo p6: say sprintf '<%#.0o>', 0o1
camelia <01>
05:42 mcmillhj left
Geth doc: 0a4653da7b | (JJ Merelo)++ | doc/Type/Str.pod6
Fixes and adds # examples

There was one error, and the explanation was not too clear. Hope it's better now, and closes #1248
05:43
synopsebot Link: doc.perl6.org/type/Str
05:51 AlexDaniel joined 05:53 mcmillhj joined 05:55 pharv_ joined 05:59 mcmillhj left, pharv left 06:00 pharv_ left 06:07 notbenh left
jmerelo p6: my @sliceable = [[ ^10 ], ['a'..'h'], ['Ⅰ'..'Ⅺ']]; say @sliceable[ ^3; 4..6 ]; 06:07
camelia (4 5 6 e f g Ⅴ Ⅵ Ⅶ)
jmerelo p6: my @sliceable = [[ ^10 ], ['a'..'h'], ['Ⅰ'..'Ⅺ']]; say @sliceable[ 2; 4..6 ]; 06:09
camelia (Ⅴ Ⅵ Ⅶ)
jmerelo p6: my @sliceable = [[ ^10 ], ['a'..'h'], ['Ⅰ'..'Ⅺ']]; say @sliceable[ 1,2; 4..6 ];
camelia (e f g Ⅴ Ⅵ Ⅶ)
06:13 notbenh joined 06:16 espadrine_ left 06:17 xtreak left 06:18 lizmat left 06:20 xtreak joined 06:27 pharv joined 06:29 lizmat joined 06:30 mcmillhj joined 06:31 pharv left 06:35 mcmillhj left
Geth doc: e76ec8f687 | (JJ Merelo)++ | 2 files
Adds semilist to docs, closes #1266
06:36
06:36 jmerelo left 06:37 xtreak left
Herby__ disregard my testing question above, i think I got it figured out 06:39
06:42 domidumont joined 06:45 mcmillhj joined 06:48 domidumont left, domidumont joined
Herby__ disregard my testing question above, i think I got it figured out 06:48
... i gotta go to bed 06:49
06:50 mcmillhj left
tyil Herby__: youre an adult, you dont have to if you dont wanna 06:53
06:53 robertle joined
moritz tomorrow's Herby__ might disagree :-) 06:55
tyil pfff
thats something to for tomorrow Herby__ to worry about 06:56
Herby__ tyil: you are right!
tyil :D
Herby__ and tomorrow is Friday, and I have the day off :)
tyil but 06:57
today is friday
Herby__ hmm. yeah I really need to go bed
o/
tyil \o
06:58 mcmillhj joined 07:03 mcmillhj left 07:04 mryan joined 07:06 Ven`` joined 07:07 xtreak joined 07:14 irco left 07:17 jmerelo joined 07:18 mcmillhj joined 07:19 khw left 07:20 mryan left 07:23 wamba left 07:24 mcmillhj left
Geth ¦ doc: JJ self-assigned Is flat another way to say |? Why do we only document one? github.com/perl6/doc/issues/892 07:26
07:31 xtreak left, mcmillhj joined 07:34 xtreak joined 07:35 Ven` joined 07:36 Ven`` left, darutoko joined, mcmillhj left, mryan joined 07:45 mcmillhj joined 07:50 mcmillhj left 07:54 Ven` left 07:56 wamba joined 07:57 Ven`` joined 07:58 pharv joined 08:01 mcmillhj joined 08:02 pharv left 08:06 mcmillhj left, xinming_ joined 08:10 xinming left 08:11 mcmillhj joined 08:13 mryan left 08:16 wamba left, mcmillhj left
robertle releasable6: status 08:17
releasable6 robertle, Next release in ≈1 day and ≈10 hours. 4 blockers. 224 out of 242 commits logged
robertle, Details: gist.github.com/5743454a9cd97ea31d...b4b281febd
jmerelo Time to panic \o/ 08:18
08:18 mryan joined 08:30 zakharyas joined 08:34 zakharyas left 08:35 zakharyas joined 08:42 mryan left, xtreak_ joined 08:43 mcmillhj joined 08:46 xtreak left 08:48 mcmillhj left 08:49 xtreak_ left 08:53 wamba joined 08:54 mcmillhj joined 08:58 mcmillhj left 09:01 kurahaupo_ joined 09:04 kurahaupo left
stmuk_ github.com/sergot/http-useragent/issues/195 09:09
09:09 HaraldJoerg joined
stmuk_ hmmm the root problem with the OpenSSL dependency is the Rakudo Star Windows binary build 09:11
jmerelo stmuk_: We can always ditch Windows, or have a different, non-SSL, build for Windows. 09:12
stmuk_ I'm seriousily considering abandoning Windows Star support since roast hasn't passed on Windows for months anyway
09:12 xtreak joined
jmerelo stmuk_: Yay!!!! 09:12
stmuk_ its a pity :(
jmerelo stmuk_: it's a chance for Microsoft to fund a grant, or an engineer, to fix that for them, if they so want. 09:13
stmuk_ I wonder if roast passes more on the WSL build
jmerelo: that will never happen
jmerelo We can always set it aside for a Summer of Code project, next year.
stmuk_: who knows. I've heard weirder things...
Anyway, ++ on ditching Windows. 09:14
stmuk_ we just need one Windows dev to fix the issues .. my main motivation in shipping is that someone will download the MSI and get annoyed by the problems and fix it
jmerelo: I don't understand why abandoning a platform would be good 09:15
I've actually had quite a lot of feedback about people using the Windows binary release (more than the macOS one)
robertle me neither. I have not used windows for a long time, but it is a major operating system. if we cannot run on that, then clearly our portability and geenral awesomeness sucks 09:16
jmerelo stmuk_: hey, I'm just supporting what you said. Abandoning a platform need not be good by itself, but the SSL thing is causing lots of problems elsewhere.
Windows 10 does have an "Linux subsystem"
jnthn Hm, does the OpenSSL module not install on Windows? 09:17
jmerelo We can always tell people using Windows to work with that. They're developers, they probably know how to set it up.
stmuk_ jnthn: it does install .. my main issue is that it uses bundled SSL DDLs which are usually months out of date
09:17 w_richard_w left
jmerelo Also they can use the official Docker container. It's not as if Windows (or any other platform) developer are left out in the cold. 09:17
stmuk_ jnthn: I don't really what to ship old versions of OpenSSL since its recent history of serious security issues 09:18
jmerelo stmuk_: can't that be fixed by using nuget or chocolatey packages? 09:19
Or simply downloading new versions? Is that OpenSSL's or Microsoft's fault? 09:20
stmuk_ jmerelo: that's a good point but adds other dependency
jnthn Agree, it'd be good to get those DLLs updated (and figure out some way that multiple people can do so, if there isn't already a way that they can, so it won't block on one individual)
jmerelo stmuk_: it's that or deleting SSL dependencies on all Rakudo*-included modules, causing lots of tests failed downstream... 09:21
stmuk_ jnthn: also there is a wider issue which is that Windows roast hasn't passed for months and that Star (particulary roast) is supposed to pass tests
jmerelo stmuk_: and anyway, you've mentioned above that roast does not pass in Windows, right? So it's not only SSL, but more stuff...
stmuk_ jmerelo: the SSL deps are new deps
jmerelo stmuk_: anyway, my point is that Windows could be dropped not only because of the SSL problems, but other unrelated problems, right? 09:22
SSL is not the single reason why, is that correct?
stmuk_ jmerelo: there are general windows problems yes 09:24
anyway I've added github.com/sergot/openssl/issues/60 09:25
I'll probably still muddle through as before anyway!
jnthn stmuk_: Yeah, we should really make a pass todo'ing the ones on Windows that have no resolution in sight, so we can at the very least spot/evaluate new regressions. 09:26
stmuk_: I've fixed a lot of them in the past, and half the time the problem was a test making a bad assumption rather than an actual bug, though.
stmuk_ hmmm that suggests we should continue shipping Windows binaries anyway 09:27
jnthn Oh, on that I'm 100% sure we should
Otherwise it's losing a huge number of potential users 09:28
09:28 pmurias joined
jmerelo stmuk_: we should try and solve the SSL problems with included modules then. In some cases it was also tests making incorrect assumptions. But putting IO::Async::SSL as a test or build dependency would probably solve the issue, right? 09:28
stmuk_ I could probably just pull the SSLs DDLs from chocolatey as part of the build anyway without installing chocolatey itself 09:29
jmerelo stmuk_++
pmurias jmerelo: re telling people to setup weird things doesn't encourage them to try Rakudo out
stmuk_ jnthn: yes I'm surprised how many people seem to use the MSI probably because windows doesn't ship a compiler by default
jmerelo pmurias: Docker is nowadays more mainstream than git or bash.
pmurias: and most developers have the Ubuntu subsystem set up anyway. In fact, using the Docker container is probably the fastest thing if you want to try Rakudo 09:30
stmuk_ jmerelo: I think OpenSSL should generally be a optional dep
jnthn stmuk_: Yeah, there's really not a "compile your own" culture on Windows. 09:31
stmuk_: And it tends to be something of a pain to do it.
jmerelo stmuk_: ... as a temporary measure while SSL problems are solved in Windows.
09:32 mcmillhj joined
pmurias jmerelo: wouldn't the rakudo running in the Ubuntu subsystem have harder access to the rest of the os? 09:33
jmerelo pmurias: it can access the filesystem alright, if I understand it correctly. It has to run mostly console based apps, though. But it's not a VM, you can keep running your stuff. 09:34
HaraldJoerg Listening to network ports from the Ubuntu system is difficult to impossible 09:36
09:36 mcmillhj left
HaraldJoerg At least for the "privileged ports" (SSH) I've found no way 09:36
jnthn Also on Ubuntu Subsystem, please remember that many developers work inside a $big-corporation with comparatively ancient Windows versions. 09:37
stmuk_ WSL isn't available on Windows 10 LTSB yet 09:40
thats the Windows 10 without the Metro crap :) 09:41
09:43 xtreak_ joined
jnthn
.oO( Let That Sucker Burn? :) )
09:43
09:43 mcmillhj joined 09:46 xtreak left 09:47 pecastro joined 09:48 mcmillhj left 09:49 kurahaupo_ is now known as kurahaupo 09:50 pecastro_ left 09:54 pharv joined 09:58 xtreak_ left 09:59 pharv left
stmuk_ :) 09:59
10:00 xtreak joined 10:01 pmurias left 10:04 xtreak left 10:05 xtreak joined 10:15 Actualeyes left 10:24 markong joined
El_Che jmerelo: I am running test for a rakudo+needed_deps deb for perl6/doc 10:24
tests
10:27 Actualeyes joined 10:32 zakharyas left 10:34 zakharyas joined 10:35 Zoffix joined
Zoffix Huge -1 on this: "<stmuk_>: I'm seriousily considering abandoning Windows Star support" 10:35
As I said a few weeks ago, Learning Perl 6 is soon to come out and we'll use an influx of users. We need to FIX Windows support, not adandon it 10:36
"we just need one Windows dev to fix the issues"... That was gonna be me in my copious free time. Lots of failing tests are failing due to RT#132258 last I took a look. 10:37
synopsebot RT#132258 [new]: rt.perl.org/Ticket/Display.html?id=132258 [SECURITY][WINDOWS] `run "perl6" ...` can be made to execute shell commands
Zoffix Basically just difference between how `run` behaves with $*EXECUTABLE on windows and the tests just need some polishing 10:38
El_Che Zoffix: I run illegally Linux at work instead of a managed windows laptop, and even I thing we need Windows binary distributions :) 10:41
Zoffix s/we'll use an influx/we'll see an influx/; 10:42
10:43 cog__ left 10:51 xtreak_ joined, xtreak left 10:52 Ven`` left, Kaiepi left 10:59 Kaiepi joined
Geth rakudo.org: hankache++ created pull request #8:
perl6 hello.pl -> perl6 hello.p6
11:01
rakudo.org: 144eb82820 | (Naoum Hankache)++ (committed using GitHub Web editor) | templates/files.html.ep
perl6 hello.pl -> perl6 hello.p6

  .p6 seems the most widespread extension
11:03
rakudo.org: 8bc61fbab2 | (Zoffix Znet)++ (committed using GitHub Web editor) | templates/files.html.ep
[REAPP] Merge pull request #8 from hankache/master

perl6 hello.pl -> perl6 hello.p6
11:09 Ven`` joined 11:12 andrzejku_ left 11:13 andrzejku joined 11:15 zakharyas left 11:20 xtreak_ left 11:21 avalenn left 11:23 xtreak joined, xtreak left 11:24 avalenn joined 11:25 wamba left 11:40 jmerelo left 11:47 Kaiepi left 11:49 Ven`` left, Kaiepi joined 11:50 Kaiepi left 11:51 Kaiepi joined 11:54 abraxxa left 11:58 raynold left 11:59 pharv joined 12:03 Ven`` joined 12:04 pharv left 12:05 scimon joined 12:07 jmerelo joined
Geth doc: JJ self-assigned explain public attributes in /typesystem github.com/perl6/doc/issues/1572
JJ self-assigned containers/Type Constraints is wrong github.com/perl6/doc/issues/1217

Clarify whose are constraints.
According to @moritz's comment in the IRC conversation pointed from the issue. Closes #1217.
12:10
synopsebot Link: doc.perl6.org/language/containers
12:20 colomon left 12:31 Zoffix left, lizmat left
jmerelo p6: 1 … 9999999 12:33
p6: say (1 … 9999999).is-lazy 12:34
camelia (timeout)Potential difficulties:
Useless use of … in sink context
at <tmp>:1
------> 031 …7⏏5 9999999
False
jmerelo p6: my \lazy = (1 … 9999999).is-lazy 12:35
camelia ( no output )
jmerelo p6: my \lazy = (1 … 9999999); say \lazy.is-lazy
camelia (timeout)
12:35 jmerelo left
MasterDuke p6: my \lazy = (1 … 9999999); say lazy.is-lazy 12:41
camelia False 12:42
12:46 mcmillhj joined 12:48 zakharyas joined 12:54 ufobat_ left
Geth museum-items: 8b1a624041 | raiph++ (committed using GitHub Web editor) | 2001/April Fool's Parrot.md
Create April Fool's Parrot.md
12:55
12:56 curan left 13:00 pharv joined 13:01 athenot left 13:05 pharv left
AlexDaniel Yeah let's please not abandon windows support… windows should get at least as much attention as big endian systems :) 13:17
13:19 Tison joined, mscha joined
Tison m: my @a = [[[1,2,3],[4,5,6]],[[7,8,9],[10,11,12]]]; my @b = [1,2,3]; say @a[@b]; @b = [1;2;3]; say @a[@b]; say @a[1,2,3]; say @a[1;2;3] 13:20
camelia ([[7 8 9] [10 11 12]] (Any) (Any))
([[7 8 9] [10 11 12]] (Any) (Any))
([[7 8 9] [10 11 12]] (Any) (Any))
(Any)
mscha m: my $h = a => <b c>; .say for $h<a>; # as expected
camelia b
c
mscha m: my %h = a => <b c>; .say for %h<a>; # why is this different?
camelia (b c)
Tison so semilist and comma-list are different in array suffix but the same when standalone? 13:21
timotimo i think we actually have an operator called postfix:<[;]> for semilists in postfix array access? 13:26
13:26 lumimies left, vcv joined, lumimies joined
Tison It is interesting to me that `my @b = [1;2;3]` acts like `my @b = [1,2,3]` 13:28
timotimo yes, it's only when you mix it with comma that it becomes apparent
Tison m: say [1,2;3]; say [1;2,3] 13:35
camelia [(1 2) 3]
[1 (2 3)]
Tison Oh, that's it
13:36 mrsolo joined
Altreus that's interesting 13:43
m: say [1,2;3,4
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in array composer; couldn't find final ']' (corresponding starter was at line 1)
at <tmp>:1
------> 3say [1,2;3,47⏏5<EOL>
expecting any of:
statement…
Altreus m: say [1,2;3,4]
camelia [(1 2) (3 4)]
Altreus m: say [1;2,3;4] # pretty sure I can guess
camelia [1 (2 3) 4]
timotimo yeah, it's for two-dimensional/one-level-nested arrays 13:44
Altreus so comma always forms a list and semicolon always separates them?
Can I understand from this that it could also have said [(1) (2 3) (4)] but that's equivalent?
timotimo not quite, that's the .gist representation and isn't valid code 13:48
if you say the .perl (or use dd instead of say) you'll get equivalent code (in some cases only a "best effort" representation, though)
13:49 jnap_ joined
Altreus m: say [1,2;3,4].perl 13:51
camelia [(1, 2), (3, 4)]
Altreus m: say [1;2,3;4].perl
camelia [1, (2, 3), 4]
Altreus m: say [(1),(2,3),(4)].perl
camelia [1, (2, 3), 4]
Altreus okay
trying to keep basic syntax in my head while also trying to do interesting things with metaclasses 13:52
... while trying to actually get paid for my Perl5 job
timotimo ooh metaclasses can be fun :) 13:53
Altreus yeah, I was taking a cue from that orm someone recently showed me as an example of metaclass goo 13:56
and now i'm stuck in it
in the sense that it looks super fun and interesting and I have no idea what I'm doing but I've sort of committed to doing it
so the module I am/was writing is now dependent on me understanding it :P
13:57 Zoffix joined
Zoffix mscha: because the first constructs a Pair and the second constructs a Hash and hashes containerize their values: perl6advent.wordpress.com/2017/12/02/ 13:57
m: my %h = a => <b c>; .say for %h<a><>; 13:58
camelia b
c
mscha m: my $h = { a => <b c>, d => <e f> }; .say for $h<a>; 14:01
camelia (b c)
mscha Ah, indeed.
14:01 aborazmeh joined, aborazmeh left, aborazmeh joined
mscha I still don't like (or fully understand) why `for` doesn't iterate when you give it one argument, even if it is a scalar container. 14:01
Altreus On any given day in which I look in this channel I end up reading at least one blog post 14:02
Someone should write a book
Zoffix You give it one thing to iterate over, so it iterates over one thing.
Altreus: some people are :)
moritz wrote 2
mscha m: my @a = (1,2,3); .say for @a; # then why does this iterate? 14:03
camelia 1
2
3
Altreus It was half sarcastic and half hurry up :D
Zoffix Altreus: I assume you're aware of the list of our books: perl6book.com/#p6-deepdive
mscha: because you gave it many things
Altreus See? Two things
Zoffix m: my @a = (1,2,3); .say for $@a;
camelia [1 2 3]
Zoffix mscha: ^ now it's one thing and it iterated over just one thing
Altreus I hadn't seen Deep Dive before 14:04
mscha Ok, I (mostly) understand now. Still don't like it, though. :-)
moritz would prefer something simpler as well
Zoffix likes it how it is
moritz no auto flattening, separate operator for array/list concatenation
Altreus Can I jump in with: how would you make $h<a> more than one thing?
moritz Altreus: .list or @($h<a>) 14:05
Altreus smells like tt2
:P
Zoffix Altreus: by avoiding the Scalar container
m: my %h; %h<a> := <b c>; .say for %h<a>
camelia b
c
mscha It's especially annoying when dealing with JSON data.
Zoffix m: my %h := Map.new: (a => <b c>); .say for %h<a>
camelia b
c
14:06 vcv left
Zoffix IME those who struggle with it don't use types correctly; e.g. sticking everything into an Array instead of using Lists 14:06
14:07 vcv joined
Zoffix `@($h<a>)` isn't suitable for all instances. The postfix `<>` is a better way to decont. 14:07
('cause @() caches Seqs, while <> doesn't)
14:08 aborazmeh left
Altreus The depth of Perl6 data typing still overwhelms me when I skim the surface like this 14:09
Tison m: .say for $(1, 2, 3)
camelia (1 2 3)
Altreus Zoffix>m: my %h = a => <b c>; .say for %h<a><>; # was this empty <> even relevant then?
m: my %h = a => <b c>; .say for %h<a>
camelia (b c)
Zoffix Altreus: yes, it's the decont 14:10
Altreus yes 🤔
Zoffix huggable: decont
huggable Zoffix, Article on containers and decont: perl6advent.wordpress.com/2017/12/...oneandonly
Altreus oh! You did := in the other example
Tison de-containerized
Zoffix Yeah
Altreus subtule
mscha m: use JSON::Fast; my $data = from-json('{ "a": [1,2,3] }'); .say for $data<a>;
camelia ===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
CompUni…
Zoffix ZofBot: subtle is decont, but never malicious
ZofBot Zoffix, And said was just trying to get you to eat something healthy
Zoffix star: use JSON::Fast; my $data = from-json('{ "a": [1,2,3] }'); .say for $data<a>; 14:11
camelia [1 2 3]
Zoffix mscha: that's the type abuse I was talking about. Why is that not a Map?
Tison There was a time I fought with this stuff.
mscha Zoffix: You'd have to ask the author of JSON::Fast. ;-)
Tison m: .say for $(1,2,3).Array 14:12
camelia 1
2
3
Tison m: my %h = a => <b c>; .say for %h<a>.Array; 14:13
camelia b
c
Zoffix m: my %h = a => <b c>; .say for my method {self}(%h<a>) 14:14
camelia b
c
Zoffix ^_
^
mscha m: use JSON::Fast; my $data = Map.new(%(from-json('{ "a": [1,2,3] }'))); .say for $data<a>; 14:15
camelia ===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
CompUni…
mscha star: use JSON::Fast; my $data = Map.new(%(from-json('{ "a": [1,2,3] }'))); .say for $data<a>;
camelia 1
2
3
timotimo Zoffix: you make a good point, but i might now have to deal with backwards compatibility. though perhaps what i really want is to offer :api<nomoreconts>
Zoffix timotimo: yeah, I'd say it's definitely too late to "just" make it use Map/List. Also, I imagine it depends a lot on the usecase. Some might want to mutate the structure a lot and coercing everything to mutable might be annoying 14:17
timotimo true
14:18 mcmillhj left, PotatoGim joined
timotimo i was envisioning an API where you'd pass your own factory functions, though if we made it methods, you could get an optional named parameter that gives you the "path" to the currently-being-created object 14:18
14:19 st_elmo joined 14:20 mcmillhj joined
Geth museum-items: 18a9ff48e3 | (Zoffix Znet)++ | 2 files
Fix the Year of The Mug
14:24
[Coke] nine: can't install Inline::Perl5 on a recent rakudo on windows, getting: ===> Building: Inline::Perl5:ver<0.32>:auth<github:niner> 14:31
Can't find string terminator '"' anywhere before EOF at -e line 1.
Zoffix nine: that looks like the bug you recently fixed. Needs a release maybe? 14:32
[Coke]: you should be able to install from a repo clone, but even then there are some residual issues with %RESOURCES: github.com/rakudo/rakudo/issues/17...-381081408 14:33
14:36 tbrowder_ left, FROGGS joined 14:37 tbrowder_ joined
nine Zoffix: yes, needs a release. Would be nice to have a fix for the remaining issue first though 14:38
Zoffix |7h try fix github.com/rakudo/rakudo/issues/17...-381081408 14:39
ZofBot Zoffix, Will remind you on 2018-04-20T17:39:32.541193-04:00 about try fix github.com/rakudo/rakudo/issues/17...-381081408
Zoffix Gonna give a go later today, though it's likely gonna be over my head
robertle DrForr: what's the status of your TT in perl6? is it working? does it "just" need more work? or is there a fundamental blocking issue? or perhaps a better thing to use? I need something like that...
14:51 pharv joined
FROGGS o/ 14:51
Zoffix \o 14:53
14:53 Zoffix left 14:55 pharv left 14:57 Ven`` left 14:59 Ven`` joined 15:02 vutral|kali joined 15:03 pharv joined 15:04 vcv left, lizmat joined
Geth museum-items: 7bc8005180 | raiph++ (committed using GitHub Web editor) | 2001/The Real Parrot.md
Create The Real Parrot.md
15:07
15:08 khw joined 15:10 vcv joined
Altreus this blog post is super helpful, not that I'll remember any of it 15:15
Altreus reads it thrice
15:20 Ven`` left 15:21 jmerelo joined
Geth doc: 37924efa7a | (Stefan Seifert)++ | doc/Language/modules.pod6
Remove obsolete advise about * as a module version

This has never been a good idea. This has caused issues like, once a version * of a module is installed, tools would never upgrade to newer versions. We have workarounds in the toolchain, but really we should not encourage users to rely on them.
15:22
synopsebot Link: doc.perl6.org/language/modules
15:24 wamba joined 15:27 AlexDaniel left 15:28 AlexDaniel joined 15:30 pharv left 15:34 Sgeo_ joined 15:35 AlexDaniel left 15:36 Sgeo__ left
Geth doc: JJ self-assigned 「my @a = 1 … 9999999」 is not lazy, explain it somewhere github.com/perl6/doc/issues/1103
894292a6b9 | (JJ Merelo)++ | doc/Language/operators.pod6

To avoid mistakenly labeling it the "lazy list generator". Also some typographic changes here and there. Closes #1103
15:36
15:38 wamba left
Altreus I see this in the blog post about containers, but I don't understand how it stores the value. :STORE(-> $, Int() $!foo { $!foo }) 15:41
Is it because the second named parameter is the object's private member $!foo, so when it's called, it's put into it? 15:42
if so that seems a bit backhanded
geekosaur looks like it 15:43
mumble mumble clever, but probably an optimization rather than someone being clever just to be clever 15:44
timotimo yup, putting private attributes in your signature is common in submethods BUILD and TWEAK
AlexDaniel` m: my $a := (1, {$_+1} … ∞); say $a[999]; say $a[3]; say $a.WHAT
camelia 1000
4
(Seq)
Altreus if it's idiomatic then I guess it's a thing to learn 15:45
AlexDaniel` how does that even work?
Altreus If it's not then I guess the blog post might want to lampshade it :P
AlexDaniel` I don't get it… how can I get [4]th item from the Seq when I already pulled [1000]th?
Altreus Because if it didn't, people would complain 15:46
so it works
Either it computes it again or it remembers it I suppose
Pretty sure it forgets, so it doesn't keep huge sequences around for no reason 15:47
this implies it recomputes
15:47 Zoffix joined
AlexDaniel` but that's not how a Seq should work… 15:47
or am I wrong? What is a Seq even 15:48
Zoffix AlexDaniel`: AT-POS auto-caches the Seq
AlexDaniel` I thought it's just something that can keep giving you values
but this particular Seq managed to implement a time machine or something
6c: my $a := (1, {$_+1} … ∞); say $a[999]; say $a[3]; say $a.WHAT
committable6 AlexDaniel`, ¦6c (28 commits): «1000␤4␤(Seq)␤» 15:49
Herby__ o/
AlexDaniel` because, well, I can call .cache on it, and it will give me a List
a lazy one I suppose
Altreus Pretty sure I expected this behaviour from when I first learned about sequences
AlexDaniel` but then how is it different from that Seq over there
Zoffix AlexDaniel`: AT-POS auto-caches the Seq 15:50
AlexDaniel`: .Str, .Stringy, .fmt, .gist, .perl methods always .cache; .AT-POS and .EXISTS-POS methods, or in other words, Positional indexing like $seq[^10], always .cache; .elems, .Numeric, and .Int will .cache the Seq, unless the underlying Iterator provides a .count-only method; .Bool will .cache unless the underlying Iterator provides .bool-only or .count-only methods
AlexDaniel` no way
Altreus So 1000 cached 1001 items in the Seq?
hmm 15:51
Zoffix Yes
"but probably an optimization rather than someone being clever just to be clever"... Just less typing: -> $!foo { $!foo } vs -> $foo { $!foo = $foo } 15:52
Altreus The blog post says ".grep method returns a Seq object that doesn't keep already-iterated items around" but now I don't think I understand it 15:53
is that simply because iteration is not AT-POS
or any of the above
Zoffix Which blog post? 15:54
Altreus perl6advent.wordpress.com/2017/12/02/
on containers
Zoffix Altreus: right, iteration is not AT-POS. It involves Iterator object used behind the scenes and (in most cases) .pull-one being called on it to fetch the next value. And the pulled values aren't cached 15:55
synopsebot Link: doc.perl6.org/language/operators
Altreus A sense of understanding is forming
Zoffix Altreus: blogs on the topic: rakudo.party/post/Perl-6-Seqs-Drug...ock-n-Roll and this one goes into details of the Iterator methods: rakudo.party/post/Perl-6-Seqs-Drug...ll--Part-2
japhb m: my $a := (1, {$_+1} … ∞); say $a.skip(1000).head(1); say $a[3]; say $a.WHAT
camelia (1001)
The iterator of this Seq is already in use/consumed by another Seq
(you might solve this by adding .cache on usages of the Seq, or
by assigning the Seq into an array)
in block <unit> at <tmp> line 1
japhb But note that you can't try to have it both ways ^^ 15:56
Zoffix m: my $a := (1, {$_+1} … ∞); say $a.skip(1000).head(1); use nqp; nqp::bindattr($a, Seq, q|$!iter|, (1, {$_+1} … ∞).iterator); say $a[3]; say $a.WHAT # I can if I want to :P 15:57
camelia (1001)
4
(Seq)
15:58
Geth museum-items: 658d142698 | raiph++ (committed using GitHub Web editor) | 2012/MoarVM started.md
Create MoarVM started.md
japhb Zoffix: Oh now that's not fair, brain transplants don't count. :-) 16:00
16:03 scimon left
AlexDaniel` Zoffix: so forgive my ignorance, but what's a difference between a cached Seq and a lazy List? 16:03
I thought once thought once the Seq is cached it's no longer a Seq… 16:04
16:05 pharv joined
AlexDaniel` (oh whoops, poor connection here the message can be delayed…) 16:05
moritz the semantics of a cached Seq and a lazy list are pretty similar
Zoffix AlexDaniel`: (I'm assuming you mean on-demand generated and not the one that gives True for .is-lazy): not much other than the Seq is a Seq object and the List is a List object. When you .cache, you mixin a PositionalBindFailOver role that steals Seq's iterator and creates a List from that iterator. The List causes the caching behaviour and anything that tries to grab its original iterator gets that List's 16:06
iterator instead
16:07 skids joined
Zoffix AlexDaniel`: github.com/rakudo/rakudo/blob/mast...m6#L21-L36 16:07
The $!list is basically the "lazy List" you're talking about
s/that tries to grab its original iterator/that tries to grab Seq's original iterator/ 16:08
Here, it tries to give its original iterator but if it ain't there, it tries to see if there's cache and gives cache's iterator in that case github.com/rakudo/rakudo/blob/mast...m6#L18-L31 16:09
Otherwise you get the "already consumed" error
16:09 pharv left 16:10 pharv joined
Tison m: my @a = 1 … 9999999; say @a.is-lazy; 16:11
Zoffix
.oO( why is everyone trying to see if `1 … 9999999` is .is-lazy today? )
camelia (timeout)
Tison There is a ticket about it :-) 16:12
Zoffix Tison: which repo?
Tison And hey, it causes timeout.
16:12 athenot joined
Tison doc#1103 16:12
synopsebot DOC#1103 [open]: github.com/perl6/doc/issues/1103 [JJ TPF Grant][docs] 「my @a = 1 … 9999999」 is not lazy, explain it somewhere
Zoffix Well, it's not .is-lazy. And assignment to `@` is mostly-eager, so it tries to reify that whole Seq right away 16:13
This is the whole issue of .is-lazy meaning "assume it's infinite" rather than meaning "generated on-demand" 16:14
Tison Sure. what I pay attention to is that it causes time out.
m: my @a = 1..9999999; say @a.is-lazy; 16:15
Zoffix That's only because the bot has a short limit.
camelia False
Tison Err
But it hangs on with my env 16:16
Zoffix m: say 2.5*100/60 16:17
camelia 4.166667
Zoffix It'll take 4m to reify
jmerelo Zoffix: anyway, the initial ticket said that … created lazy lists. I have changed that now, the commit is linked from the issue. I would be grateful if anyone could take a look and either close the ticket in its present form or turn it into a ticket for a trap about eagerness/lazyness.
stmuk_ Zoffix: the "one windows dev" comment was more a hope that a technical windows dev (someone new) might get involved
jmerelo Tison: according to the roast tests, finite sequences are never lazy unles you lazify them. That causes a time out because it's actually and eagerly generated. 16:18
Tison As you can see above, `...` causes timeout while `..` does not, can we improve performance on this? 16:19
Herby__ tyil: you around?
16:20 zakharyas left
jmerelo .. is the range operator, … is the generator operator. Different semantics. … actually generates, one by one, every element by applying succ or pred, os it's a loop that has to run over the whole thing. Unless it's infinite, in which case it will be incredibly fast (and lazy) 16:20
16:20 pharv left, pharv joined
Zoffix jmerelo: that commit looks a bit wrong. At least from the perspective that Seq "a list" is NOT a list ( R#1344 ). So the … operator always produces Seqs that generate the values on-demand, they're all "lazy" in that meaning of the word. But only the */Inf Seqs are .is-lazy (which means "treat it as infinite"). And the assignment to `@` vars is "mostly-lazy", meaning that it fully-reifies the Seqs so despite 16:21
synopsebot R#1344 [open]: github.com/rakudo/rakudo/issues/1344 [@LARRY] What is a "list"?
Zoffix generating values on-demand, the assignment demands all those values right away, BUT it won't demand them if the Seq .is-lazy, because it must assume it's infinite and so would definitely hang.
Tison: yeah, likely. I'm planning to poke around the … op as I want to write the 3rd part of my Seqs Drugs and Rock-n-Roll article. 16:22
skids ... can only get so smart before it becomes an exercise in futility.
16:23 mcmillhj left
jmerelo Zoffix: OK 16:23
Zoffix Tison: it's just with `..`, especially with Ints, it knows it's an Int range and to produce the next value all it needs is to increment an integer. With `...` you can do a lot more, like arithmetic and geometric progressions and even steps produced by arbitrary code. So we'll need to detect these special cases and produce special iterators that don't go through the generic gather/take that can handle arbitrary 16:24
jmerelo Zoffix: that is why binding does keep the sequence lazy.
Zoffix code.
TBH, I think this over-use of word "lazy" is what's creating a bunch of confusion. 16:25
jmerelo Zoffix: like here github.com/perl6/doc/issues/1103#i...-270490609
Zoffix You can't bind a Seq to `@`, but yeah, if you bind it to `$`, it'll remain unreified.
Whereas assigning it to `@` will fully-reify it (unless it's .is-lazy)
Yeah, my \a = ... is like binding
Tison Ok, that's it :P 16:26
Thank you two ~
Zoffix And assigning to $ will also make it unreified, but that'll also cache it, so you'll have to decont it to reify it 16:28
s/reify/loop over/;
m: my $s := 1…4; .say for $s
camelia 1
2
3
4
Zoffix m: my $s = 1…4; .say for $s
camelia Potential difficulties:
Useless use of … in sink context
at <tmp>:1
------> 3my $s = 1…7⏏054; .say for $s
1
Zoffix m: my $s = (1…4); .say for $s
camelia (1 2 3 4)
Zoffix m: my $s = (1…4); .say for $s<>
camelia 1
2
3
4
Zoffix &
16:28 Zoffix left
Geth doc: 7b46298646 | (JJ Merelo)++ | doc/Language/operators.pod6
Another attempt at describing …. Refs #1103
16:29
synopsebot Link: doc.perl6.org/language/operators
jmerelo I've de-lazified the description, talking about "on demand" instead. 16:30
16:31 pharv left 16:32 pharv joined 16:33 Tison left 16:34 mcmillhj joined 16:36 pharv left
timotimo brian d foy has posted more questions on stackoverflow 16:36
El_Che hallo 16:37
16:37 pharv joined
jmerelo stackoverflow.com/questions/499429...d-boundary 16:38
16:41 pharv_ joined, pharv left, pharv_ left, pharv joined 16:43 domidumont left
timotimo we might have to implement <|foo> differently inside a lookbehind, because we flip the regex ast, but we'd have to change <|w> into <|W> i think? 16:45
16:46 pharv left
timotimo i mean, the implementation wouldn't be different, it would just have a case inside the ast flipper 16:46
m: say "!w" ~~ /<|w>./ 16:47
camelia 「w」
timotimo m: say "w!" ~~ /<|w>./
camelia 「w」
timotimo m: say "w!" ~~ m:g/<|w>./
camelia (「w」 「!」)
timotimo m: say "!w" ~~ m:g/<|w>./
camelia (「w」)
timotimo ok, that's what i wanted to know
m: say "!w" ~~ m:g/<|W>./
camelia (「!」 「w」)
timotimo at the moment it looks like flip_ast implements no special flippings at all 16:52
16:52 pilne joined
jmerelo m: say "foo bar" ~~ /<?after foo> » bar/; say "foo bar" ~~ /<?after foo »> bar/ 16:53
camelia Nil
Nil
jmerelo m: say "foo bar" ~~ /<?after foo> » \s+ bar/; say "foo bar" ~~ /<?after foo »> \s+ bar/
camelia 「 bar」
Nil
jmerelo Would that be a bug?
timotimo so what the after is matching is "rab oof" against "rab \s+ »> oof" 16:56
16:56 ChoHag left
timotimo the latter one 16:56
jmerelo m: say "foo bar" ~~ /<?after foo> <|w> \s+ bar/; say "foo bar" ~~ /<?after foo <|w> > \s+ bar/ 16:57
camelia 「 bar」
「 bar」
jmerelo timotimo: so it's about the semantics of "left word boundary" 16:58
m: say "foo bar" ~~ /<?after foo> » \s+ bar/; say "foo bar" ~~ /<?after foo «> \s+ bar/
camelia 「 bar」
「 bar」
jmerelo Right.
16:58 pharv joined
timotimo there's a few things we'd have to treat differently when flipping the ast 16:59
so that instead of trying to match "rab \s+ » oof" it would try to match "rab \s+ « oof"
same for <|w> <-> <|W>
17:00 pharv_ joined, pharv left
timotimo potentially other stuff 17:01
$ and ^ as well as $$ and ^^ i believe 17:02
jmerelo timotimo: got it answered, at least that one. Thanks for the help!
timotimo how come <|W> doesn't show up in the qast ... 17:05
jmerelo timotimo: so that's kind of a buglet. 17:10
timotimo: because the user doesn't need to know how some particular issue is implemented. 17:11
timotimo oh, ok, we don't have an implementation for anything except <|w> it looks like? 17:12
though the design doc says you can put any character class name in there, w, s, h, whatever i guess?
it looks like <|w> is just a call to .wb, so it should not need to be flipped because it's direction-agnostic? 17:17
17:18 domidumont joined, cognominal joined
timotimo right, it is 17:19
jmerelo: "this answer [...] gave the answer"? 17:22
jmerelo timotimo: right, too many answers. 17:25
17:25 AlexDaniel joined 17:40 john___ joined
timotimo does "make test" with an nqp that flips « and » around inside <?after> 17:40
jmerelo timotimo++ 17:41
timotimo also ^^/$$, ^/$ now
rindolf hi all! how can i add and subtract two objects field-wise similar to github.com/shlomif/project-euler/c...5c40fe8R49 ?
jmerelo rindolf: hi! short answer: by asking the same in StackOverflow 17:42
(we _do_ want to have perl6 questions in stack overflow)
rindolf: long answer. Let me check, but off the top of my head, maybe use a semilist.
rindolf: what do you want to do exactly? That will work pretty much in the same way if you translate that to Perl 6 syntax. You can also use the X operator to do a vector operation as you do with cur, but it's pretty much the same. 17:44
MasterDuke rindolf: are you subtracting two instances of the same class? or instances of two different classes that just happen to have the same fields/attributes? 17:47
17:51 st_elmo left
rindolf MasterDuke: the former 17:59
17:59 pharv_ left 18:00 lizmat_ joined, lizmat left
Geth doc: ba04429f7d | (JJ Merelo)++ | doc/Language/glossary.pod6
Minor grammar and typographic corrections in reify
18:01
synopsebot Link: doc.perl6.org/language/glossary
18:02 Zoffix joined
Zoffix rindolf: I'd say an equivalent to that construct would be a custom operator 18:03
m: class O { has $.foo; has $.bar }; multi infix:<-> (O $_, O \o) { .clone :foo(.foo - o.foo) :bar(.bar - o.bar) }; say O.new(:42foo :70bar) - O.new(:10foo :40bar)
camelia O.new(foo => 32, bar => 30)
18:04 pharv joined, lizmat_ left 18:05 pharv left, pharv joined
Zoffix m: class O { has $.foo; has $.bar }; multi infix:<+> (O $_, O \o) { .clone :foo(.foo + o.foo) :bar(.bar + o.bar) }; say O.new(:42foo :70bar) + O.new: :10foo :40bar # same with + 18:05
camelia O.new(foo => 52, bar => 110)
18:05 pharv left, pharv joined
Zoffix m: class O { has $.foo; has $.bar }; multi infix:<+> (O \a, O \o) { a.clone: |a.Capture.keys.map({$_ => a."$_"() + o."$_"()}).Hash }; say O.new(:42foo :70bar) + O.new: :10foo :40bar 18:07
camelia O.new(foo => 52, bar => 110)
Zoffix ^ without encoding attribute values into the op (there's prolly a shorter way to write that)
18:07 mscha left
timotimo or use hashes and just hyperop that 18:10
Zoffix Oh, it's hyper... I remembered there was that, but was trying with Z+ :P
m: class O { has $.foo; has $.bar }; multi infix:<+> (O \a, O \o) { a.clone: |(a.Capture.hash «+» o.Capture.Hash) }; say O.new(:42foo :70bar) + O.new: :10foo :40bar 18:11
camelia O.new(foo => 52, bar => 110)
Zoffix timotimo++
18:12 cpage joined
Zoffix m: class O { has $.foo; has $.bar }; multi infix:<+> (O \a, O \o) { a.clone: |(.[0] «+» .[1] with (a, o)».Capture».hash) }; say O.new(:42foo :70bar) + O.new: :10foo :40bar 18:12
camelia O.new(foo => 52, bar => 110)
Zoffix m: class O { has $.foo; has $.bar }; multi infix:<+> (O \a, O \o) { a.clone: |([«+»] (a, o)».Capture».hash) }; say O.new(:42foo :70bar) + O.new: :10foo :40bar 18:13
camelia O.new(foo => 52, bar => 110)
Zoffix TIL you can reduce with a hypered op :o
rindolf Zoffix: timotimo : thanks 18:14
18:16 pharv left
Zoffix We need some nice way to make custom candites globally available 18:17
18:17 simpleseeker joined
Zoffix m: { class O { has $.foo; has $.bar }; multi infix:<+> (O \a, O \o) { a.clone: |([«+»] (a, o)».Capture».hash) }; }; say O.new(:42foo :70bar) + O.new: :10foo :40bar } 18:17
camelia 5===SORRY!5=== Error while compiling <tmp>
Unexpected closing bracket
at <tmp>:1
------> 3w(:42foo :70bar) + O.new: :10foo :40bar 7⏏5}
Zoffix m: { class O { has $.foo; has $.bar }; multi infix:<+> (O \a, O \o) { a.clone: |([«+»] (a, o)».Capture».hash) }; }; say O.new(:42foo :70bar) + O.new: :10foo :40bar 18:18
camelia Cannot resolve caller Numeric(O: ); none of these signatures match:
(Mu:U \v: *%_)
in block <unit> at <tmp> line 1
Zoffix 'cause you can pass objects past the class export zone and if you try to use the op, you get explosions
or maybe steal that system from Ruby :P 18:19
I mean Python
(the system where defining methods on objects does things)
too late prolly
18:19 pharv joined
Zoffix m: { class O { has $.foo; has $.bar }; CORE::<&infix:<+>>.add_dispatchee: multi infix:<+> (O \a, O \o) { a.clone: |([«+»] (a, o)».Capture».hash) }; }; say O.new(:42foo :70bar) + O.new: :10foo :40bar 18:21
camelia O.new(foo => 52, bar => 110)
Zoffix :P
.ask jnthn is this a sane thing to do? Making custom ops work globally: `CORE::<&infix:<+>>.add_dispatchee: multi infix:<+> (O \a, O \o) { … }` .add_dispatchee ain't in the spec, wondering if it can be added? 18:23
yoleaux Zoffix: I'll pass your message to jnthn.
18:23 eliasr joined 18:26 sauvin left 18:30 mcmillhj left, espadrine_ joined 18:31 mcmillhj joined, maettu joined 18:33 robertle_ joined 18:40 ChoHag joined
xq what text editor is recommended for writing perl6 ? 18:46
(on linux)
jmerelo xq: I like emacs, and have generally no problem with it. But probably highlighting works better on Atom 18:47
18:47 jmerelo left 18:48 domidumont left
stmuk_ xq: everyone is just likely to recommend the editor they use 18:49
Herby__ vim vim vim!
stmuk_ xq: just use whatever editor you like yourself
El_Che atom, vim and emacs seem to have support for Perl 6 18:50
Herby__ i think vscode does as well
i could be imaginging that 18:51
Zoffix huggable: atom ide 18:52
huggable Zoffix, github.com/perl6/Atom-as-a-Perl6-IDE
Zoffix xq: ^ that's one option. I use Atom (without the IDE) bit and highlights mostly are OK, but I'm not a fan of that editor (Sublime4Life)
18:53 phdphil joined
phdphil Hi all, quick q on something that has bugged me writing in p6: Is there an easier way to map over a list using the current and previous value? 18:53
xq sounds like a reduce 18:54
stmuk_ shouldn't someone mention...
commaide.com/
:)
phdphil e.g. suppose I want to output for each value whether it was higher or lower than the previous value
Zoffix phdphil: "an easier"... easier than what? 18:55
stmuk_++ # oh right!
phdphil @Zoffix: easier than, say, zipping the list with itself offset by 1
Zoffix m: <a b c>.rotor(2 => -1, :partial).flat.map: -> $prev, $cur? { dd [$prev, $cur] } 18:57
camelia ["a", "b"]
["b", "c"]
["c", Mu]
Zoffix hm, this is more of "current and next"
phdphil You can do a very similar thing with generators via whatever stars: 0,1,*+*...* will do a Fibonacci sequence
And it's so easy there
Zoffix phdphil: so above it'd be [Mu, "a"], ["a", "b"], ["b", "c"], right? 18:58
phdphil Well, in python's itertools, pairwise will do ["a","b"], ["b","c"], ["c","d"]... 18:59
which would be about right
Zoffix m: <a b c d>.rotor(2 => -1).flat.map: -> $prev, $cur { dd [$prev, $cur] }
camelia ["a", "b"]
["b", "c"]
["c", "d"]
Zoffix m: <a b c d>.rotor(2 => -1).map: -> ($prev, $cur) { dd [$prev, $cur] }
camelia ["a", "b"]
["b", "c"]
["c", "d"]
john___ hey I'm trying to interact with the Github API using Perl 6 and just... can't. I've tried using HTTP::UserAgent, WWW, and LibCurl. No luck 19:00
Zoffix Blog post on rotor: rakudo.party/post/Perl-6-.rotor-Th...nipulation
john___ I posted about it here if more appropriate: stackoverflow.com/questions/499479...sing-perl6
phdphil Ah, ok, looks like I need to learn rotor
I assumed it was for more circular things
Zoffix john___: hm, that looks vaguelly familiar... 19:01
Zoffix rakes the toolbox for a github script
Herby__ john___: does it matter that you're trying to grab their front page, and not their api access point?
sorry, their api url
Zoffix Geth: source 19:02
Geth Zoffix, Source at github.com/perl6/geth To add repo, add an 'application/json' webhook on GitHub pointing it to hack.p6c.org:8888/?chan=#perl6 and choose 'Send me everything' for events to send | use `ver URL to commit` to fetch version bump changes
timotimo .tell jjmerelo punt is a legit verb btw
yoleaux timotimo: I'll pass your message to jjmerelo.
Zoffix john___: how did you set useragent for HTTP::UserAgent? Looks like that's the whole thing to the trick: github.com/perl6/geth/blob/master/...sor.pm6#L7 19:03
john___: I vaguelly remember that getting that error means you didn't get your API request correct.
john___: what's the program that doesn't work? 19:04
Geth: ver github.com/rakudo/rakudo/commit/b0...1cbdd016ab
Geth Zoffix, version bump brought in these changes: github.com/perl6/nqp/compare/2018....gc84f2fa20
19:04 darutoko left
Zoffix ^ that was using the API so seems to work with HTTP::UserAgent 19:04
19:05 phdphil left
Zoffix huggable: atom ide :is: github.com/perl6/Atom-as-a-Perl6-IDE also see Perl-6-tailored CommaIDE: commaide.com/ 19:05
huggable Zoffix, Added atom ide as github.com/perl6/Atom-as-a-Perl6-IDE also see Perl-6-tailored CommaIDE: commaide.com/
Zoffix eco: WebService::GitHub 19:06
buggable Zoffix, WebService::GitHub 'GitHub API': modules.perl6.org/dist/WebService::...ub:fayland
Zoffix john___: ^ there also looks to be a speshul module for GitHub API
timotimo yo Zoffix, have you ever played with GraphQL?
Zoffix GraphQL? Never heard of her. 19:07
timotimo ah, OK
because maybe we can get a much better deal on api rate limits for the ecosystem updater if we go via their graphql api
i'm not sure if what we need is exposed via that, and i'm not sure how to figure that out
19:08 pharv left, pharv joined
MasterDuke .tell phdphil you could also look at the last section of docs.perl6.org/language/operators#...Operators. e.g., `say [\<] 1,2,3,0` almost does what you want 19:09
yoleaux MasterDuke: I'll pass your message to phdphil.
Zoffix IIRC ATM we don't limit anything and just have a fallback mechanism to wait for more allowance if we ever hit the limit (which I think we don't hit ATM). 19:10
19:12 pharv left
Zoffix john___: what's the program that shows that error you pasted? 19:13
john___ Zoffix: I was using the example from UserAgent. I've amended the SO post to include it verbatim. I also commented there in response you 19:15
Thanks for the help btw
At first I tried an endpoint, viz., api.github.com/user/:username/events
Zoffix looks
john___ *users
Zoffix I think for that one you need to log in with the token, no?
john___ don't think so, it's public info 19:16
And curl -i "$url" on bash has no issues with it
Zoffix ah, k, lemme try it
john___: does this work for you: use WWW; dd jget "api.github.com/repos/rakudo/rakudo...s/f6756bb" 19:17
api.github.com/user/zoffixznet/events gives me 404 in the browser... 19:18
oh, it's userS 19:19
john___ user --> users
Sorry for the typo
Yeah haha
Zoffix john___: this works for me. Does it work for you? use WWW; dd jget "api.github.com/users/zoffixznet/events";
If not, what's your perl6 version and version of WWW module (zef info WWW) 19:20
(module version will be in `- Identity: WWW:ver<1.005003>`)
john___ One sec 19:21
It did not:
Failure.new(exception => HTTP::UserAgent::Exception::X::HTTP::Internal.new(rc => 500, reason => "server returned no data"), backtrace => Backtrace.new)
perl6 -v 19:22
This is Rakudo Star version 2018.01 built on MoarVM version 2018.01
implementing Perl 6.c.
zef info WWW
- Info for: WWW
- Identity: WWW:ver<1.005003>
Zoffix That HTTP::UserAgent example works too; it's just not an API endpoint (so it dumps a bunch of HTML)
hm...
john___: what OS are you on?
john___ I guess it's me then
OS X Sierra
10.12.6
Zoffix I'm on Linux... 19:23
john___ Do you think I'd have more lukc in a Linux VM?
Zoffix You could try. I'm trying to remember what was the cause when I had the "server returned no data" error :/
Kaiepi i can test on openbsd and freebsd 19:24
gimme a sec
19:25 comborico1611 joined 19:26 zakharyas joined
Kaiepi works on openbsd: pastebin.com/JH9ET2b1 19:26
john___ I'm installing perl6 on debian. I'll let you know what happens 19:27
Kaiepi i need to set up some vms for dflybsd, netbsd, illumos
and debian
john___ I remember some of the underlying C libraries for gumbo not really working before, so it's possible there's an issue there
Kaiepi also works on freebsd 19:28
Zoffix [Coke]: are you around? If you have WWW module installed, does this work for you? use WWW; dd jget "api.github.com/users/zoffixznet/events"; 19:29
[Coke]: on macOS
Kaiepi it's too bad i can't run a windows vm with vmm
what's done so far with it is great though 19:30
i can run a vm on boot and ssh into it having my dhcp server set up to give it a static ip
i need to upgrade my ram though, 8GB just isn't enough 19:32
but anyway 19:33
p6: await Promise.new
camelia (timeout) 19:34
Kaiepi p6: await Promise.new.then({ .result })
19:34 zakharyas left
camelia (timeout) 19:34
Zoffix m: my $p := Promise.new; my $p2 := start { await $p; say "meows" }; $p.vow.keep: 42; await $p2 19:35
19:35 zakharyas joined
camelia meows 19:35
Zoffix You need to keep or break the vow or it'll sit there forever
Kaiepi ik
i was wondering if throwing in cases like that might make it easier to debug
Zoffix Man, the downside of everyone hosting their stuff on github is when you have issues with github they're almost ungoogleable, as you keep getting Issue reports for projects hosted on github :P 19:44
john___ haha yes I have been on quite a journey with this
I know what you mean
19:44 zakharyas left
john___ ok I got it to work on Debian. There must be a problem with my OS X install... 19:45
Zoffix john___: it could also be an OSX bug in WWW or HTTP::UserAgent or IO::Socket::SSL/OpenSSL or rakudo itself 19:46
I know [Coke] lizmat and stmuk_ have acces to an OSX box. One of them could very whether perl6 -e 'use WWW; dd jget "api.github.com/users/zoffixznet/events";' dumps JSON data or just dumps a Failure 19:47
well, scratch WWW from that list. I doubt there's anything in it.
john___ makes sense
I've updated the SO post with what we know so far but it would be great if someone could follow up as to whether this is related to OS X 19:48
I have to step out for a while
19:49 Zoffix left 19:50 pharv joined 19:52 john___ left
[Coke] zoffix; yup, works, but slow as butts 19:58
(in that it completes and generates a ton of output)
comborico1611 Wondering why this puts things in parenthesis. What is this data structure called? A list? 20:15
sub test($value) { (say $value) xx 3}
err sub test($value) {say $value xx 3}
20:21 HaraldJoerg left 20:24 vcv left
geekosaur you might want to use the perl method to get something more recognizeable 20:25
I find the way .gist handles List/Seq to be confusing
20:35 pharv left 20:37 pharv joined
El_Che for who is interested in Perl 6 doc testing: github.com/perl6/doc/issues/1946 20:41
20:42 rindolf left
Kaiepi something confuses me a bit about role 20:43
it doesn't act like an interface, like i was expecting
is there a term for what it does?
geekosaur it's a mixin, not an interface 20:45
20:45 lizmat joined
Kaiepi ohh 20:45
[Coke] docs.perl6.org/syntax/role might be help
Kaiepi i've read it before, just didn't understand it still 20:47
i've seen them described as being traits
El_Che If you come from java, see it as a combination of an abstract class and an interface :) 20:48
Kaiepi i come from nodejs, go, and recently c
tinkered with cpp and haskell for a little while 20:49
20:49 mcmillhj left
El_Che See it as an Go "inversed" interface 20:49
20:49 mcmillhj joined
El_Che a role does not follows and interface, but provide the methods 20:49
so an modular implementation of part of that interface 20:50
Geth ecosystem: 27b6476ef1 | 陈梓立++ (committed using GitHub Web editor) | META.list
Satisfy update of @retupmoca's module JSON::JWT

Which suddenly causes Zef cannot resolve it.
20:51
El_Che type foo interface { bar(), baz() string}
you could have a "drinking role" that implements bar() for you
and a bazar that implements baz() 20:52
Kaiepi ahh 20:53
what confuses me a bit is how roles handle attributes
is there a way to initialize them with something like class Foo does Bar { }? 20:54
20:54 mj41 joined, mcmillhj left
Kaiepi or is that something class would be more suitable for 20:54
El_Che Kaiepi: Roles are just runnable code 20:55
I would initialiaze stuff in the instance
timotimo gist.github.com/jnthn/25349dee44f2...dbe504c39e - Kaiepi this is perhaps exactly what you want 20:56
20:57 pharv left 20:58 robertle_ left
Kaiepi OH 20:58
Geth ecosystem: 4cf0def8db | (Andrew Egeler)++ | META.list
Update META->META6 for other @retupmoca modules
Kaiepi that's actually a godsend for a deadlock (i think) in promises in certain cases 20:59
Geth ecosystem: 45aae93c45 | 陈梓立++ (committed using GitHub Web editor) | META.list
Remove deprecated module
21:00
Kaiepi how would i use it though? 21:01
timotimo literally just "use" it
or copy-paste it into your own code
Kaiepi oh lol 21:02
21:02 pharv joined 21:03 Tison joined 21:04 skids left, Tison left
Kaiepi btw is using bsd-3-clause as a license frowned upon in perl? 21:04
no i'm not trying to start a license war 21:05
moritz nope, it's fine
(IMHO)
Kaiepi sweet
moritz (IANAL)
Kaiepi i should probably get more input since i'm terrible at law 21:06
21:06 mcmillhj joined 21:09 vike left 21:10 vike joined 21:11 mcmillhj left, mj41 left 21:17 mcmillhj joined 21:19 irco joined 21:21 sherwool joined, mcmillhj left 21:28 mcmillhj joined 21:33 mcmillhj left 21:39 lichtkind joined 21:44 mcmillhj joined 21:46 simpleseeker left 21:48 Rawriful joined, mcmillhj left 21:57 aindilis left, simpleseeker joined, aindilis joined 22:03 mcmillhj joined 22:06 lichtkind left 22:08 mcmillhj left
comborico1611 I'm wondering if xx operator can replace loops in most cases. 22:14
timotimo it can in many cases
comborico1611 That is a huge improvement.
timotimo hey, was that stackoverflow questions yours? about rakudo star installing slowly?
comborico1611 Yes.
timotimo can you give a bit more detail?
comborico1611 I think the person before you is correct.
timotimo any part in particular that takes long? like, does it run the test suites of nqp and rakudo, and the spec test suite?
comborico1611 "make test" was extremely long. 22:15
timotimo shouldn't be, though. is this a windows system per chance?
comborico1611 So I didn't do it for this recent installation.
No.
timotimo ok, so that's not it
it doesn't run out of ram and swap a bunch?
comborico1611 Fast-ish dell laptop
I'm not sure. 22:16
timotimo how much ram does it have in total? i'd imagine more than 4 gigs?
comborico1611 The first time I installed it on a 2007 Macbook pro, it was slow there also.
Probably 2 - 4 gigs.
timotimo 2 would be somewhat tight
comborico1611 I really don't know. 22:17
I'll try to remember to check when I'm on that computer Sunday morning.
timotimo thanks!
comborico1611 You bet!
timotimo 4 should be all right, but 2 will only work well if you close other memory-hungry apps like maybe browsers or mail clients 22:18
comborico1611 I had everything closed as the computer was very sluggish.
22:19 athenot left
timotimo "very sluggish" sounds a lot like ram maxing out, then swap file being used 22:19
22:19 mcmillhj joined
comborico1611 But I didn't realize that some thigns were "built from scratch" while others were "finished builds" -- whatever that means. 22:19
timotimo: I see.
timotimo if you grab the source code of rakudo, it'll compile everything from scratch 22:20
comborico1611 How is that different from a finished-build?
timotimo there's packages for several linux distros that you can use instead, that'll be lightning fast
huggable: packages
huggable timotimo, CentOS, Debian, Fedora and Ubuntu Rakudo packages: github.com/nxadm/rakudo-pkg/releases
timotimo a finished build is barely more than copying files out of a zip or tar archive
comborico1611 This should be an option at rakudo.org
timotimo it is, "alternative options" below the three main ones 22:21
comborico1611 Hmm. Strange that everythign isn't a finished build. I suppose this is for people to inspect the code or something?
22:21 zachk joined, zachk left, zachk joined
comborico1611 timotimo: I see. 22:21
Would the packages have added the folders to PATH automatically? 22:22
timotimo maybe, i assume that depends on the distribution in question?
comborico1611 is the PATH = $path, is the $path perl?
timotimo you mean is that perl code?
comborico1611 Yes.
timotimo no, that would go in your shell's configuration/startup file/script 22:23
so it'd be bash code, for example
comborico1611 Bummer.
22:23 mcmillhj left
timotimo a program cannot modify the environment variables of a calling program, i.e. you can't call something to set up variables in your current shell or all shells, you can only run shell code in the shell in question, or have the program execute a new shell for you 22:24
22:24 mryan joined
comborico1611 Difficult for me to understand what you are saying. But it is okay. 22:25
timotimo it's a bit hairy, yeah 22:26
22:26 mryan left
comborico1611 My brain is no longer fresh for the day, as well. 22:26
timotimo the PATH variable is there so you don't always have to type the full path to every program you want to run, and this is a feature of your shell, and many things that either use the shell to launch other programs, or programs that just use the PATH variable to find stuff to launch - like the program "which" 22:27
comborico1611 Yes. That much I know :) But I just learned that a few months ago. The first time I installed Rakudo, in fact.
timotimo when a program is launched by another program (for example a perl6 script being launched by the shell) the calling program will pass a full copy of its own set of environment variables 22:28
ah, OK
comborico1611 It was like a two day mess trying to get it into PATH.
timotimo huh, i think i might remember that
comborico1611 Haha
22:28 mryan joined, mryan left
comborico1611 Some website somewhere finally made things clear enough. You guys tried, but it wasn't taking. 22:29
22:29 lizmat left
comborico1611 This second go around, I got it on my first attempt. Whew. Somewhat lucky there. 22:29
timotimo as i said, this is a hairy topic that tends to trip lots of people up
fwiw, it's a bit simpler to get something added to the PATH on windows than it is on your typical linux :P 22:30
comborico1611 That is surprising.
I'm sure you heard Microsoft is releasing some OS on Linux.
timotimo not sure
comborico1611 Let me look that up. 22:31
22:31 mryan joined
geekosaur every so often, I wish unixes had picked up #e from plan9. but it'd change APIs 22:32
timotimo damn, plan9
geekosaur and, to be honest, the two behaviors are somewhat orthogonal 22:33
comborico1611 www.thurrott.com/internet-of-thing...ot-windows
geekosaur everything old is new again
timotimo not really that surprising 22:34
their other option would have been to propose DOS for IoT devices
people would scoff at that, no matter how sensible it would be
comborico1611 I was thinking it was for people on IoT 22:35
geekosaur remembers old MSDOS 2 dev documentation that outlined a DOS migration path to Xenix
comborico1611 not* IoT
22:37 BenGoldberg joined 22:38 skids joined, sherwool left 22:39 mryan left 22:44 pharv left
El_Che comborico1611: I decided against automatically add /opt/rakudo-pkg/bin to the path (and site/bin) in order not to mess with the rakudo versions installed by the OS. Everything is self contained, no interference with a OS rakudo. 22:48
comborico1611: I may supply a script to set the PATH for a user, though
(if many people struggle with PATH. I asumed it was one of the first things you pick up in unix) 22:49
22:52 stux|RC-- joined, mcmillhj joined 22:53 stux|RC left
geekosaur a remarkable number of people pick up linux without learning the basics 22:54
El_Che it may be a good thing 22:55
22:56 mcmillhj left 22:57 pharv joined
comborico1611 geekosaur: Yes, thanks to Ubuntu! 22:58
geekosaur not just ubuntu
comborico1611 I remember back in... 2000, I tried to install Red Hat. Couldn't get it. But I was only a preteen.
geekosaur I've even run into this with Arch users, and Arch isn't exactly desktop Linux
comborico1611 awk 22:59
23:02 pharv left 23:05 Kaiepi left 23:06 Kaiepi joined
timotimo i wasn't on linux yet in 2000 i think, but i was on linux 2004, i even went to a linux convention 23:11
23:11 mcmillhj joined 23:12 Sgeo__ joined, mryan joined
Kaiepi i'm writing a bogobogosort module 23:13
highly optimized sorting
geekosaur (kids :p ) 23:14
23:14 Sgeo_ left 23:16 mcmillhj left
xq does perl6 continue to use POD as the documentation writing system ? 23:20
23:26 simpleseeker left 23:27 wamba joined
geekosaur pod6, which is somewhat different from perl5's POD 23:29
23:37 markong left, simpleseeker joined 23:52 simpleseeker left 23:56 simpleseeker joined