»ö« 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.
buggable 🎺🎺🎺 It's time for the monthly Accidental /win Lottery 😍😍😍 We have 1 ballots submitted by 1 users! DRUM ROLL PLEASE!... 00:00
And the winning number is 23! Congratulations to jnthn! You win a can of WD40!
tony-o woop woop
00:01 mcmillhj left, mcmillhj joined
tony-o .tell zoffix - modules.zef.pm is repopulating now and should be up tomorrow 00:02
yoleaux tony-o: I'll pass your message to zoffix.
00:03 pilne joined 00:06 mcmillhj left 00:08 vendethiel joined 00:10 aindilis` joined 00:12 aindilis left 00:15 hythm left 00:16 mcmillhj joined 00:18 vendethiel- joined 00:19 vendethiel left 00:20 lookatme joined
lookatme morning 00:21
00:21 mcmillhj left 00:25 hythm joined 00:29 kerframil left 00:32 vendethiel- left
zengargoyle all hail jnthn slayer of ... things. 00:33
00:36 aindilis` left
lookatme Hmm, anyone know the last week report link? 00:37
geekosaur [31 21:22:26] <lizmat> and another Perl 6 Weekly hits the Net: p6weekly.wordpress.com/2017/07/31/...r-smaller/ 00:39
lookatme geekosaur, yeah, that's it, thanks 00:40
00:45 Cabanossi left, Cabanossi joined 00:51 mcmillhj joined 00:52 aindilis joined 00:55 mcmillhj left
zengargoyle lizmat++ has is default 01:12
01:16 jeromelanteri left 01:22 mcmillhj joined 01:25 ChoHag left 01:27 mcmillhj left 01:30 jeromelanteri joined 01:34 astj left, astj joined 01:39 astj left
jeromelanteri zengargoyle, ok, well read, thank you 01:40
yoleaux 31 Jul 2017 22:43Z <zengargoyle> jeromelanteri: nicqrocks applied the pull-requests and Git::Wraper:ver<0.0.8> fixes the precomp thing. you don't *have* to use your own patched copy anymore.
31 Jul 2017 22:44Z <zengargoyle> jeromelanteri: and perlpilot confirms that the nicqrocks fork that's in the ecosystem is the one that should be used.
01:42 https_GK1wmSU joined 01:44 https_GK1wmSU left 01:45 ilbot3 left 01:51 ilbot3 joined, ChanServ sets mode: +v ilbot3 01:53 astj joined 01:54 mcmillhj joined 01:57 astj left 01:59 mcmillhj left 02:02 lichtkind left 02:11 astj joined 02:14 pilne left 02:16 eliasr left 02:18 cpage_ left 02:21 cpage_ joined 02:26 skids joined 02:29 vendethiel joined 02:33 mcmillhj joined 02:38 mcmillhj left 02:41 MasterDuke joined 02:44 cpage_ left 02:47 audiatorix joined
audiatorix What's the best way to continually listen to a Channel until it's closed? I'd like to avoid using exceptions if possible 02:48
02:52 noganex_ joined 02:55 noganex left 02:59 Cabanossi left 03:01 Cabanossi joined
lookatme audiatorix, get a Supply on Channel ? 03:03
m: my Channel $ch .= new; my $p = start { supply { whenever $ch.Supply -> $msg { print "GOT $msg|"; }; }.tap }; ^10 .map({$ch.send($_)}); await $p; 03:04
camelia GOT 0|GOT 1|GOT 2|GOT 3|GOT 4|GOT 5|GOT 6|GOT 7|GOT 8|GOT 9|
lookatme m: my Channel $ch .= new; $ch.Supply.tap( { say $_; } ); ^10 .map({$ch.send($_)}); $ch.close() 03:05
camelia 0
1
lookatme m: my Channel $ch .= new; $ch.Supply.tap( { say $_; } ); ^10 .map({$ch.send($_)}); $ch.close(); sleep 1;
camelia 0
1
2
3
4
5
6
7
8
9
lookatme Last one need sleep.
audiatorix ah okay that works 03:07
thanks
lookatme audiatorix, or use poll, non-blocking receive method 03:08
There is a example about poll: docs.perl6.org/type/Channel#method_poll
^^ audiatorix
s/a/an/
audiatorix Hmm, looks like I might be able to just use a Supply in the first place 03:09
Basically the structure I want is messages coming in from an arbitrary number of sockets and all being processed in the same place, regardless of source 03:10
But the processing needs to be decoupled from the receiving/sending
So it seems like Channel is appropriate 03:11
but maybe Supply works?
Am I right in saying that the two are the same other than the way they spit out values? 03:13
[Coke] ff 03:15
lookatme audiatorix, yeah, I think both works, you maybe need some flag mark the message and return value 03:24
03:27 Cabanossi left 03:29 Cabanossi joined 03:34 zakame left 03:36 vendethiel left, zakame joined
Geth doc: fdcab66da7 | (Will "Coke" Coleda)++ | 2 files
test Perl 6 code in python page

Part of #1387
03:38
doc: a51de99156 | (Will "Coke" Coleda)++ | 2 files
test the code in phasers doc.

Part of #1387
03:49
04:04 raschipi joined
Geth doc: 78b789ceb4 | (Will "Coke" Coleda)++ | 2 files
Run the few p6 tests we can on modules.pod6

Part of #1387
04:13
doc: d357d88ecc | (Will "Coke" Coleda)++ | doc/Language/rb-nutshell.pod6
... exports are cumulative in the test suite.

This is a bug, but skip this for now.
Part of #1387
04:16 zakame left 04:23 zakame joined
ryu0 I'm considering learning Perl6. The books I thought looked interesting aren't released yet. Any suggestions for where I should start? 04:37
raschipi Which is your level of understanding? Noob? Already know a language? 04:38
ryu0 raschipi: I guess, already know. But it's mostly procedural that I have experience with.
04:39 feng joined
raschipi What do you know? There are texts targeted at people comming from specific languages... 04:39
ryu0 In order of familiarity? C, Shell, AWK, C++, ... 04:40
Though i also did a fair amount of reading on functional, namely the languages Common Lisp and SML.
No prior perl experience. 04:41
I did some dabbling with Tcl and Python though...
raschipi Perl is a mashup of C, shell, AWK and C++, mostly. So it won't be a strange language. 04:42
Can you run a program already? Hello world is just:
ryu0 Lisp is the strangest language I ever tried to use.
raschipi m: say "Hello World!"
camelia Hello World!
ryu0 Huh. Reminds me of REXX. 04:43
raschipi Do you have rakudo installed?
ryu0 raschipi: no, but I can probably get something installed.
raschipi Start here, then: perl6intro.com/ 04:44
ryu0 i have a background with Linux packaging.
mostly how I became so familiar with shell scripts. haha
hm.
raschipi You can ask anything here, and /msg camelia and she will run snippets for you. 04:45
ryu0 raschipi: this looks good, but is there anything i can reference later to learn every facet of Perl6? I did that with C way back when...
not including mastery of the standard library though.
just the language if anything.
raschipi The reference is here: docs.perl6.org/
ryu0 Ok. Thank you. 04:46
raschipi It's not complete, devs are still working on it.
The type reference is almost more important than the language reference. 04:47
ryu0 Does the static typing also apply to user defined types?
The samples I saw only showed it with what looked like builtin/primitive types.
raschipi Yep, there's no difference between built in and user-defined types in Perl6 04:48
ryu0 Well, that's good. I've seen that limit language extensibility before.
Go, for example, makes it very difficult to make real data structures due to no generics. The closest thing is the builtin collections. 04:49
raschipi Well, Perl6 is written in Perl6. If you go look at the definitions of the "built-in" types, they are just types.
04:51 skids left, zakame left
raschipi Look at the Int definition in Rakudo: github.com/rakudo/rakudo/blob/nom/...ore/Int.pm 04:52
ryu0 m: 2.WHAT;
camelia ( no output )
ryu0 m: say 2.WHAT;
camelia (Int)
raschipi Except for the nqp, it's just a normal calss. Same for Arrays, Hashes, etc. 04:53
ryu0 Lisp style return values?
raschipi What do you mean? Sorry, I'm not familiar with Lisp. 04:54
ryu0 Where the last expression determines the return value of a function.
raschipi Yes, important for lambdas 04:55
Or can be done explicitly
ryu0 I saw that first attributed to Lisp, but maybe someone else was first.
04:57 zakame joined
raschipi That comes from RPN, or any other stack based processing 04:59
There's nowhere to put values, so they are pushed into the stack. The caller can then pop it. 05:00
Makes sense? 05:04
ryu0: Reuired reding from the docs: docs.perl6.org/type/Signature docs.perl6.org/type/Capture 05:06
lookatme :)
raschipi s/Reuired/Required/
lookatme perl6.org/resources/ Also, there are some learn resources 05:10
05:13 BenGoldberg left 05:15 feng left 05:17 https___GK1wmSU joined, https__GK1wmSU joined 05:20 https___GK1wmSU left, https__GK1wmSU left 05:21 xtreak joined 05:27 Cabanossi left 05:29 Cabanossi joined
b2gills m: my %distribution = a=> 0.3, b=> 0.4, c=>0.1, d=>0.2; say %distribution.Mix.roll 05:33
camelia Type check failed in binding; expected Int but got Rat (0.2)
in block <unit> at <tmp> line 1
b2gills I'm fairly sure Mix.roll used to work 05:34
raschipi committable6: help 05:35
committable6 raschipi, Like this: committable6: f583f22,HEAD say ‘hello’; say ‘world’ # See wiki for more examples: github.com/perl6/whateverable/wiki/Committable
raschipi committable6: f583f22,HEAD my %distribution = a=> 0.3, b=> 0.4, c=>0.1, d=>0.2; say %distribution.Mix.roll 05:36
committable6 raschipi, ¦f583f22: «d» ¦HEAD(7fdbb49): «Type check failed in binding; expected Int but got Rat (0.2)␤ in block <unit> at /tmp/tepLfrVLcc line 1␤ «exit code = 1»» 05:37
05:38 avalenn joined
raschipi committable6: releases my %distribution = a=> 0.3, b=> 0.4, c=>0.1, d=>0.2; say %distribution.Mix.roll 05:38
committable6 raschipi, gist.github.com/713f2398cc18871a02...01f931a412
raschipi b2gills: Yep, used to work 05:39
Geth ecosystem: YellowApple++ created pull request #355:
Add GLFW to ecosystem
05:47
05:50 wamba joined 05:52 khw left 06:09 avalenn left 06:11 avalokite joined 06:12 avalenn joined 06:18 lowbro joined, lowbro left, lowbro joined 06:23 raschipi left 06:29 wigner joined 06:30 faraco joined 06:33 wigner left 06:35 faraco left 06:43 faraco joined 06:46 nadim_ joined
Geth ecosystem: 6c7f447424 | (Ryan S. Northrup)++ (committed using GitHub Web editor) | META.list
Add GLFW to ecosystem

I'm new to this whole Perl 6 module thing. Please forgive me for anything I might've missed procedure-wise.
06:50
ecosystem: fd9e3c90c3 | lizmat++ (committed using GitHub Web editor) | META.list
Merge pull request #355 from YellowApple/patch-1

Add GLFW to ecosystem
lizmat clickbaits p6weekly.wordpress.com/2017/07/31/...r-smaller/ 06:52
06:54 nadim_ left
timotimo read it and can recommend 06:59
07:02 rindolf joined 07:07 wamba left 07:14 Cabanossi left, Cabanossi joined 07:20 mniip_ joined, mniip left 07:21 mniip_ is now known as mniip
faraco question, why rakudo praise the rational type it has? Compared to Perl 5's bigrat or Go Big, why having them as a native giving rakudo an edge over them in this aspect? 07:22
m: say 10 / 3 07:23
camelia 3.333333
faraco say 0.49 - 232
evalable6 -231.51
faraco m: say 0.49 - 232
camelia -231.51
faraco m: say .3 + .282
camelia 0.582
07:24 darutoko joined
faraco m: say (2/9 + 1/3 * 2 / 12).perl; 07:24
camelia <5/18>
07:24 jaldhar left 07:25 jaldhar joined
jeromelanteri nicqrocks Git::Wrapper remote repo choosed for follow perlpilot one (who has 35 commits more) has some bugs maybe for function "log". 07:26
zengargoyle,
lizmat www.reddit.com/r/perl/comments/6qs...to_perl_6/ # comments welcome :-) 07:30
07:35 zakharyas joined 07:57 zakharyas left, Cabanossi left 07:58 ChoHag joined 07:59 wamba joined, Cabanossi joined 08:03 jonas3 joined 08:06 xtreak left, xtreak joined 08:10 dakkar joined 08:11 xtreak left 08:20 domidumont joined 08:26 zakharyas joined
jeromelanteri what: |@x ?@x does ? i mean... what ? and | want to do when you see them in front of @x ? 08:26
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/XxP9KugSMC
Variable '@x' is not declared
at /tmp/XxP9KugSMC:1
------> 03|08⏏04@x ?@x does ? i mean... what ? and | wan
bisectable6 jeromelanteri, On both starting points (old=2015.12 new=15b2596) the exit code is 1 and the output is identical as well
jeromelanteri, Output on both points: «04===SORRY!04=== Error while compiling /tmp/L0wIqTeT5a␤Variable '@x' is not declared␤at /tmp/L0wIqTeT5a:1␤------> 03|08⏏04@x ?@x does ? i mean... what ? and | wan»
committable6 jeromelanteri, ¦6c (21 commits): «04===SORRY!04=== Error while compiling /tmp/704LwR9kbu␤Variable '@x' is not declared␤at /tmp/704LwR9kbu:1␤------> 03|08⏏04@x ?@x does ? i mean... what ? and | wan «exit code = 1»»
jeromelanteri hi hi 08:27
show_me: my @x = <a b c d e f>; say |@x;
m: my @x = <a b c d e f>; say |@x;
camelia abcdef
jeromelanteri m: my @x = <a b c d e f>; say ?@x; 08:28
camelia True
lizmat m: my @a = <a b c d e f>; dd @a; dd |@a
camelia Array @a = ["a", "b", "c", "d", "e", "f"]
Str @a = "a"
Str @a = "b"
Str @a = "c"
Str @a = "d"
Str @a = "e"
Str @a = "f"
jeromelanteri m: my @x = <a>; say ?@x;
camelia True
jeromelanteri m: my @x = <>; say ?@x;
camelia 5===SORRY!5=== Error while compiling <tmp>
Unsupported use of <>; in Perl 6 please use lines() to read input, ('') to represent a null string or () to represent an empty list
at <tmp>:1
------> 3my @x = <7⏏5>; say ?@x;
08:28 astj left
lizmat jeromelanteri: prefix | is the same as .Slip 08:28
08:29 Cabanossi left
jeromelanteri and... what is slip ? 08:29
08:29 astj joined, astj left, astj joined
zengargoyle m: my @x = < a b c >; my @y; @y.push: @x; say @y.perl; @y.push: |@x; say @y; 08:29
camelia [["a", "b", "c"],]
[[a b c] a b c]
08:29 Cabanossi joined
zengargoyle m: my @x = < a b c >; my @y; @y.push: @x; say @y.perl; @y.push: |@x; say @y.perl; 08:30
lizmat jeromelanteri: A Slip is a List that automatically flatten into an outer List (or other list-like container or iterable).
jeromelanteri: see docs.perl6.org/type/Slip
zengargoyle m: my @x = < a b c >; my @y; @y.push: @x; say @y.perl; @y.push: |@x; say @y.perl;
jeromelanteri so it is like .append for add a list to an other one list ?
camelia Resource temporarily unavailable
[["a", "b", "c"],]
[["a", "b", "c"], "a", "b", "c"]
jeromelanteri and ? is it for check if empty list or not ? 08:31
é?é
?@x
lizmat ? boolifies
its like !! in perl 5
jeromelanteri ok
08:31 domidumont left
jeromelanteri i'm reading th eGit::Wrapper module code.. 08:32
zengargoyle m: my @x = < a b c >; my @y; @y.push: @x; say @y.perl; @y.push: |@x; say @y.perl;say ?@x; say ?@y; my @z; say ?@z;
camelia [["a", "b", "c"],]
[["a", "b", "c"], "a", "b", "c"]
True
True
False
jeromelanteri ok 08:33
zengargoyle note second push did 3 items of @x, first push pushed whole @x as a single array.
jeromelanteri i see 08:34
zengargoyle also | is used a lot in function calls. foo(|%hash) or foo(|@args) makes like passing %hash or @array in perl 5. 08:35
perl 6 without the | would be like perl 5 foo(\%hash) foo(\@array) to pass as single item.
jeromelanteri zengargoyle, github.com/nicqrocks/p6-Git-Wrappe...rapper.pm6 08:38
method log has 2 arguments... 08:39
yes ?
github.com/nicqrocks/p6-Git-Wrapper but in the example, there is not.
does it mean that * go search for the one are in the run method ? but how? run method is not a constructor also... i missunderstand the logic. 08:41
zengargoyle jeromelanteri: the * before arguments means 'slurp'... log is like log(foo=>'bar', wiz=>'bang', 'something', 'else')
jeromelanteri ok 08:42
zengargoyle the foo=>'bar' and wiz=>'bang' go into *%n because they are named arguments. 'something' and 'else' go into *@p because they are not named arguments.
jeromelanteri so it is optional arguments?
it can be bothing. 08:43
zengargoyle pretty much. things inside function () are a little different meaning then outside. 08:44
08:45 faraco left
zengargoyle you can only have one *@ and one *%. the *% gets all foo=>'bar' or :foo('bar') or just :foo type arguments. 08:45
the *@ one 'slurps' up everything else...
jeromelanteri ok 08:46
zengargoyle the log() function doesn't really care about the args, it adds %n<date> to whatever you pass in, and then just sends them to the self.run('log', |@p, |%n) 08:47
08:47 vendethiel joined
zengargoyle so basically you pass log the same args you would pass to `git log` in the cli. `git log --pretty=yes` would be $git.log(pretty=>'yes') 08:49
something like that.
lookatme notice that foo => "bar" is a Pair 08:51
not a named argument
zengargoyle method run($subcommand, *@positionals, *%named) -- better names for arguments in this function, writer got lazy and used *@p and *%n in log() :)
jeromelanteri i'm trying to find how to see logs from a remote if you are not in a git directory.
lookatme so *%args won't work with (foo => "bar")
jeromelanteri --remotes option works, but from local git repo
zengargoyle really? 08:52
lookatme you have to write (:foo<bar>)
yeah
I found it when make my module
zengargoyle i thought it was the other way around and you had to do something special-ish to pass a Pair as a positional and not have it get slurped up into the named.... 08:53
lookatme m: sub f(*%args) { }; f(foo => "bar")
camelia ( no output )
lookatme m: sub f(*%args) { say %args.WHAT; }; f(foo => "bar")
camelia (Hash)
lookatme m: sub f(*%args) { say %args.WHAT; }; f(foo => "bar", fooz => "zyx")
camelia (Hash)
lookatme HMM ?
zengargoyle m: sub f(*%args) { say %args.foo; }; f(foo => "bar", fooz => "zyx") 08:54
camelia No such method 'foo' for invocant of type 'Hash'
in sub f at <tmp> line 1
in block <unit> at <tmp> line 1
lookatme It is not working on my pc
zengargoyle m: sub f(*%args) { say %args<foo>; }; f(foo => "bar", fooz => "zyx")
camelia bar
zengargoyle m: sub f(:$fooz, *%args) { say %args<foo>; say $fooz; }; f(foo => "bar", fooz => "zyx") 08:55
camelia bar
zyx
lookatme Oh, i know
it's "foo" => "bar"
m: sub f(*%args) { say %args.WHAT; }; f("foo" => "bar")
camelia Too many positionals passed; expected 0 arguments but got 1
in sub f at <tmp> line 1
in block <unit> at <tmp> line 1
lookatme yeah, not foo => "baz", sorry
zengargoyle ah, yeah. one of *those* types of gotcha... 08:56
lookatme But according the document docs.perl6.org/type/Pair#index-entry-%3D%3E_ 08:58
:foo<baz> is same as "foo" => "baz"
m: sub f(*%args) { say %args.WHAT; }; f(:foo<bar>)
camelia (Hash)
08:59 nadim_ joined
zengargoyle m: sub f(*%args) { say %args.WHAT; }; f("foo" => "bar",) 08:59
camelia Too many positionals passed; expected 0 arguments but got 1
in sub f at <tmp> line 1
in block <unit> at <tmp> line 1
zengargoyle m: sub f(*%args) { say %args.WHAT; }; f("foo" => "bar", "fooz" => "bar")
camelia Too many positionals passed; expected 0 arguments but got 2
in sub f at <tmp> line 1
in block <unit> at <tmp> line 1
lookatme And also, IDK what the different between foo => "baz" and "foo" => "baz"
I guess this is a bug
zengargoyle not sure if bug or just things inside () as function signarures or as paramater list when calling behave a little special. 09:00
lookatme m: sub f(*@ps) { say @ps>>.WHAT; }; f(:foo<bar>)
09:00 faraco joined
camelia Unexpected named argument 'foo' passed
in sub f at <tmp> line 1
in block <unit> at <tmp> line 1
09:00
lookatme m: sub f(*@ps) { say @ps>>.WHAT; }; f(foo => bar)
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
bar used at line 1. Did you mean 'VAR', 'bag'?
lookatme m: sub f(*@ps) { say @ps>>.WHAT; }; f(foo => "bar") 09:01
camelia Unexpected named argument 'foo' passed
in sub f at <tmp> line 1
in block <unit> at <tmp> line 1
lookatme m: sub f(*@ps) { say @ps>>.WHAT; }; f("foo" => "bar")
camelia (Array)
lookatme m: sub f(*@ps) { say @ps>>.&WHAT; }; f("foo" => "bar")
camelia [(Pair)]
lookatme m: sub f(*@ps) { say @ps>>.&WHAT; }; f(foo => "bar")
camelia Unexpected named argument 'foo' passed
in sub f at <tmp> line 1
in block <unit> at <tmp> line 1
09:01 rindolf left
lookatme I am confused 09:02
zengargoyle i think the 'named parameters' part of function define/call is special cased so things like multi-dispatch can be not-impossible. 09:03
09:03 faraco left
lookatme Or they just different in sub call ? 09:03
m: my \x = foo => "baz"; say x.WHAT; 09:04
camelia (Pair)
lookatme m: my \x = "foo" => "baz"; say x.WHAT;
camelia (Pair)
lookatme m: my \x = :foo<baz>; say x.WHAT;
camelia (Pair)
zengargoyle i sort of remember somebody explaining this to me once long ago... but don't remember the details. :/
09:05 xtreak joined
lookatme I would said, this is not a consistency design. 09:05
OH
09:06 zakharyas left 09:13 zakame left 09:14 Cabanossi left
zengargoyle m: sub foo(:$foo,*@p) { say $foo; say @p; }; foo("foo"=>"bar"); 09:14
camelia (Any)
[foo => bar]
zengargoyle m: sub foo(:$foo,*@p) { say $foo; say @p; }; foo(foo=>"bar");
camelia bar
[]
09:15 Cabanossi joined
zengargoyle m: sub foo(:$foo,*@p) { say $foo; say @p; }; foo((foo=>"bar")); 09:15
camelia (Any)
[foo => bar]
zengargoyle ^^ that's how you pass a foo=>"bar" but have it not be considered a named parameter....
lookatme yeah, that's what I mean, they should document that 09:17
09:18 eliasr joined
zengargoyle i think it's more that the 'skilled' p6 people just don't/wouldn't do it that way so it only comes up when somebody doesn't do it the common way that is documented. 09:19
but yeah, there are a few quirky things that need a "don't do this" in the docs. 09:21
lookatme This is the second thing I found they used same thing represent different syntax.
m: say 2(1); 09:24
camelia No such method 'CALL-ME' for invocant of type 'Int'
in block <unit> at <tmp> line 1
lookatme m: say :2(1);
camelia This call only converts base-2 strings to numbers; value 1 is of type Int, so cannot be converted!
in block <unit> at <tmp> line 1
zengargoyle i think that's a repurosing of an invalid thing into something useful. 09:26
09:26 kimmyleo joined
zengargoyle *repurposing 09:26
lookatme yeah, but not friendly to newbie 09:27
09:27 cpage_ joined
zengargoyle hrm, maybe not.. i guess it *could* be 2 => 1 .... 09:28
timotimo one reason that "foo" => "bar" isn't a named parameter is because names for parameters can only be identifiers and you could put anything between quotes, spaces for example
zengargoyle and :42nd *could* be '42nd' => True
lookatme zengargoyle, Hmm 09:29
zengargoyle guess timotimo logic also applies there.... :XXXX can't be "something" due to format of thing so is identifier and identifier can't start with number so :#XXX is most likely invalid. 09:31
09:31 xtreak left
zengargoyle and :XXX is really not a pair but a named, but outside of the () in calling, named just turns into pair, so it's convienent 09:32
zengargoyle thinks that's probably wrong... :) 09:33
09:34 kimmyleo left 09:45 zakharyas joined
zengargoyle i guess you could also argue that "foo" => "bar" can't be a named because it could be "foo$something". but :ident is fixed at compile time. 09:45
lookatme Hmm, I know that is construct a Pair 09:46
zengargoyle and foo => "bar" is fixed at compile time. well the key part.. 09:47
jnthn If the key is a syntactic identifier, and it's directly in an argument list, then it will be taken as a named argument. Otherwise it will be a Pair 09:48
"foo" => "bar" isn't a syntactic identifier, (foo => "bar") isn't directly in the argument list, nor is (:foo<bar>) 09:49
foo => "bar" and :foo("bar") are equivalent and, both have a key that is a syntactic identifier 09:50
zengargoyle does :ident<foo> promote to "ident"=>"foo" outside of an argument list. 09:53
jnthn That's the wrong way round 09:55
They're always a Pair, it's that they get promoted to named arguments when at the top level of an argument list 09:56
zengargoyle and does :2<> and :2nd not turn into pairs just for the convience?
ah, *nods* 09:57
jnthn :2nd is just :nd(2)
zengargoyle why not "2nd" => "True"
because not identifier?
jnthn Also because it'd not be very useful 09:58
Imagine trying to implement s:2nd/foo/bar/
zengargoyle that too...
jnthn Would have to take a slurpy hash and try to parse the number out of it
zengargoyle if the thing after the : can only be an identifer in the basic case, then it's all well and good to do things with the non-identifiers... :) 10:00
lookatme anyway, thanks
off work now
10:01 lookatme left
jnthn Yeah, anything non-identifier after it is a special form 10:01
zengargoyle puts sytatic identifier on the list of things. 10:11
10:12 Cabanossi left 10:13 TEttinger left 10:14 Cabanossi joined 10:18 mr-fooba_ left 10:25 mr-foobar joined 10:27 xtreak joined, xtreak left 10:28 xtreak joined 10:43 xtreak left 10:45 notbenh left, vendethiel left, xtreak joined 10:47 notbenh joined, xtreak_ joined 10:50 someuser joined 10:51 xtreak left 10:56 cpage__ joined, cpage_ left, cpage__ is now known as cpage_ 10:58 Cabanossi left 10:59 Cabanossi joined 11:12 xtreak_ left 11:15 robertle joined
lizmat I need inspiration for a Perl 6 presentation 11:15
what would *you* like me to give a Perl 6 presentation about? 11:16
AlexDaniel m: class Z { method foo($x) { say $x; say %_ } }; Z.new.foo(42, :25bar, :50baz)
camelia 42
{bar => 25, baz => 50}
AlexDaniel m: sub foo($x) { say $x; say %_ }; foo(42, :25bar, :50baz)
camelia 5===SORRY!5=== Error while compiling <tmp>
Placeholder variable '%_' cannot override existing signature
at <tmp>:1
------> 3sub7⏏5 foo($x) { say $x; say %_ }; foo(42, :25
sjn lizmat: "The speed nut's guide to making Perl 6 run faster"
AlexDaniel why is it different? ↑
sjn lizmat: stepping through an actual example on how to speed up something (which questions do you ask? what are you looking for? how do you profile it? how do you avoid common traps? when should you NOT optimize? etc.) 11:17
lizmat sjn: well, there's my dilemma 11:18
I'm cheating all of the time by using nqp
I'm not sure we want to have that wind up in user land minds
:-)
sjn lizmat: no worries; tell people how to cheat well. the goal is to create more people who can participate in the work :) 11:19
participate in a positive way, that is. 11:20
no point in teaching people how to leave behind a mess
11:20 Zoffix joined
Zoffix AlexDaniel: because methods already have %_ 11:21
lizmat: "The Iterables of Rakudo"
lizmat hmmm 11:25
Zoffix faraco, I'd say it's 'cause you don't need to know about floating point issues. The first time I was told to keep prices as Ints in another language, I said "what the hell?". 11:26
In Rakudo, you Do The Right thing by default 11:27
"The 3 most important things missing from Perl 6?": www.reddit.com/r/perl/comments/6qv..._name=perl
11:28 Cabanossi left 11:29 Cabanossi joined
tbrowder m: say 'a'.chr 11:32
camelia Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5a' (indicated by ⏏)
in block <unit> at <tmp> line 1
Zoffix .chr convers from number to character; you likely want .ord
timotimo m: say 'a'.ord
camelia 97
tbrowder say '00110011'.chr 11:33
evalable6 𚶻
Zoffix m: say +'00110011' 11:34
camelia 110011
moritz m: say :2('00110011') 11:35
camelia 51
tbrowder m: say '01100110'.chr
camelia 􌥎
Zoffix Looks like another item for my inconsistencies doc. .chr takes a Str and converts it to Numeric, but
base doesn't
moritz m: say 42.base('2') 11:37
camelia 101010
tbrowder m: say '00110011'.chr 11:38
camelia 𚶻
Zoffix m: say '42'.base: 2
camelia No such method 'base' for invocant of type 'Str'. Did you mean any of these?
Hash
asec
hash
take

in block <unit> at <tmp> line 1
Zoffix tbrowder: it's not parsing it as base 2 number. Just a normal decimal
tbrowder hi folks, just looking for method to convert ascii binary to char 11:39
moritz Zoffix: ah, that's because people used to confuse the method with its opposite
zengargoyle lizmat: audience? i wouldn't mind a "State of the Butterfly" that went over new things between 6.c and now and 6.d preview and in progress. 11:40
moritz tbrowder: :2($string).chr
Zoffix tbrowder: .parse-base(2).chr
moritz m: $string = '11011'; say :2($string)
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$string' is not declared. Did you mean 'Stringy'?
at <tmp>:1
------> 3<BOL>7⏏5$string = '11011'; say :2($string)
moritz m: my $string = '11011'; say :2($string)
camelia 27
moritz m: my $string = '11011'; say :2($string); say :2($string).chr
camelia 27
moritz m: my $string = '111011'; say :2($string); say :2($string).chr 11:41
camelia 59
;
Zoffix zengargoyle: that's gonna be a rather short talk, considering the vast majority of 6.d language features were implemented in 6.c compiler and are in use 11:42
like .parse-base I mentioned above
m: '111011'.parse-base(2).chr.say
camelia ;
tbrowder m: say :2('01000100').chr 11:43
camelia D
11:43 nattefrost joined
tbrowder thanks all! 11:43
Zoffix m: my $string = '0xDEADBEEF'; say :2($string) 11:44
camelia 3735928559
zengargoyle well, i'm thinking more in the whole... like the 'has is default' and the IO changes and the speed improvements, like jnth's dive into reading lines.
Zoffix Ah 11:45
lizmat Something like "2.5 years of Perl 6 Weekly"
zengargoyle things you'd have to read p6weekly to know about, or re-read the documentation daily, or sit in IRC all the time. :P
Zoffix :D
Yeah, sounds interesting.
zengargoyle lizmat: yeah, that-ish i guess. :)
11:46 Zoffix left
lizmat "A Gross Of Perl 6 Weeklies" 11:47
tbrowder m: my $s = "01000100_01000100".parse-base(2).chr
camelia ( no output )
tbrowder m: my $s="01000100";say $s.parse-base(2).str 11:49
camelia No such method 'str' for invocant of type 'Int'. Did you mean 'Str'?
in block <unit> at <tmp> line 1
zengargoyle i just know that it's weird/hard dropping in and out and keeping up with changes. and the yearly "State of the Velociraptor" type talks are pretty cool for at least getting an idea of whats going on and which bits have changed or improved. 11:50
and they're usually full of *cool* 11:51
tbrowder m: my $s="01000100";say $s.parse-base(2).chr;say $s.parse-base(2).Str
camelia D
68
tbrowder m: say 68.chr 11:53
camelia D
tbrowder m: say 68.Str 11:54
camelia 68
Aaronepower Hello, I'm using vim and the perl6 syntax seems to slowdown the editor. It seems to have a lot of complex regexes, is there a perl package with better syntax highlighting? 11:58
moritz I'm not aware of any
Perl 6 syntax *is* complex (unfortunately for syntax hilighting) 11:59
jeromelanteri moritz, if i can, you can... 12:01
zengargoyle i switched to neovim a few years ago and it was a bit faster than vim 7, not sure about vim 8. 12:02
Aaronepower zengargoyle: This is with Vim 8, I'm not sure if the package is actually using any of the new APIs though.
jeromelanteri zengargoyle, vim 8 is fast... but depend of plugins you add also.
AlexDaniel perl6-mode in emacs does not feel slow at all
zengargoyle yeah, i can believe that. neovim was much less laggy than vim 7 and i haven't has the need to switch back and try vim 8 yet. i very rarely get highlighting slowness but it may just be size or complexity of code i see. 12:05
and i have a new laptop since then, so maybe it's just fast enough i wouldn't notice. :) 12:07
12:08 araraloren joined
Aaronepower Cloning the latest vim-perl6 seemed to help a bit. github.com/vim-perl/vim-perl6 12:10
jeromelanteri what is the "best" way to remove a key/value pair from a hash ? 12:11
or inside a hash
jnthn %hash<key>:delete (or %hash{$key}:delete) probably 12:12
jeromelanteri perfect thank you jnthn
12:12 AlexDaniel left, AlexDaniel joined
jeromelanteri no such method delete jnthn.. nevermind, i'm going to search in the api of hash 12:16
12:16 vendethiel joined
jeromelanteri %a<key>:delete 12:17
jnthn Did you write . instead of : ?
zengargoyle m: my %h = a => "1', b => "2";, say %h; say %h<a>:delete; say %h;
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3my %h = a => "1', b => "7⏏052";, say %h; say %h<a>:delete; say %h;
expecting any of:
infix
infix stopper
postfix
12:17 Aaronepower left
zengargoyle m: my %h = a => "1', b => "2"; say %h; say %h<a>:delete; say %h; 12:17
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3my %h = a => "1', b => "7⏏052"; say %h; say %h<a>:delete; say %h;
expecting any of:
infix
infix stopper
postfix
jnthn zengargoyle: mismatched quote around 1 12:18
zengargoyle m: my %h = a => "1", b => "2"; say %h; say %h<a>:delete; say %h;
camelia {a => 1, b => 2}
1
{b => 2}
zengargoyle must be my bed time.
jeromelanteri zengargoyle, good night. 12:19
zengargoyle did you see the :delete
jeromelanteri yes
zengargoyle cool, bon nuit
jeromelanteri and same for an array as i can see
bonne nuit
tbrowder m: my $b="010001000100010001000100";say $b.comb.(0..7).parse-base(2).chr 12:23
camelia No such method 'CALL-ME' for invocant of type 'Seq'
in block <unit> at <tmp> line 1
12:24 sena_kun joined, mr-foobar left
tbrowder m: my $b="01000100";say $b.comb.[0..7].parse-base(2).chr 12:25
camelia No such method 'parse-base' for invocant of type 'List'
in block <unit> at <tmp> line 1
12:26 mr-foobar joined
sena_kun m: my %h = :a($("1", "3", "4")); say %h<a>[*]; 12:26
camelia P6opaque: no such attribute '$!todo' in type List when trying to get a value
in block <unit> at <tmp> line 1
sena_kun Can someone RT it? The guilty is likely github.com/rakudo/rakudo/commit/a2...9f0fdaR220 12:27
12:27 Cabanossi left
sena_kun ping lizmat 12:27
lizmat sena_kun: consider me pinged :-) 12:28
sena_kun lizmat, o/
lizmat please RT it and write a test :-)
sena_kun Sure... Where should the test be placed to fit nicely?
lizmat good question :-) 12:29
12:29 Cabanossi joined
tbrowder m: my $b="01000100"; say $b.comb.[0..7].flat.pares-base(2).chr 12:30
camelia No such method 'pares-base' for invocant of type 'Seq'
in block <unit> at <tmp> line 1
12:31 Aaronepower joined
lizmat parse-base ? 12:31
tbrowder yep, fumble finger!
Aaronepower Hey, how would do this in perl6? Where I want to go through an array check if any of the objects timestamp is less than a certain date? paste.rs/PHO 12:32
tbrowder m: my $b="01000100";say $b.comb.[0..7].flat.parse-base(2).chr 12:33
camelia No such method 'parse-base' for invocant of type 'Seq'
in block <unit> at <tmp> line 1
tbrowder probably need a join in the mix... 12:34
araraloren m: say (^10).grep({ $_ > 5 });
camelia (6 7 8 9)
araraloren Aaronepower, ^^
tbrowder m: my $b="01000100";say $b.comb.[0..7].join.parse-base(2).chr 12:36
camelia D
tbrowder \o/
Aaronepower araraloren: So now with this code paste.rs/rY8 I get this error.paste.rs/M6a 12:37
12:38 xtreak joined
araraloren Aaronepower, is that code be line 61 in get_issues.p6 ? 12:40
Aaronepower araraloren: line 61 is `$date - $epoch < 0`
12:41 xtreak left, xtreak joined
araraloren Aaronepower, what's the type of $epoch 12:41
Aaronepower araraloren: Date
araraloren Date ? 12:42
Aaronepower araraloren: Ah, I got it. 12:43
araraloren Hmm, ok
Aaronepower araraloren: I just needed to add `.Date` to `DateTime.new($time)`.
12:45 xtreak left
sena_kun RT'd. \o/ 12:48
Aaronepower araraloren: Is there any equivalevent to the grep command that just returns a boolean? I'm more interested IF there are results than the results themselves.
jeromelanteri m: my @a = ({g=>"rock", r=>[{t=>"bip", u=>"bap"}, {t=>"al" t=>"loula"}]}, {g=>"jazzy", r=>[{t=>"that's", u=>"awond"}, {t=>"erfull", u=>"world"}]}); @a.map: {if (*<g> eq "rock") { *<r>.map: { if (*<t> eq "bip") { *:delete }}}; 12:51
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3ock", r=>[{t=>"bip", u=>"bap"}, {t=>"al"7⏏5 t=>"loula"}]}, {g=>"jazzy", r=>[{t=>"th
expecting any of:
infix
infix stopper
jeromelanteri how to go two level deep with map in a variable ?
first map give *, and then after ? 12:52
** ?
araraloren m: say so (^10).any.grep({ $_ > 5 });
camelia True
araraloren Is this helpful ? Aaronepower
12:53 mcmillhj joined
jeromelanteri Aaronepower, match ? 12:53
Aaronepower jeromelanteri: ??? 12:54
araraloren m: my @a = ({g=>"rock", r=>[{t=>"bip", u=>"bap"}, {t=>"al" t=>"loula"}]}, {g=>"jazzy", r=>[{t=>"that's", u=>"awond"}, {t=>"erfull", u=>"world"}]}); @a.map({if (*<g> eq "rock") { *<r>.map({ if (*<t> eq "bip") { *:delete }})});
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3ock", r=>[{t=>"bip", u=>"bap"}, {t=>"al"7⏏5 t=>"loula"}]}, {g=>"jazzy", r=>[{t=>"th
expecting any of:
infix
infix stopper
jeromelanteri (i'ù not sure that you want) docs.perl6.org/type/Match#(Cool)_routine_match
araraloren m: my @a = ({g=>"rock", r=>[{t=>"bip", u=>"bap"}, {t=>"al", t=>"loula"}]}, {g=>"jazzy", r=>[{t=>"that's", u=>"awond"}, {t=>"erfull", u=>"world"}]}); @a.map({if (*<g> eq "rock") { *<r>.map({ if (*<t> eq "bip") { *:delete }})});
camelia 5===SORRY!5=== Error while compiling <tmp>
You can't adverb *
at <tmp>:1
------> 3*<r>.map({ if (*<t> eq "bip") { *:delete7⏏5 }})});
expecting any of:
pair value
Aaronepower araraloren: Does that any somehow change the type? Because now I get nil on hash lookup.
jeromelanteri araraloren, i let you help our friend Aaronepower first... 12:55
Aaronepower jeromelanteri: Could you provide an example of how to use match? 12:56
As there is none in the documentation.
lizmat Aaronepower: .first ?
jeromelanteri Aaronepower, that is my problem to... :)
araraloren m: say (^10).any.grep({ $_ ~~ Int });
camelia any((0), (1), (2), (3), (4), (5), (6), (7), (8), (9))
jeromelanteri ha yes... first
no, it doesn't give back a boolean. 12:58
araraloren yeah, first also work 12:59
lizmat it doesn't give back a Bool, but you can coerce to Bool 13:00
araraloren use 13:01
13:01 unclechu left, mack[m] left
araraloren use so convert a object to Bool 13:01
13:01 M-Illandan left, tadzik left
Aaronepower So the reason I was wondering if there was one that just gave a bool was so that the search wasn't needlessly copying the data out of the array. 13:01
lizmat jeromelanteri: if your array contains truthy values only, that should be ok 13:02
13:02 mienaikage left, wictory[m] left, ilmari[m] left, tyil[m] left, xui_nya[m] left
araraloren Aaronepower, you can use .first replace .grep and add a `so` after your `say` 13:02
Aaronepower araraloren: What does so do? 13:03
lizmat it's the opposite of not
jeromelanteri lizmat, my problem is to check deply the variable, then if find, remove the part found. but * is still the closer "map" variable, not the original one.
13:03 Matthew[m] left
jeromelanteri deeply 13:03
13:03 CIAvash[m] left
Aaronepower lizmat: So like `!!(expr)`? 13:03
lizmat yes, but with lower precedence
like and / or vs && / || 13:04
jeromelanteri so i do $x.map: { *.map { *:delete } };
araraloren m: say so ^10 .grep({$_ > 5})
camelia True
Aaronepower Can you use adverbs with heredoc strings? 13:05
moritz I think you can 13:06
lizmat yes
moritz q:w:to...
Aaronepower Ah, I missing the extra colon.
lizmat needs to commute&
13:06 lizmat left 13:12 AlexDaniel left, AlexDaniel joined 13:13 Cabanossi left 13:14 Cabanossi joined
[Coke] chuckles over blog.plover.com/2017/07/31/#ogonek 13:15
huf :) 13:18
yeah, it's a lot easier if you already know what it says
Aaronepower Do expressions like `10 > 5 > 0` work like I think they do? 13:25
perlpilot Aaronepower: I dunno, how do you think they work? ;)
Aaronepower Or is this like `10 > 5` => `1 > 0`?
moritz if you think they work like (10 > 5) && (5 > 0), then yes
Aaronepower moritz: Really?
perlpilot m: say 10 > 7 > 5 > 3 > 1 13:26
camelia True
Aaronepower Wow.
That's honestly too intuitive. 13:27
13:27 bstamour left
moritz we call them "chaining operators" 13:27
perlpilot Hmm. I just tried to search for "chaining" and "listfix" on docs.perl6.org ... that didn't turn out too useful. 13:28
nadim_ used operator chaining yesterday for the first time because the use case what right in front of my eyes, code fell into its place naturally 13:32
13:41 mienaikage joined 13:44 xtreak joined 13:47 xtreak left 13:48 lichtkind joined 13:49 audiatorix left, skids joined 13:50 rindolf joined 13:51 kerframil joined 13:57 Actualeyes left 13:58 Actualeyes joined 14:06 tadzik joined, mack[m] joined, M-Illandan joined, tyil[m] joined, unclechu joined, wictory[m] joined, ilmari[m] joined, Matthew[m] joined, CIAvash[m] joined, xui_nya[m] joined 14:09 zakharyas left, zakharyas joined 14:13 zakharyas left 14:18 araraloren_ joined 14:21 araraloren left
Aaronepower Sorry to keep asking questions. Is there a sort of in place grep? Where the results are removed from the original array? 14:22
jeromelanteri how to nested map with perl6 ... any link around ? 14:24
sena_kun m: my @a = <1 2 3 4 5>; @a .= grep(* > 3); 14:25
camelia ( no output )
sena_kun Aaronepower, maybe ^
m: my @a = <1 2 3 4 5>; say @a; @a .= grep(* > 3); say @a;
camelia [1 2 3 4 5]
[4 5]
Aaronepower sena_kun: I think you misunderstood me, what I is `[1 2 3]` part. 14:26
I want is the* 14:27
sena_kun Aaronepower, ah, sorry.
Can't you just invert your condition with `not`?
m: my @a = <1 2 3 4 5>; say @a; @a .= grep(not * > 3); say @a;
camelia [1 2 3 4 5]
[1 2 3]
Aaronepower sena_kun: That seems a bit annoying to have to run grep twice to get the two intersections. 14:29
sena_kun: Thanks for a solution though. :) 14:31
jeromelanteri $_:delete ==> sorry, $_:delete is not declared (ok, but i don't want to declare something i want to delet also)
sena_kun Aaronepower, well, maybe someone knows a better way to do it. 14:32
Aaronepower sena_kun: Is there any way to do things in place do you know? 14:33
jeromelanteri m: my @a = ({g=>"rock", r=>[{t=>"bip", u=>"bap"}, {t=>"al" t=>"loula"}]}, {g=>"jazzy", r=>[{t=>"that's", u=>"awond"}, {t=>"erfull", u=>"world"}]}); @a.map: {if ($_<g> eq "rock") { $_<r>.map: { if ( $_<t> eq "bip") { $_:delete }}};
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3ock", r=>[{t=>"bip", u=>"bap"}, {t=>"al"7⏏5 t=>"loula"}]}, {g=>"jazzy", r=>[{t=>"th
expecting any of:
infix
infix stopper
jeromelanteri m: my @a = ({g=>"rock", r=>[{t=>"bip", u=>"bap"}, {t=>"al", t=>"loula"}]}, {g=>"jazzy", r=>[{t=>"that's", u=>"awond"}, {t=>"erfull", u=>"world"}]}); @a.map: {if ($_<g> eq "rock") { $_<r>.map: { if ( $_<t> eq "bip") { $_:delete }}}; 14:34
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$_:delete' is not declared
at <tmp>:1
------> 3) { $_<r>.map: { if ( $_<t> eq "bip") { 7⏏5$_:delete }}};
jeromelanteri voilà...
so how to just remove the find nested element mapped ?
$_:delete, i hope, will be the second condion mapped $_) 14:35
m: my @a = ({g=>"rock", r=>[{t=>"bip", u=>"bap"}, {t=>"al", t=>"loula"}]}, {g=>"jazzy", r=>[{t=>"that's", u=>"awond"}, {t=>"erfull", u=>"world"}]}); @a.map: {if ($_<g> eq "rock") { $_<r>.map: { if ( $_<t> eq "bip") { *:delete }}}; 14:36
camelia 5===SORRY!5=== Error while compiling <tmp>
You can't adverb *
at <tmp>:1
------> 3>.map: { if ( $_<t> eq "bip") { *:delete7⏏5 }}};
expecting any of:
pair value
jeromelanteri m: my @a = ({g=>"rock", r=>[{t=>"bip", u=>"bap"}, {t=>"al", t=>"loula"}]}, {g=>"jazzy", r=>[{t=>"that's", u=>"awond"}, {t=>"erfull", u=>"world"}]}); @a.map: {if ($_<g> eq "rock") { $_<r>.map: { if ( $_<t> eq "bip") { *:delete; }}};
camelia 5===SORRY!5=== Error while compiling <tmp>
You can't adverb *
at <tmp>:1
------> 3>.map: { if ( $_<t> eq "bip") { *:delete7⏏5; }}};
expecting any of:
pair value
sena_kun Aaronepower, well, some methods have destructing nature(with `-rw` suffix mostly), but `.=` call with an assignment is the easiest thing I can think about right now. I am not a "real" perl 6 hacker though. :)
Aaronepower sena_kun: Don't arbitrarily gate-keep yourself. :D 14:37
jeromelanteri m: my @a = ({g=>"rock", r=>[{t=>"bip", u=>"bap"}, {t=>"al", t=>"loula"}]}, {g=>"jazzy", r=>[{t=>"that's", u=>"awond"}, {t=>"erfull", u=>"world"}]}); @a.map: {if ($_<g> eq "rock") { $_<r>.map: { if ( $_<t> eq "bip") { *:delete! }}}; 14:38
camelia 5===SORRY!5=== Error while compiling <tmp>
You can't adverb *
at <tmp>:1
------> 3>.map: { if ( $_<t> eq "bip") { *:delete7⏏5! }}};
expecting any of:
pair value
jeromelanteri m: my @a = ({g=>"rock", r=>[{t=>"bip", u=>"bap"}, {t=>"al", t=>"loula"}]}, {g=>"jazzy", r=>[{t=>"that's", u=>"awond"}, {t=>"erfull", u=>"world"}]}); @a.map: {if ($_<g> eq "rock") { $_<r>.map: { if ( $_<t> eq "bip") { $_delete please }}};
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$_delete' is not declared
at <tmp>:1
------> 3) { $_<r>.map: { if ( $_<t> eq "bip") { 7⏏5$_delete please }}};
jeromelanteri m: my @a = ({g=>"rock", r=>[{t=>"bip", u=>"bap"}, {t=>"al", t=>"loula"}]}, {g=>"jazzy", r=>[{t=>"that's", u=>"awond"}, {t=>"erfull", u=>"world"}]}); @a.map: {if ($_<g> eq "rock") { $_<r>.map: { if ( $_<t> eq "bip") {my $_delete }}}; 14:39
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3{ if ( $_<t> eq "bip") {my $_delete }}};7⏏5<EOL>
jeromelanteri m: my @a = ({g=>"rock", r=>[{t=>"bip", u=>"bap"}, {t=>"al", t=>"loula"}]}, {g=>"jazzy", r=>[{t=>"that's", u=>"awond"}, {t=>"erfull", u=>"world"}]}); @a.map: {if ($_<g> eq "rock") { $_<r>.map: { if ( $_<t> eq "bip") {my $_delete }}}};
camelia ( no output )
jeromelanteri m: my @a = ({g=>"rock", r=>[{t=>"bip", u=>"bap"}, {t=>"al", t=>"loula"}]}, {g=>"jazzy", r=>[{t=>"that's", u=>"awond"}, {t=>"erfull", u=>"world"}]}); @a.map: {if ($_<g> eq "rock") { $_<r>.map: { if ( $_<t> eq "bip") {my $_:delete }}}};
camelia ( no output )
jeromelanteri m: my @a = ({g=>"rock", r=>[{t=>"bip", u=>"bap"}, {t=>"al", t=>"loula"}]}, {g=>"jazzy", r=>[{t=>"that's", u=>"awond"}, {t=>"erfull", u=>"world"}]}); @a.map: {if ($_<g> eq "rock") { $_<r>.map: { if ( $_<t> eq "bip") { $_:delete }}}};
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$_:delete' is not declared
at <tmp>:1
------> 3) { $_<r>.map: { if ( $_<t> eq "bip") { 7⏏5$_:delete }}}};
jeromelanteri m: my @a = ({g=>"rock", r=>[{t=>"bip", u=>"bap"}, {t=>"al", t=>"loula"}]}, {g=>"jazzy", r=>[{t=>"that's", u=>"awond"}, {t=>"erfull", u=>"world"}]}); @a.map: {if ($_<g> eq "rock") { $_<r>.map: { if ( $_<t> eq "bip") { $_.:delete }}}};
merced wow
camelia ( no output )
merced are you editing that inline lol 14:40
jeromelanteri merced, i done yes
one time
i search how to remove a found nested variable element from map 14:41
i'm searching (sorry)
merced, any idea (or just one would be suffisant) ?
Aaronepower sena_kun: Is there a way to store predicates, so I don't have to write the same `{ }` block with `not` infront of it? 14:42
14:42 lowbro left
merced dunno, i'm still learning perl x] 14:42
jeromelanteri merced we are in the same boat then... 14:43
sena_kun Aaronepower, sure. My (long) version would be...
m: my &block = * > 5; say (^10).grep(&block);
camelia (6 7 8 9)
sena_kun I am sure there are other ways to do it though.
Aaronepower sena_kun: Good enough for me. 14:44
ilmari m:: my $predicate = * > 5; say (^10).grep({ not &$predicate })
evalable6 ilmari, Full output: gist.github.com/55e2cfccb38f10f264...e4bbccd8ed
(exit code 1) 04===SORRY!04=== Error while compiling /tmp/6TccaCXdXR
Bogus s…
ilmari m: my &predicate = * > 5; say (^10).grep({ not &predicate })
camelia ()
ilmari m: my &predicate = * > 5; say (^10).grep(not &predicate) 14:45
camelia Cannot use Bool as Matcher with '.grep'. Did you mean to use $_ inside a block?
in block <unit> at <tmp> line 1
jeromelanteri not * >5 is like * < 5... or not ?
ilmari bah
14:45 pharv joined
sena_kun m: my &predicate = * > 5; say (^10).grep({not &predicate($_)}) 14:46
camelia (0 1 2 3 4 5)
sena_kun ilmari, ^?
ilmari mm
jeromelanteri i mean... if x is NOT > 5, then x IS =< 5 (this day, maybe tomorrow same) 14:47
anyway, good night
sena_kun o/ 14:48
14:51 khw joined, Zoffix joined
Zoffix Just use `none` Junction instead of `not`: 14:52
m: my &predicate = * > 5; say (^10).grep(none &predicate)
camelia (0 1 2 3 4 5)
Zoffix The "remove grepped results from array" can also be written using `:k` adverb to .grep to get indices only and then :delete those indices:
m: my @a = <1 2 3 4 5>; .[.grep: * > 3, :k]:delete with @a; say @a
camelia [1 2 3]
tony-o Zoffix: modules.zef.pm should be back up now 14:53
including search
working on the module browsing aspect
Zoffix jeromelanteri: not guranteed:
m: say [ NaN <= 5, NaN > 5 ]
camelia [False False]
Zoffix tony-o++ grep
I mean... 14:54
tony-o++ great
:)
14:54 mr-fooba_ joined 14:57 mr-foobar left
Zoffix jeromelanteri: what did you want to delete from your thing? Just the `t` key or the entire upper level? 14:57
14:58 pharv left
Aaronepower Zoffix: How do you also retain the results? Can you also retain the results? 14:59
Zoffix Aaronepower: results being what? The stuff that was deleted? 15:01
Aaronepower Zoffix: Yes, [4 5]
timotimo if you want to have both, may i suggest classify?
Zoffix Aaronepower: that's returned from :delete
m: my @a = <1 2 3 4 5>; my @stuff-that's-deleted = .[.grep: * > 3, :k]:delete with @a; say @a; say @stuff-that's-deleted 15:02
camelia [1 2 3]
[4 5]
Aaronepower Zoffix: Okay thanks!
timotimo m: my @a = <1 2 3 4 5>; my (@tossed, @kept) = @a.classify(* > 3); dd @tossed, @kept;
camelia Array @tossed = [Bool::True => $[IntStr.new(4, "4"), IntStr.new(5, "5")], Bool::False => $[IntStr.new(1, "1"), IntStr.new(2, "2"), IntStr.new(3, "3")]]
Array @kept = []
Zoffix And yeah, there's .classify that's likely a tool for the job
timotimo whoops :)
oh gotta run, bbl 15:03
Zoffix m: my @a = <1 2 3 4 5>; my (@tossed, @kept) := @a.classify(* > 3){True, False}; say @tossed; say @kept;
camelia [4 5]
[1 2 3]
Zoffix Is there a way to write it as `(my @tossed, @a)` or something similar? Like declare only one var and re-use the other? 15:05
m: my @a = <1 2 3 4 5>; my @tossed; :(@ (@tossed, @a) ) := \(@a.classify(* > 3){True, False}); say @tossed; say @a; 15:08
camelia [4 5]
[1 2 3]
Zoffix close, but no cigar
15:10 itaipu joined
Aaronepower Zoffix: What is `:=`? 15:11
jeromelanteri Zoffix, the t key/value
m: my @a = ({g=>"rock", r=>[{t=>"bip", u=>"bap"}, {t=>"al", t=>"loula"}]}, {g=>"jazzy", r=>[{t=>"that's", u=>"awond"}, {t=>"erfull", u=>"world"}]}); @a.map: {if ($_<g> eq "rock") { $_<r>.map: { if ( $_<t> eq "bip") { $_:kv:delete }}}}; 15:12
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$_:kv:delete' is not declared
at <tmp>:1
------> 3) { $_<r>.map: { if ( $_<t> eq "bip") { 7⏏5$_:kv:delete }}}};
Zoffix Aaronepower: binding operator. In this case it's binding the capture on the RHS to the signature on the LHS, so I can use signature unpacking to unpack the bits
huggable: Signature
huggable Zoffix, Parameter list pattern: docs.perl6.org/type/Signature
Zoffix Unsure where that stuff's documented; maybe there ^
jeromelanteri m: my @a = ({g=>"rock", r=>[{t=>"bip", u=>"bap"}, {t=>"al", t=>"loula"}]}, {g=>"jazzy", r=>[{t=>"that's", u=>"awond"}, {t=>"erfull", u=>"world"}]}); @a.map: {if ($_<g> eq "rock") { $_<r>.map: { if ( $_<t> eq "bip") { ~$_:delete }}}}; 15:13
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$_:delete' is not declared
at <tmp>:1
------> 3 { $_<r>.map: { if ( $_<t> eq "bip") { ~7⏏5$_:delete }}}};
jeromelanteri m: my @a = ({g=>"rock", r=>[{t=>"bip", u=>"bap"}, {t=>"al", t=>"loula"}]}, {g=>"jazzy", r=>[{t=>"that's", u=>"awond"}, {t=>"erfull", u=>"world"}]}); @a.map: {if ($_<g> eq "rock") { $_<r>.map: { if ( $_<t> eq "bip") { ~$_.:delete }}}};
camelia ( no output )
jeromelanteri m: my @a = ({g=>"rock", r=>[{t=>"bip", u=>"bap"}, {t=>"al", t=>"loula"}]}, {g=>"jazzy", r=>[{t=>"that's", u=>"awond"}, {t=>"erfull", u=>"world"}]}); @a.map: {if ($_<g> eq "rock") { $_<r>.map: { if ( $_<t> eq "bip") { ~$_.:delete }}}};say @a; 15:14
camelia [{g => rock, r => [{t => bip, u => bap} {t => loula}]} {g => jazzy, r => [{t => that's, u => awond} {t => erfull, u => world}]}]
Zoffix jeromelanteri: ok, so use a .map or a for loop to find the hash you want (.<g> eq 'rock') and then use mutating .grep over the .<r> array to grep out the values
jeromelanteri ok
thank you
Zoffix jeromelanteri: also, camelia accepts /msg, if you want to spam the channel
m: my @a = ({g=>"rock", r=>[{t=>"bip", u=>"bap"}, {t=>"al", t=>"loula"}]},{g=>"jazzy", r=>[{t=>"that's", u=>"awond"}, {t=>"erfull", u=>"world"}]}); @a.map: { next unless .<g> eq "rock"; .<r> .= grep: *<t> ne "bip" }; say @a; 15:15
camelia [{g => rock, r => ({t => loula})} {g => jazzy, r => [{t => that's, u => awond} {t => erfull, u => world}]}]
15:15 zakharyas joined
Zoffix jeromelanteri: ^ that's the result you wanted? 15:15
jeromelanteri Zoffix, fantastic !
Zoffix sweet
jeromelanteri thk u
Zoffix *don't want to spam I meant :) 15:16
15:16 jaldhar left
jeromelanteri Zoffix, humour is better 15:16
Aaronepower Is there a good way for interpolating Hashes in a string? Doing just `%foo{}` isn't really the format I want. 15:20
Zoffix What format you want?
Aaronepower Zoffix: One I define.
jeromelanteri Zoffix, i read three times, it still nice and fantasic. very happy, thank you again. 15:22
Zoffix m: my %h = :42foo, :bar<meows>; say "Teh {%h.pairs».fmt("%s => %s").join(" | ")} iterpolator"
camelia Teh bar => meows | foo => 42 iterpolator
Zoffix m: my %h = :42foo, :bar<meows>; %h does role { method Str { "some hash with {+self.keys} keys" } }; say "Teh %h{} iterpolator" 15:23
camelia Teh some hash with 2 keys iterpolator
Aaronepower Zoffix: So you're saying you can override methods per variable?! 15:25
Zoffix Per object; yeah
There's `does` infix operator for that and also `but` operator that makes a shallow copy of the object first.
m: say True but False 15:26
camelia False
Zoffix m: my $truthy-zero = 0 but True; say so 0; say so $truthy-zero; say $truthy-zero + 42
camelia False
True
42
Aaronepower Zoffix: Does anything made from that object also have it? 15:27
Zoffix: Like a pair copied out.
Zoffix It just mixes a role into the object; if you're instantiating another object from it, yeah, it'll still have that role, but if you're asking the object to make something that's not affected by that role, then no it won't be there. 15:28
Like a pair copied out
m: say (%() but role meower {}).^name
camelia Hash+{meower}
Zoffix m: say (%() but role meower {})<foo>:kv.^name 15:29
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed postfix call
at <tmp>:1
------> 3say (%() but role meower {})<foo>:kv.7⏏5^name
Zoffix m: say ((%() but role meower {})<foo>:kv).^name
camelia List
Zoffix m: say ((%() but role meower {})<foo>:kv).head.^name
camelia Nil
Zoffix m: say ((%(:42foo) but role meower {})<foo>:kv).head.^name
camelia Str
Zoffix m: say ((%(:42foo) but role meower {})<foo>:p).head.^name 15:30
camelia Pair
Zoffix :)
m: role mooer {}; say ((%(:42foo) but role meower { method AT-KEY (|) { callsame() but mooer } })<foo>).^name 15:33
camelia Int+{mooer}
Zoffix hehe
(no idea how to mix into the Pair; I guess that needs to override the `postcircumfix:<{ }>` op)
15:33 zakharyas left
Zoffix m: role mooer {}; sub postcircumfix:<{ }>(|c) { CORE::(q|&postcircumfix:<{ }>|)(|c) but mooer }; say (%(:42foo)<foo>:p).^name 15:35
camelia Pair+{mooer}
Zoffix haha :)
15:36 lizmat joined 15:37 Kyo91 joined
Aaronepower Zoffix: I was just being curious not actually looking for the solution. :p 15:41
15:43 nadim_ left 15:44 cdg joined 15:49 someuser left, AlexDaniel left, AlexDaniel joined 15:58 araraloren_ left 16:00 cdg left 16:02 dakkar left 16:04 jonathon joined 16:05 jonathon left, mr-foobar joined, jonathon joined
jonathon hi! after installing `zef` I'm getting an error when trying to run: '/usr/share/perl6/vendor/short/3...6' is a directory, cannot do '.open' on a directory. Any idea what's going on? (I'm attempting a packaged/system version rather than a user-local) 16:06
16:07 mr-fooba_ left
Zoffix shrugs 16:08
16:08 bennofs joined
Zoffix Trying to run what? zef? That's the exact command you're running? Also, what's your rakudo version? (perl6 -v ) 16:09
bennofs How would I best approach parsing a string of the form "+ 1.23 identifier" with perl6?
Zoffix bennofs: depends what you want the final result to be and the variation of it.. could be as simple as my ($sign, $number, $identifier) = "+ 1.23 identifier".words; 16:10
jonathon Yup, running `/usr/share/perl6/vendor/bin/zef` . $perl6 -v This is Rakudo version 2017.07 built on MoarVM version 2017.07 implementing Perl 6.c.
Zoffix No idea. Never seen that error before. 16:11
16:11 kaare__ joined, kaare_ left
jonathon Zoffix: cool, glad it's not something obvious I've overlooked. :D 16:12
Zoffix maybe ugexe++ (the author of zef) would know that's causing that error
jonathon Yeah, next step is to open an issue on the GitHub tracker, but I wanted to make sure it wasn't something that is a known Perl6 error (e.g. when you attempt a certain thing) 16:14
16:14 gabiruh joined, wamba left 16:15 robertle left 16:16 raschipi joined 16:17 Kyo91 left
mspo jonathon: I saw that the other day too 16:19
jonathon mspo: with zef or another perl6 program? 16:20
ugexe whats the --ll-exception output? 16:21
16:21 nhywyll joined
mspo jonathon: with zef trying to install zef 16:22
jonathon: I think when it might have already been installed?
jonathon ugexe: bear with me, i'm a p6 noob (but a fairly experienced packager)
mspo jonathon: I was attempting to make pkgsrc package for zef, in fact
Zoffix braces to be proven wrong about --ll-exception bug being insignicant :)
jonathon zef --ll-exception\n ===SORRY!===\n '/usr/share/perl6/vendor/short/34674DE0B49051C42E89F10D51FE788C3C3A3816' is a directory, cannot do '.open' on a directory
ugexe you'll have to do `perl6 --ll-exception $path-to-zef` 16:23
jonathon ugexe: hastebin.com/irixiwozed.js 16:25
ugexe Zoffix: heh
mspo yeah I was trying to run a perl6 program that used #! and for some reason it was interpreting as a shell script 16:26
nfi what that was about
ugexe jonathon: what if you `rm -rf ~/.perl6` and try again?
16:27 mr-foobar left
jonathon exact same output 16:27
Zoffix ugexe: haha :) 16:31
Zoffix doesn't mind being wrong once in a while :)
16:32 bennofs left
mspo ugexe: I only got it once but here's the output: gist.github.com/msporleder/8cc6b01...2754c801ae 16:32
geekosaur nspo, you;re on a platform that can't chain #!s
mspo ugexe: I think I had the '.' in the wrong place or something
geekosaur likely 16:33
ugexe its failing during precomp for some reason
mspo oh, no, the '.' is right there too
16:33 cdg joined
ingy m: sub foo(*@args) {.say for @args}; foo [1, 2], 3 16:33
camelia 1
2
3
mspo ugexe: it only happened once so a bit of a mystery bug (for me) 16:34
16:34 raschipi left
ingy m: sub foo(*@args) {.say for @args}; foo {1 => 2}, 3 16:34
camelia 1 => 2
3
ingy how can you rationalize the difference between those?
Zoffix ingy: *@ slurps Iterables. You get a list of Pairs from a Hash 16:35
raiph ingy: * flattens a list into its elements
yoleaux 25 Jul 2017 06:24Z <nine> raiph: Please never ever suggest rakudobrew as a "fix" to users. It will harm more than help. When users talk about precomp issues, we need those reported and then fix them.
25 Jul 2017 14:06Z <zengargoyle> raiph: can you maybe augment the bib parser with like: my $kv-index = .<kv-pairs><kv-pair>.first({$_.<key> ~~ "title"}, :k); # so it doesn't just use .<kv-pairs><kv-pair>[0]<value>
ingy etoomuchmagikz
Zoffix No magics at all.
m: sub foo(*@args) {.say for @args}; foo {1 => 2, :42foo}, 3
camelia 1 => 2
foo => 42
3
ingy what sig do I use to get [1,2],3 as 2 args? 16:36
Zoffix m: sub foo(+@args) {.say for @args}; foo [1, 2], 16:37
camelia 1
2
Zoffix m: sub foo(+@args) {.say for @args}; foo [1, 2], 3
camelia [1 2]
3
jonathon is precompilation tied to disk inodes?
ingy Zoffix: cheers
mspo jonathon: it's tied to timestamps
16:37 Cabanossi left
Zoffix I don't think it's tied to timestamps anymore 16:37
mspo Zoffix: since yesterday? :)
lol
Zoffix Since ~middle of 2017.06-2017.07 IIRC 16:38
16:38 Cabanossi joined, zakharyas joined
Zoffix Or maybe that was only for CUI::FileSystem 16:38
16:39 Kyo91 joined
Zoffix Since April; no idea if it's just File or all repos: github.com/rakudo/rakudo/commit/ca...258905c715 16:41
ugexe it still gets used in creating a compiler or repo-id or some such
Zoffix Ah
16:42 Kyo91_ joined
ugexe nine was making progress in changing that so it could be reproducable 16:42
raiph .ask nine I just searched my comments mentioning "rakudobrew" and this seems to be my most recent: www.reddit.com/r/perl6/comments/6h...f/dj1bc4p/ Do you consider what I said there appropriate?
yoleaux raiph: I'll pass your message to nine.
ingy still, possible ironic quote of the year: "Zoffix | [Perl 6...] No magics at all." :) 16:43
16:43 Kyo91 left
tony-o ingy: meant to call you earlier this month but couldn't make it all the way up to seattle 16:44
now i'm driving to north dakota
ingy tony-o: bummer
some day
16:44 zakharyas left
Zoffix ingy: not ironic. I don't think there's much magics in Rakudo, at least compared to Perl 16:45
tony-o not with that attitude 16:46
Zoffix m: .say for flat {1 => 2, :42foo}, 3
camelia 1 => 2
foo => 42
3
Zoffix ^ notice how similar it is to your *@ slurpy results. No magics :)
ingy I still want it on a t-shirt 16:47
Zoffix haha :)
16:48 robertle joined 16:49 nadim_ joined
mspo geekosaur: not sure what to do about that 16:50
geekosaur: I guess linux supports it?
geekosaur linux does, *bsd and os x don't
mspo geekosaur: can I use moar directly in the #! line instead of sh + exec?
geekosaur probably? you could also try using env, since it's an executable 16:51
#!/usr/bin/env ...
16:52 Aaronepower left
Zoffix m: sub infix:<⁣> is assoc(<list>) { flip ~@_ }; say "scigam"⁣"on"⁣"si"⁣"erehT" 16:54
camelia There is no magics
Zoffix m: "84​104​101​114​101​32​105​115​32​110​111​32​109​97​103​105​99​115".comb(/\d+/)».chr.join.say 16:58
camelia There is no magics 16:59
Zoffix m: sub infix:<⁣> { [+] @_ }; say 2⁣2⁣2⁣2⁣2⁣2⁣2 17:00
camelia 14
Zoffix hehe. Good times.
17:00 Zoffix left 17:05 mr-foobar joined 17:08 wamba joined 17:11 nhywyll left
jdv79 Calling decode() will never work with declared signature ($str is copy) 17:13
what exactly is that saying?
oh, nevermind. read it wrong. 17:14
17:16 raschipi joined 17:19 cdg left 17:20 zakharyas joined 17:25 nhywyll joined, hoelzro joined 17:29 Cabanossi left 17:30 Cabanossi joined 17:44 mcmillhj left 17:48 mcmillhj joined
rindolf jdv79: hey! Long time. How are you? 17:54
18:01 MilkmanDan left 18:14 f0x joined
f0x hey, I'm trying to get a perl6 program to work, and it needs Readline, which I can't seem to get 18:15
18:19 zakharyas left
raschipi f0x: Which operating system are you using? 18:19
18:19 itaipu left 18:21 setty1 joined 18:26 sufrostico joined 18:28 GhostK left
[Coke] f0x: also, how are you trying to install Readline? 18:30
(also: what does "perl6 --version" say)
18:32 mcmillhj left
raschipi And does it need the development symbols? 18:38
18:42 Kyo91_ left 18:44 mcmillhj joined
f0x raschipi: Debian Sid, perl 6.c 18:45
raschipi What compiler version do you have ("perl6 --version")? 18:46
6.c is the version of the language. It's like GCC7 vs C89
f0x Rakudo 2017.06 MoarVM 2017.06 18:47
i've tried installing rakudo star from git, to get panda, but panda errors: No such method 'run-script' for invocant of type 'CompUnit::RepositoryRegistry' 18:48
raschipi panda is deprecated, zef took over 18:49
18:49 mcmillhj left
f0x just tried running zef, gives the exact same error 18:49
raschipi Can you get a pastie with the exact errors you're getting?
18:51 itaipu joined
f0x hastebin.com/cuyipereme.sql 18:53
18:53 Skarsnik joined 18:56 mcmillhj joined 18:59 jonathonf joined 19:01 mcmillhj left
ugexe look at the path names 19:01
19:03 jonathon left 19:05 darutoko left 19:06 lucasb joined 19:09 mcmillhj joined
lucasb possibly, the user arrived at some interaction between the Rakudo 2017.06 installation and the rakudo-star-2017.07 modules 19:11
19:12 mcmillhj left 19:13 raiph left 19:14 Kyo91_ joined 19:15 jonathonf left 19:21 mcmillhj joined 19:23 sufrostico left 19:25 sufrostico joined
raschipi Are you using rakudobrew? Where did you get zef from? 19:25
ugexe their PATH is not setup properly 19:26
19:27 silug joined, markmont joined, itaipu left 19:30 sufrostico left 19:32 sufrostico joined 19:41 zakharyas joined 19:42 Cabanossi left 19:44 Cabanossi joined 19:49 bwisti left 19:50 bwisti joined 19:54 itaipu joined
nadim_ Hi, do we have way to take rakudo, module, code, whatnot and make some archive/executable of it? 19:55
El_Che nadim_: no (although incidently I created a private repo yesterday to play with the idea) 19:56
(everything except rakudo though)
19:59 avalokite left
timotimo you're forgetting appimages 19:59
nadim_ El_Che: please let me/us know how far you get, I am contemplating re-writting an app and it is not just for the hard core P6 developpers that like to pull and compile every day
timotimo: I wrote "whatnot" ;) 20:00
El_Che nadim_: the cunning plan was to work on it during TPCiA
timotimo github.com/samcv/rakudo-appimage-m...automation - this might be the one
no i mean el che was forgetting the appimages
El_Che nadim_: for most of my "production" image I am well served by Docker, but I feel Docker/appimages/snaps are not enough 20:01
nadim_: kind of inspired by Go deps and Rust cargo tool
nadim_ what size docker do you get for a rakudo, some dependencies and some code?
El_Che no idea if it's workable, just though about the interface with the user 20:02
nadim_: smallish
200mb
nadim_ hohoho!
El_Che but I could get it around 30 I think
nadim_ ah
El_Che 200mb == debian/ubuntu + debs I build 20:03
(so no Rakudo Star, nor rakudobrew)
faster and smaller this way
30 == alpine
nadim_ I have a package in some distributions, not sure they would distribute a docker image,
I think I saw someone talking about rakudo being packaged
El_Che I have Ruby trouble (I use fpm to create pkgs) on alpine, so not there yet
nadim_: that was me 20:04
or the debian guys
github.com/nxadm/rakudo-pkg/releases/
nadim_ a relatively new rakudo? I mean, do they update often?
El_Che the distro debian pkg is integrated in Debian. Mine (debian/ubuntu/fedora/centos) are selfcontained in /opt/rakudo 20:05
I update for every release
nadim_ every week I find a bug and I pull, compile and voila magic fingers fixed it
good to know
El_Che the debian guys update often (they do a great job), but you need unstable to keep up
I target stable 20:06
nadim_ sounds like a good idea if you want some life
raschipi "stable" in debian means: "the offered features won't change", therefore it wouldn't be stable if they put new packages in there.
El_Che actually, funny story. My pkgs are just a byproduct of docker images I build the automate the pkgs creation
it was meant for sysadmins
nadim_ also good to know
El_Che but since I had the images, I create pkgs for users as well 20:07
I wanted rakudo in my containers and compiling each time was just too slow
nadim_ It's going to take months for me to re-write application, I need to finish the damned module that takes my time first then really kick my own ass to get started 20:08
timotimo nadim_: if your users are windows users you can use the WiX installer generator module for perl6
nadim_ compiling each time as updating rakudo in the container
timotimo: it's asciio, I doubt I have many windows users since the camel perl distributuin stopped working 20:09
20:10 Aaronepower joined
nadim_ meh! Terminal print seems broken for me: P6opaque: no such attribute '$!todo' in type List when trying to get a value 20:11
El_Che I think that a big problem for whatever tool is broken dependencies
zef does a great job but there isn't much it can do if the deps are broken 20:12
timotimo oh that's interesting, can you give exact rakudo version and --ll-exception backtrace?
El_Che in order to create a bundle I wanted to use zef to write all the deps in a dir and pkg that
nadim_ sure
El_Che and feed the pkg to the same tool
nadim_ timotimo: I had the feeling you'd like this error
El_Che that would unpack it and version it in ~/.perl6
and run it
3 commands: pack, unpack, run 20:13
nadim_ timotimo: This is Rakudo version 2017.07-98-g3e078d4 built on MoarVM version 2017.07-266-ged84a63
El_Che dunno if it make sense
timotimo moritz: there's typos on page 110 (the page that has the number 110 on the bottom, that is) where there's a ) missing and a superfluous (or just asymmetric) space between 42 and )
right at the top 20:14
nadim_ I think it makes sense to keep the dependencies separated by applications, never too sure
MasterDuke nadim_: i believe lizmat fixed that since your rakudo version
timotimo thankfully you can have multiple versions of the same thing installed in the same compunit repo 20:15
nadim_ since yesterday then ;) I'll check
timotimo as long as the version gets bumped properly for releases, that is
El_Che nadim_: I was thinkg of a dir with the app and its applications
anyway, just thinking out loud
nadim_ El_Che: good thinking
El_Che being so busy with other stuff, I fear it may be just talk :(
(hence just a private repo) 20:16
nadim_ El_Che: do it, do it! 20:17
El_Che nadim_: I need to submit a dessertation this year (not a student, but full time employed + 2 kids) 20:18
:)
mspo geekosaur: so I made a c program to use instead of the shell script for #!
El_Che life is a bitch with little time
nadim_ Amin Amin, been there but I need to do something with my head to keep sane (whatever little sane I usually am) 20:19
mspo ttps://gist.github.com/msporleder/62d5bbd5dda6dd23d81d83730e8c77de 20:20
20:20 AlexDaniel left
nadim_ MasterDuke: yes, it's fixed, what a 17 patches can make! 20:20
El_Che now, I am going to do the dish cleaner. To give you an idea, I also have a 7" tablet I watch stuff at the same time :)
20:20 AlexDaniel joined
El_Che bbl 20:20
20:25 espadrine joined, nattefrost left
lizmat decommute& 20:27
20:27 lizmat left
nadim_ someone over did the demo in Terminal::Print, good to see people still like to have fun 20:30
timotimo <3 20:31
nadim_ I am actually impressed. 20:39
where do we blog? some open blog that is perl oriented 20:41
mspo open blog? is that a thing? 20:45
20:47 andreoss joined 20:49 Zoffix joined
nadim_ haha, I also noticed that it soounded weird, I meant, but did not write, a blog that does not need me to sign 30 zillion forms and that does not suck. preferably one that takes pod as input but let's not dream :) 20:49
mspo nadim_: reddit? 20:50
raschipi reddit has a new blog feature, but it's written in their dialect of markdown.
Zoffix nadim_: do you mean starting your own blogging site or are you just looking for a place to blog about Perl? blogs.perl.org/ is what the cool kids use. No pod, but you can use Markdown
nadim_ I mean a place to publish a blog, let's see if I can be a cool kid. thanks 20:51
timotimo hmmm, poddown
nadim_ Zoffix: I can always write pod and transform to MD 20:52
timotimo pandoc probably can do that? 20:53
Zoffix nadim_: I guess... wouldn't MD be easier to write? :) 20:54
AlexDaniel moritz: unicode in irc logs plz :( 20:56
Zoffix moritz: yes, double plz
nadim_ nahh, been writting pod for 20 years, I am kinda used. and all the -------------------------- in MD makes me tired. Otherwise I like MD.
timotimo no need for the dashes btw :) 20:57
nadim_ See, I am so happy with pod i never took the time to master MD :)
I think half of I what I need to say I already have in pod, just being lazy 20:58
andreoss m: macro foo($h) { say $h.perl }; foo(foo); 20:59
camelia 5===SORRY!5=== Error while compiling <tmp>
Use of macros is experimental; please 'use experimental :macros'
at <tmp>:1
------> 3macro7⏏5 foo($h) { say $h.perl }; foo(foo);
20:59 mcmillhj left
andreoss m: use experimental :macros;macro foo($h) { say $h.perl }; foo(foo); 20:59
camelia 5===SORRY!5=== Error while compiling <tmp>
Too few positionals passed; expected 1 argument but got 0
at <tmp>:1
21:02 Zoffix left 21:07 skids left 21:08 itaipu left
andreoss m: use experimental :macros;macro foo(&block) { say &block.perl }; foo(->{...}); 21:08
camelia 5===SORRY!5=== Error while compiling <tmp>
Type check failed in binding to parameter '&block'; expected Callable but got AST (AST.new)
at <tmp>:1
21:11 Kyo91 joined 21:13 zakharyas left 21:14 Kyo91_ left 21:16 avalenn left 21:18 rindolf left 21:21 f0x left, raschipi left 21:23 geekosaur left 21:26 cpage_ left, geekosaur joined 21:32 markmont left 21:35 vendethiel left, Kyo91 left 21:40 nhywyll left 21:51 geekosaur left 21:52 geekosaur joined 21:54 dwimmy joined, wamba left
dwimmy Two Questions: what is the meaning of the construction "(++$); and why does this hang after the second statement? $ time perl6 -e 'no strict; @alist = {(++$)**2} ...Inf; say @alist[^10]; if 25 == any(@alist) { say "OK " } else { say "NG" }' (1 4 9 16 25 36 49 64 81 100) [hangs indefinitely] ^C ^C real 21m23.308s user 20m47.186s sys 0m4.167s 21:55
21:55 cpage_ joined, espadrine left
dwimmy Two Questions: what is the meaning of the construction "(++$); and why does this hang after the second statement? 21:56
$ time perl6 -e 'no strict; @alist = {(++$)**2} ...Inf; say @alist[^10]; if 25 == any(@alist) { say "OK " } else { say "NG" }'
(1 4 9 16 25 36 49 64 81 100) 21:57
[hangs indefinitely] ^C ^C
21:57 Cabanossi left
AlexDaniel dwimmy: hm, interesting. This is exactly what I would have expected, but I wonder if we can do better 21:57
dwimmy real 21m23.308s user 20m47.186s sys 0m4.167s 21:58
OK what do you suggest?
AlexDaniel dwimmy: so it hangs because it attempts to create any junction of an infinite amount of elements…
dwimmy: I think your understanding is that it would stop if it finds 25, correct?
dwimmy I can see that but it is able to print eg the first ten elements because "say" forces evaluation 21:59
yes correct
AlexDaniel but only of the first 10 elements
it's lazy
21:59 Cabanossi joined
dwimmy so what is the use of a lazy list especially an infinite one? 22:00
[back in 5 minutes]
AlexDaniel dwimmy: well, having an infinite list that is non-lazy has no uses for sure :) 22:02
22:03 markmont joined, Skarsnik_ joined
AlexDaniel but if it's lazy, then you can have on-demand generation of elements, which may be useful sometimes 22:03
that said, unless you're working with Seqs, you probably don't want to go too high :)
22:04 cpage_ left
dwimmy A lazy list is therefore a virtual list - the elements don't exist until they are evaluated? 22:04
here is another example:
no strict; 22:05
AlexDaniel well, yes, pretty much
dwimmy my @alist = {(++$)**2} ... Inf;
AlexDaniel dwimmy: about ++$, $ is simply an anonymous state variable
dwimmy @Ns = < 64 128 256 512 1024 2048 4096 8192 16384 31768 65536 >;
22:05 Kyo91 joined
AlexDaniel so you're using ++ prefix op on a state variable basically 22:05
dwimmy for (@Ns)
{
$uBound = $_.sqrt.Real.truncate + 1;
if $_ == any(@alist[^$uBound]) { say "$_\t== square" }; 22:06
22:06 Skarsnik left
dwimmy if $_ != any(@alist[^$uBound]) { say "$_\t!= square" }; 22:06
AlexDaniel dwimmy: you can write {state $foo; (++$foo)**2} instead, but arguably this is less readable 22:07
dwimmy }
22:07 mr-foobar left, cpage_ joined 22:08 kerframil left
AlexDaniel dwimmy: hm, so what's the question about this piece of code? :) 22:10
dwimmy Alex Daniel - I think I see. '$' is in some sense the topic, and ++$ means increment the topic, or whatever it is ??
Well it works with the infinite list whereare the other didn't
By setting an upper bound I can get it to evaluate everything up to that point - it doesn't try to eval everything 22:11
AlexDaniel dwimmy: well, not exactly. It's just an anonymous (doesn't have a name) state (retains its value across block executions) variable 22:12
dwimmy: yes, that :)
dwimmy By computing and setting an upper bound
But this is particular to this one piece of code - which deals with squares. 22:13
I am looking for a more general way to work with these type lists
It seems odd to me that the list seems to be implicitly ordered 22:14
AlexDaniel implicitly ordered?
dwimmy And the items in the list are always greater than the last
but the any function is not taking advantage of this fact
You start with a ordered sequence of integers, which is always increasing 22:15
And so the squares of those numbers are also increasing
AlexDaniel here's one thing to note 22:16
m: my @a = < a b c >; say any(@a) eq "b"
camelia any(False, True, False)
22:17 kerframil joined
AlexDaniel so operations with “any” junction don't just return True or False or whatever, all results are there even if you don't really need them 22:17
dwimmy That very good. Food for thought - it appears that any is required to evaluate the whole list.
with an infinite list it will go on working forever.
That answers my question 22:18
However what were you saying about Seqs? Hang the Punch and Judy on me ..
AlexDaniel but even if it didn't, it won't really help. Let's say there's is 25 in the list, it will go forever trying to find it
there is *no* 25 in the list* 22:19
dwimmy You're talking about the first prog - here is the listing again:
22:19 Zoffix joined
Zoffix How can I specify that I need WWW:ver('1.003001') or better as prereqs? 22:20
dwimmy $ time perl6 -e 'no strict; @alist = {(++$)**2} ...Inf; say @alist[^10]; if 25 == any(@alist) { say "OK " } else { say "NG" }'
(1 4 9 16 25 36 49 64 81 100)
Zoffix Or if I can't, how can I check its version from withing another module?
(and just die if it's too low)
dwimmy The second statement prints the first 10 elements
25 is the fifth element 22:21
22:21 kerframil left
dwimmy Anyone can tell me more about Seqs ? 22:21
BTW I'm looking for a good tutorial type site 22:22
AlexDaniel dwimmy: basically, Seqs produce values without storing them anywhere. See docs.perl6.org/type/Seq and maybe perl6.party/post/Perl-6-Seqs-Drugs...ock-n-Roll 22:23
dwimmy Perl6Maven and Perl6Advent both have limitations but are the best Ive found so far ..
Zoffix dwimmy: rakudo.party
AlexDaniel dwimmy: official docs are quite good also. For example: docs.perl6.org/language/list#Sequences 22:24
Zoffix dwimmy: second and third posts from the top talk about seqs
dwimmy Thank you alexD. I keep coming across that 2nd URL but I thought it was a joke
Zoffix :)
dwimmy Thanks
[back in 30 minutes]
El_Che marketeers :)
Zoffix :D
22:25 setty1 left 22:26 lucasb left
Zoffix dwimmy: though neither of the two Seqs and Dugs articles talk about `...` operator. That'll be in Part 3 that I hope to write next weekend. 22:29
(and the docs for it are barely there; which is why I set out to write the article in the first place)
AlexDaniel
.oO( why not write some docs instead? … )
22:32
22:33 lizmat joined
Zoffix Why not write an article first? 22:33
zengargoyle i sorta thought version could be :ver(some sort of range like thing that smart matches) 22:36
like :ver(v1.3 .. *) would be '1.003001' or above... 22:37
lizmat is back home and goes to bed 22:39
22:42 skids joined 22:43 Cabanossi left 22:44 Cabanossi joined 22:54 https_GK1wmSU joined
Zoffix HTTP::UserAgent-- (not setting User-Agent) GitHub-- (403ing stuff without User-Agent) WWW-- (not setting headers with get/jget reqs) 22:54
ryu0 did anyone already open a ubuntu ppa for rakudo? i'm not finding one. 22:56
Zoffix No idea
huggable: debs
huggable Zoffix, nothing found
Zoffix huggable: deb
huggable Zoffix, CentOS, Debian, Fedora and Ubuntu Rakudo packages: github.com/nxadm/rakudo-pkg/releases
Zoffix There are these packages tho
22:56 https_GK1wmSU left
ryu0 oh. 22:56
that works. 22:57
i was going to package it in a PPA if something didn't already exist.
23:01 Skarsnik_ left
Zoffix Solved my thing with `BEGIN WWW.^ver andthen $_ >= v1.004001 orelse die 'Need WWW.pm6 version 1.004001 or newer';` 23:02
Needed to add `unit module WWW:ver<1.004001>` for that to register tho
also, doing * >= v1.004001 instead borks 23:03
m: 42 andthen *.say
camelia 42
Zoffix m: .say with 42 andthen * >= 42
camelia True
Zoffix Oh, that might've been fixed already
zengargoyle i thought i saw recent issues regarding Version matching, but assume you probably read them. 23:04
Zoffix it was dying with "Cannot invoke this object (REPR: Null; VMNull)" and there was some commit fixing that somewher 23:05
23:06 TEttinger joined 23:10 andreoss left
zengargoyle i would expect that `unit module WWW;` would turn into `unit Module:ver<somever>:auth<someauth>:api<someapi>;` based on info from META6 at install if it wasn't already in the definition. 23:11
seems PITA to have to actually do that yourself for each versionable thing. 23:12
Zoffix yeah
zengargoyle i sorta hope it's just a NYI type of thing. 23:13
or there's some other explanation of why it's not a good idea.
Zoffix oops. Actually that `orelse` should be just `or` 23:16
nadim_ I blogged the latest changed to Data::Dump::Tree, +1600 -400 lines none of which would have happened without the invaluable help one gets here. 23:20
blogs.perl.org/users/nadim_khemir/2...on-15.html
23:22 dwimmy left 23:23 sena_kun left 23:25 BenGoldberg joined
nadim_ Zoffix: you use ddt to display some module meta data if I am right, last i saw it I noticed that there may be an option or two that could be used to make it look a tad nicer (and I mean a td) would you send me an example of the meta data so I can play with it? 23:28
timotimo nadim_: i wonder if it'd be sane to look at all entries in a (for example) list and see "they're all Int, so displaying .Int for every one fo them doesn't help so much" 23:30
lovely pictures in that post btw
and i appreciate the ddt shortcut 23:31
nadim_ timotimo: the entries are rendered individually so there little I can easilly do to remove the .Int, One can render the whole tree without type though 23:37
Zoffix buggable: help 23:38
buggable Zoffix, tags | tag SOMETAG | eco | eco Some search term | author github username | speed | testers CPANTesters report ID
nadim_ now I think about it, I think one can easilly write a filter for that and it can be applies very specifically.
Zoffix buggable: testers f878354a-6183-11e7-89a5-c5f577a92919
zengargoyle ouch, name collision with App::Ddt authoring tool... :)
Zoffix nadim_: it was that ^ 23:39
buggable: source
Stupid robot
nadim_ timotimo: wasn't it you who wanted to display a structure in a "window" then resume in your script?
Zoffix: they tend to be
buggable Zoffix, Cound not find that ID or API is down. Try manually: api.cpantesters.org/v3/report/f8783...f577a92919 23:40
Zoffix, See: github.com/zoffixznet/perl6-buggable
timotimo nadim_: yeah, i see you have it :)
AlexDaniel buggable: maybe you can learn something from your 10 siblings :)
Zoffix buggable: testers f878354a-6183-11e7-89a5-c5f577a92919
buggable Zoffix, Proc::Q:ver(1.001003) test result PASS. See more at temp.perl6.party/buggable/85726648...630857.txt
zengargoyle Cound 23:41
Zoffix nadim_: ^ there
nadim_ timotimo: I even wrote a role that generates folding data, that means that you could, in your text window, fold and unfold sub levels, evens search for specific values in the tree 23:42
23:42 Cabanossi left
nadim_ Zoffix: can I get the source data please? 23:42
Zoffix nadim_: api.cpantesters.org/v3/report/f8783...f577a92919 23:43
decode from json
23:45 Cabanossi joined
nadim_ Does JSON::Tiny give back a perl data structure or just a match structure? 23:45
Zoffix perl
nadim_ I give it a try
AlexDaniel m: my $x = 50; do { $x = 42; $x = ENTER $x; say $x } 23:47
camelia 42
AlexDaniel m: my $x = 50; do { $x = 42; $x = ENTER { my $temp = $x; $temp }; say $x }
camelia 50
AlexDaniel :S
23:47 andrzejku joined
AlexDaniel is it a bug or not? 23:48
23:48 andrzejku__ left
AlexDaniel definitely does not DWIM, unless I actually mean something else… 23:48
m: my $x = 50; do { $x = 42; $x = ENTER $x.clone; say $x } 23:49
camelia 50
Zoffix m: my $x := 50; do { $x := 42; $x := ENTER $x; say $x } 23:50
camelia 50
timotimo nadim_: i'm not sure i understand what that means exactly, but it sure sounds neat 23:51
nadim_ hahaha
it means, when you decide to display your dat, look at it, then continue in your script, the data being displayed can be folded, IE: you can say all the dta within this array collapse in a single line 23:52
timotimo so like if i iterate over a list of lists i can show only the "current" inner list by default 23:54
if i dump it multiple times in a row
AlexDaniel it seems like I need “temp”, so nvm, but still it would be great to know if ENTER is supposed to work like that 23:55
m: my $x = 50; do { $x = 42; $x = ENTER +$x; say $x } 23:56
camelia 50
AlexDaniel I think I've seen this kind of “trap” or whatever that is previously
nadim_ timotimo: if you dump a list of list of list (just for the fun) you can say, collapse everything, you get a single line, your top list, you can say exapand that line, you'll see the entries in the top list, then you can chose one of the sub list, which are right now a single line, and chose to expand it. 23:57
timotimo: you could also chose a sub list and get only that sub list displayed in another window, or beside the first data structure 23:58
timotimo: there is also the possibility to show the diff between two data structures, those do not support folding unfortunately but it should be possible with some heroic efforts 23:59