Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-08-01

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:00 buggable ???????????? It's time for the monthly Accidental /win Lottery ???????????? We have 1 ballots submitted by 1 users! DRUM ROLL PLEASE!...
00:00 buggable And the winning number is 23! Congratulations to jnthn! You win a can of WD40!
00:00 tony-o woop woop
00:01 mcmillhj joined #perl6
00:02 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 #perl6
00:08 vendethiel joined #perl6
00:10 aindilis` joined #perl6
00:16 mcmillhj joined #perl6
00:18 vendethiel- joined #perl6
00:20 lookatme joined #perl6
00:21 lookatme morning
00:25 hythm joined #perl6
00:33 * zengargoyle all hail jnthn slayer of ... things.
00:37 lookatme Hmm, anyone know the last week report link?
00:39 geekosaur [31 21:22:26] <lizmat> and another Perl 6 Weekly hits the Net: https://p6weekly.wordpress.com/2017/07/31/2017-31-moar-smaller/
00:40 lookatme geekosaur, yeah, that's it, thanks
00:45 Cabanossi joined #perl6
00:51 mcmillhj joined #perl6
00:52 aindilis joined #perl6
01:12 zengargoyle lizmat++ has is default
01:22 mcmillhj joined #perl6
01:30 jeromelanteri joined #perl6
01:34 astj joined #perl6
01:40 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.
01:40 yoleaux 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:50 https_GK1wmSU joined #perl6
01:50 https_GK1wmSU left #perl6
01:51 ilbot3 joined #perl6
01:51 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
01:53 astj joined #perl6
01:54 mcmillhj joined #perl6
02:11 astj joined #perl6
02:21 cpage_ joined #perl6
02:26 skids joined #perl6
02:29 vendethiel joined #perl6
02:33 mcmillhj joined #perl6
02:41 MasterDuke joined #perl6
02:47 audiatorix joined #perl6
02:48 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:52 noganex_ joined #perl6
03:01 Cabanossi joined #perl6
03:03 lookatme audiatorix, get a Supply on Channel ?
03:04 lookatme 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 rakudo-moar 7fdbb4: OUTPUT: «GOT 0|GOT 1|GOT 2|GOT 3|GOT 4|GOT 5|GOT 6|GOT 7|GOT 8|GOT 9|»
03:05 lookatme m: my Channel $ch .= new; $ch.Supply.tap( { say $_; } ); ^10 .map({$ch.send($_)}); $ch.close()
03:05 camelia rakudo-moar 7fdbb4: OUTPUT: «0?1?»
03:05 lookatme m: my Channel $ch .= new; $ch.Supply.tap( { say $_; } ); ^10 .map({$ch.send($_)}); $ch.close(); sleep 1;
03:05 camelia rakudo-moar 7fdbb4: OUTPUT: «0?1?2?3?4?5?6?7?8?9?»
03:05 lookatme Last one need sleep.
03:07 audiatorix ah okay that works
03:07 audiatorix thanks
03:08 lookatme audiatorix, or use poll, non-blocking receive method
03:08 lookatme There is a example about poll: https://docs.perl6.org/type/Channel#method_poll
03:08 lookatme ^^ audiatorix
03:08 lookatme s/a/an/
03:09 audiatorix Hmm, looks like I might be able to just use a Supply in the first place
03:10 audiatorix 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 audiatorix But the processing needs to be decoupled from the receiving/sending
03:11 audiatorix So it seems like Channel is appropriate
03:11 audiatorix but maybe Supply works?
03:13 audiatorix Am I right in saying that the two are the same other than the way they spit out values?
03:15 [Coke] ff
03:24 lookatme audiatorix, yeah, I think both works, you maybe need some flag mark the message and return value
03:29 Cabanossi joined #perl6
03:36 zakame joined #perl6
03:38 Geth ¦ doc: fdcab66da7 | (Will "Coke" Coleda)++ | 2 files
03:38 Geth ¦ doc: test Perl 6 code in python page
03:38 Geth ¦ doc:
03:38 Geth ¦ doc: Part of #1387
03:38 Geth ¦ doc: review: https://github.com/perl6/doc/commit/fdcab66da7
03:49 Geth ¦ doc: a51de99156 | (Will "Coke" Coleda)++ | 2 files
03:49 Geth ¦ doc: test the code in phasers doc.
03:49 Geth ¦ doc:
03:49 Geth ¦ doc: Part of #1387
03:49 Geth ¦ doc: review: https://github.com/perl6/doc/commit/a51de99156
04:04 raschipi joined #perl6
04:13 Geth ¦ doc: 78b789ceb4 | (Will "Coke" Coleda)++ | 2 files
04:13 Geth ¦ doc: Run the few p6 tests we can on modules.pod6
04:13 Geth ¦ doc:
04:13 Geth ¦ doc: Part of #1387
04:13 Geth ¦ doc: review: https://github.com/perl6/doc/commit/78b789ceb4
04:13 Geth ¦ doc: d357d88ecc | (Will "Coke" Coleda)++ | doc/Language/rb-nutshell.pod6
04:13 Geth ¦ doc: ... exports are cumulative in the test suite.
04:13 Geth ¦ doc:
04:13 Geth ¦ doc: This is a bug, but skip this for now.
04:13 Geth ¦ doc:
04:13 Geth ¦ doc: Part of #1387
04:13 Geth ¦ doc: review: https://github.com/perl6/doc/commit/d357d88ecc
04:23 zakame joined #perl6
04:37 ryu0 I'm considering learning Perl6. The books I thought looked interesting aren't released yet. Any suggestions for where I should start?
04:38 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 #perl6
04:39 raschipi What do you know? There are texts targeted at people comming from specific languages...
04:40 ryu0 In order of familiarity? C, Shell, AWK, C++, ...
04:40 ryu0 Though i also did a fair amount of reading on functional, namely the languages Common Lisp and SML.
04:41 ryu0 No prior perl experience.
04:41 ryu0 I did some dabbling with Tcl and Python though...
04:42 raschipi Perl is a mashup of C, shell, AWK and C++, mostly. So it won't be a strange language.
04:42 raschipi Can you run a program already? Hello world is just:
04:42 ryu0 Lisp is the strangest language I ever tried to use.
04:42 raschipi m: say "Hello World!"
04:42 camelia rakudo-moar 7fdbb4: OUTPUT: «Hello World!?»
04:43 ryu0 Huh. Reminds me of REXX.
04:43 raschipi Do you have rakudo installed?
04:43 ryu0 raschipi: no, but I can probably get something installed.
04:44 raschipi Start here, then: http://perl6intro.com/
04:44 ryu0 i have a background with Linux packaging.
04:44 ryu0 mostly how I became so familiar with shell scripts. haha
04:44 ryu0 hm.
04:45 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...
04:45 ryu0 not including mastery of the standard library though.
04:45 ryu0 just the language if anything.
04:45 raschipi The reference is here: http://docs.perl6.org/
04:46 ryu0 Ok. Thank you.
04:46 raschipi It's not complete, devs are still working on it.
04:47 raschipi The type reference is almost more important than the language reference.
04:47 ryu0 Does the static typing also apply to user defined types?
04:47 ryu0 The samples I saw only showed it with what looked like builtin/primitive types.
04:48 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.
04:49 ryu0 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:52 raschipi Look at the Int definition in Rakudo: https://github.com/rakudo/rakudo/blob/nom/src/core/Int.pm
04:52 ryu0 m: 2.WHAT;
04:52 camelia rakudo-moar 7fdbb4: ( no output )
04:52 ryu0 m: say 2.WHAT;
04:52 camelia rakudo-moar 7fdbb4: OUTPUT: «(Int)?»
04:53 raschipi Except for the nqp, it's just a normal calss. Same for Arrays, Hashes, etc.
04:53 ryu0 Lisp style return values?
04:54 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.
04:55 raschipi Yes, important for lambdas
04:55 raschipi Or can be done explicitly
04:55 ryu0 I saw that first attributed to Lisp, but maybe someone else was first.
04:57 zakame joined #perl6
04:59 raschipi That comes from RPN, or any other stack based processing
05:00 raschipi There's nowhere to put values, so they are pushed into the stack. The caller can then pop it.
05:04 raschipi Makes sense?
05:06 raschipi ryu0: Reuired reding from the docs: https://docs.perl6.org/type/Signature https://docs.perl6.org/type/Capture
05:06 lookatme :)
05:06 raschipi s/Reuired/Required/
05:10 lookatme https://perl6.org/resources/  Also, there are some learn resources
05:17 https___GK1wmSU joined #perl6
05:17 https__GK1wmSU joined #perl6
05:20 https___GK1wmSU left #perl6
05:20 https__GK1wmSU left #perl6
05:21 xtreak joined #perl6
05:29 Cabanossi joined #perl6
05:33 b2gills m: my %distribution = a=> 0.3, b=> 0.4, c=>0.1, d=>0.2; say %distribution.Mix.roll
05:33 camelia rakudo-moar 7fdbb4: OUTPUT: «Type check failed in binding; expected Int but got Rat (0.2)?  in block <unit> at <tmp> line 1??»
05:34 b2gills I'm fairly sure Mix.roll used to work
05:35 raschipi committable6: help
05:35 committable6 raschipi, Like this: committable6: f583f22,HEAD say ‘hello’; say ‘world’ # See wiki for more examples: https://github.com/perl6/whateverable/wiki/Committable
05:36 raschipi committable6: f583f22,HEAD my %distribution = a=> 0.3, b=> 0.4, c=>0.1, d=>0.2; say %distribution.Mix.roll
05:37 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:38 avalenn joined #perl6
05:38 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, https://gist.github.com/713f2398cc18871a02cf0a01f931a412
05:39 raschipi b2gills: Yep, used to work
05:47 Geth ¦ ecosystem: YellowApple++ created pull request #355: Add GLFW to ecosystem
05:47 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/pull/355
05:50 wamba joined #perl6
06:11 avalokite joined #perl6
06:12 avalenn joined #perl6
06:18 lowbro joined #perl6
06:18 lowbro joined #perl6
06:29 wigner joined #perl6
06:30 faraco joined #perl6
06:43 faraco joined #perl6
06:46 nadim_ joined #perl6
06:50 Geth ¦ ecosystem: 6c7f447424 | (Ryan S. Northrup)++ (committed using GitHub Web editor) | META.list
06:50 Geth ¦ ecosystem: Add GLFW to ecosystem
06:50 Geth ¦ ecosystem:
06:50 Geth ¦ ecosystem: I'm new to this whole Perl 6 module thing.  Please forgive me for anything I might've missed procedure-wise.
06:50 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/6c7f447424
06:50 Geth ¦ ecosystem: fd9e3c90c3 | lizmat++ (committed using GitHub Web editor) | META.list
06:50 Geth ¦ ecosystem: Merge pull request #355 from YellowApple/patch-1
06:50 Geth ¦ ecosystem:
06:50 Geth ¦ ecosystem: Add GLFW to ecosystem
06:50 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/fd9e3c90c3
06:52 * lizmat clickbaits https://p6weekly.wordpress.com/2017/07/31/2017-31-moar-smaller/
06:59 * timotimo read it and can recommend
07:02 rindolf joined #perl6
07:14 Cabanossi joined #perl6
07:20 mniip_ joined #perl6
07:22 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:23 faraco m: say 10 / 3
07:23 camelia rakudo-moar 7fdbb4: OUTPUT: «3.333333?»
07:23 faraco say 0.49 - 232
07:23 evalable6 faraco, rakudo-moar 7fdbb49cc: OUTPUT: «-231.51»
07:23 faraco m: say 0.49 - 232
07:23 camelia rakudo-moar 7fdbb4: OUTPUT: «-231.51?»
07:23 faraco m: say .3 + .282
07:23 camelia rakudo-moar 7fdbb4: OUTPUT: «0.582?»
07:24 darutoko joined #perl6
07:24 faraco m: say (2/9  + 1/3 * 2 / 12).perl;
07:24 camelia rakudo-moar 7fdbb4: OUTPUT: «<5/18>?»
07:25 jaldhar joined #perl6
07:26 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 jeromelanteri zengargoyle,
07:30 lizmat https://www.reddit.com/r/perl/comments/6qsv6k/how_many_people_plan_to_move_to_perl_6/   # comments welcome  :-)
07:35 zakharyas joined #perl6
07:58 ChoHag joined #perl6
07:59 wamba joined #perl6
07:59 Cabanossi joined #perl6
08:03 jonas3 joined #perl6
08:06 xtreak joined #perl6
08:10 dakkar joined #perl6
08:20 domidumont joined #perl6
08:26 zakharyas joined #perl6
08:26 jeromelanteri what: |@x ?@x does ? i mean... what ? and | want to do when you see them in front of @x ?
08:26 evalable6 jeromelanteri, rakudo-moar 15b2596e3: OUTPUT: «(exit code 1) ===SORRY!=== Error while compiling /tmp/XxP9KugSMC?Variable '@x' is not declared?at /tmp/XxP9KugSMC:1?------> |?@x ?@x does ? i mean... what ? and | wan»
08:26 bisectable6 jeromelanteri, On both starting points (old=2015.12 new=15b2596) the exit code is 1 and the output is identical as well
08:26 bisectable6 jeromelanteri, Output on both points: «===SORRY!=== Error while compiling /tmp/L0wIqTeT5a?Variable '@x' is not declared?at /tmp/L0wIqTeT5a:1?------> |?@x ?@x does ? i mean... what ? and | wan»
08:26 committable6 jeromelanteri, ¦6c (21 commits): «===SORRY!=== Error while compiling /tmp/704LwR9kbu?Variable '@x' is not declared?at /tmp/704LwR9kbu:1?------> |?@x ?@x does ? i mean... what ? and | wan «exit code = 1»»
08:27 jeromelanteri hi hi
08:27 jeromelanteri show_me: my @x = <a b c d e f>; say |@x;
08:27 jeromelanteri m: my @x = <a b c d e f>; say |@x;
08:27 camelia rakudo-moar 15b259: OUTPUT: «abcdef?»
08:28 jeromelanteri m: my @x = <a b c d e f>; say ?@x;
08:28 camelia rakudo-moar 15b259: OUTPUT: «True?»
08:28 lizmat m: my @a = <a b c d e f>; dd @a; dd |@a
08:28 camelia rakudo-moar 15b259: OUTPUT: «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"?»
08:28 jeromelanteri m: my @x = <a>; say ?@x;
08:28 camelia rakudo-moar 15b259: OUTPUT: «True?»
08:28 jeromelanteri m: my @x = <>; say ?@x;
08:28 camelia rakudo-moar 15b259: OUTPUT: «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 lizmat jeromelanteri: prefix | is the same as .Slip
08:29 jeromelanteri and... what is slip ?
08:29 astj joined #perl6
08:29 astj joined #perl6
08:29 zengargoyle m: my @x = < a b c >; my @y; @y.push: @x; say @y.perl; @y.push: |@x; say @y;
08:29 camelia rakudo-moar 15b259: OUTPUT: «[["a", "b", "c"],]?[[a b c] a b c]?»
08:29 Cabanossi joined #perl6
08:30 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).
08:30 lizmat jeromelanteri: see https://docs.perl6.org/type/Slip
08:30 zengargoyle m: my @x = < a b c >; my @y; @y.push: @x; say @y.perl; @y.push: |@x; say @y.perl;
08:30 jeromelanteri so it is like .append for add a list to an other one list ?
08:30 camelia rakudo-moar 15b259: OUTPUT: «Resource temporarily unavailable»
08:30 camelia rakudo-moar 15b259: OUTPUT: «[["a", "b", "c"],]?[["a", "b", "c"], "a", "b", "c"]?»
08:31 jeromelanteri and ? is it for check if empty list or not ?
08:31 jeromelanteri é?é
08:31 jeromelanteri ?@x
08:31 lizmat ? boolifies
08:31 lizmat its like !! in perl 5
08:31 jeromelanteri ok
08:32 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;
08:32 camelia rakudo-moar 15b259: OUTPUT: «[["a", "b", "c"],]?[["a", "b", "c"], "a", "b", "c"]?True?True?False?»
08:33 jeromelanteri ok
08:33 zengargoyle note second push did 3 items of @x, first push pushed whole @x as a single array.
08:34 jeromelanteri i see
08:35 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 zengargoyle perl 6 without the | would be like perl 5 foo(\%hash) foo(\@array) to pass as single item.
08:38 jeromelanteri zengargoyle, https://github.com/nicqrocks/p6-Git-Wrapper/blob/master/lib/Git/Wrapper.pm6
08:39 jeromelanteri method log has 2 arguments...
08:39 jeromelanteri yes ?
08:39 jeromelanteri https://github.com/nicqrocks/p6-Git-Wrapper but in the example, there is not.
08:41 jeromelanteri 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')
08:42 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.
08:42 jeromelanteri so it is optional arguments?
08:43 jeromelanteri it can be bothing.
08:44 zengargoyle pretty much.  things inside function () are a little different meaning then outside.
08:45 zengargoyle you can only have one *@ and one *%.   the *% gets all foo=>'bar' or :foo('bar') or just :foo     type arguments.
08:45 zengargoyle the *@ one 'slurps' up everything else...
08:46 jeromelanteri ok
08:47 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 vendethiel joined #perl6
08:49 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 zengargoyle something like that.
08:51 lookatme notice that foo => "bar" is a Pair
08:51 lookatme not a named argument
08:51 zengargoyle method run($subcommand, *@positionals, *%named)   -- better names for arguments in this function, writer got lazy and used *@p and *%n in log() :)
08:51 jeromelanteri i'm trying to find how to see logs from a remote if you are not in a git directory.
08:51 lookatme so *%args won't work with (foo => "bar")
08:51 jeromelanteri --remotes option works, but from local git repo
08:52 zengargoyle really?
08:52 lookatme you have to write (:foo<bar>)
08:52 lookatme yeah
08:52 lookatme I found it when make my module
08:53 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")
08:53 camelia rakudo-moar 15b259: ( no output )
08:53 lookatme m: sub f(*%args) { say %args.WHAT; }; f(foo => "bar")
08:53 camelia rakudo-moar 15b259: OUTPUT: «(Hash)?»
08:53 lookatme m: sub f(*%args) { say %args.WHAT; }; f(foo => "bar", fooz => "zyx")
08:53 camelia rakudo-moar 15b259: OUTPUT: «(Hash)?»
08:53 lookatme HMM ?
08:54 zengargoyle m: sub f(*%args) { say %args.foo; }; f(foo => "bar", fooz => "zyx")
08:54 camelia rakudo-moar 15b259: OUTPUT: «No such method 'foo' for invocant of type 'Hash'?  in sub f at <tmp> line 1?  in block <unit> at <tmp> line 1??»
08:54 lookatme It is not working on my pc
08:54 zengargoyle m: sub f(*%args) { say %args<foo>; }; f(foo => "bar", fooz => "zyx")
08:54 camelia rakudo-moar 15b259: OUTPUT: «bar?»
08:55 zengargoyle m: sub f(:$fooz, *%args) { say %args<foo>; say $fooz; }; f(foo => "bar", fooz => "zyx")
08:55 camelia rakudo-moar 15b259: OUTPUT: «bar?zyx?»
08:55 lookatme Oh, i know
08:55 lookatme it's "foo" => "bar"
08:55 lookatme m: sub f(*%args) { say %args.WHAT; }; f("foo" => "bar")
08:55 camelia rakudo-moar 15b259: OUTPUT: «Too many positionals passed; expected 0 arguments but got 1?  in sub f at <tmp> line 1?  in block <unit> at <tmp> line 1??»
08:55 lookatme yeah, not foo => "baz", sorry
08:56 zengargoyle ah, yeah.  one of *those* types of gotcha...
08:58 lookatme But according the document https://docs.perl6.org/type/Pair#index-entry-%3D%3E_
08:58 lookatme :foo<baz> is same as "foo" => "baz"
08:58 lookatme m: sub f(*%args) { say %args.WHAT; }; f(:foo<bar>)
08:58 camelia rakudo-moar 15b259: OUTPUT: «(Hash)?»
08:59 nadim_ joined #perl6
08:59 zengargoyle m: sub f(*%args) { say %args.WHAT; }; f("foo" => "bar",)
08:59 camelia rakudo-moar 15b259: OUTPUT: «Too many positionals passed; expected 0 arguments but got 1?  in sub f at <tmp> line 1?  in block <unit> at <tmp> line 1??»
08:59 zengargoyle m: sub f(*%args) { say %args.WHAT; }; f("foo" => "bar", "fooz" => "bar")
08:59 camelia rakudo-moar 15b259: OUTPUT: «Too many positionals passed; expected 0 arguments but got 2?  in sub f at <tmp> line 1?  in block <unit> at <tmp> line 1??»
08:59 lookatme And also, IDK what the different between foo => "baz" and "foo" => "baz"
08:59 lookatme I guess this is a bug
09:00 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 #perl6
09:00 camelia rakudo-moar 15b259: OUTPUT: «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)
09:00 camelia rakudo-moar 15b259: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>?Undeclared routine:?    bar used at line 1. Did you mean 'VAR', 'bag'???»
09:01 lookatme m: sub f(*@ps) { say @ps>>.WHAT; }; f(foo => "bar")
09:01 camelia rakudo-moar 15b259: OUTPUT: «Unexpected named argument 'foo' passed?  in sub f at <tmp> line 1?  in block <unit> at <tmp> line 1??»
09:01 lookatme m: sub f(*@ps) { say @ps>>.WHAT; }; f("foo" => "bar")
09:01 camelia rakudo-moar 15b259: OUTPUT: «(Array)?»
09:01 lookatme m: sub f(*@ps) { say @ps>>.&WHAT; }; f("foo" => "bar")
09:01 camelia rakudo-moar 15b259: OUTPUT: «[(Pair)]?»
09:01 lookatme m: sub f(*@ps) { say @ps>>.&WHAT; }; f(foo => "bar")
09:01 camelia rakudo-moar 15b259: OUTPUT: «Unexpected named argument 'foo' passed?  in sub f at <tmp> line 1?  in block <unit> at <tmp> line 1??»
09:02 lookatme I am confused
09:03 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 faraco left #perl6
09:03 lookatme Or they just different in sub call ?
09:04 lookatme m: my \x = foo => "baz"; say x.WHAT;
09:04 camelia rakudo-moar 15b259: OUTPUT: «(Pair)?»
09:04 lookatme m: my \x = "foo" => "baz"; say x.WHAT;
09:04 camelia rakudo-moar 15b259: OUTPUT: «(Pair)?»
09:04 lookatme m: my \x = :foo<baz>; say x.WHAT;
09:04 camelia rakudo-moar 15b259: OUTPUT: «(Pair)?»
09:04 zengargoyle i sort of remember somebody explaining this to me once long ago... but don't remember the details. :/
09:05 xtreak joined #perl6
09:05 lookatme I would said, this is not a consistency design.
09:05 lookatme OH
09:14 zengargoyle m: sub foo(:$foo,*@p) { say $foo; say @p; }; foo("foo"=>"bar");
09:14 camelia rakudo-moar 15b259: OUTPUT: «(Any)?[foo => bar]?»
09:14 zengargoyle m: sub foo(:$foo,*@p) { say $foo; say @p; }; foo(foo=>"bar");
09:14 camelia rakudo-moar 15b259: OUTPUT: «bar?[]?»
09:15 Cabanossi joined #perl6
09:15 zengargoyle m: sub foo(:$foo,*@p) { say $foo; say @p; }; foo((foo=>"bar"));
09:15 camelia rakudo-moar 15b259: OUTPUT: «(Any)?[foo => bar]?»
09:15 zengargoyle ^^ that's how you pass a foo=>"bar" but have it not be considered a named parameter....
09:17 lookatme yeah, that's what I mean, they should document that
09:18 eliasr joined #perl6
09:19 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:21 zengargoyle 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.
09:24 lookatme m: say 2(1);
09:24 camelia rakudo-moar 15b259: OUTPUT: «No such method 'CALL-ME' for invocant of type 'Int'?  in block <unit> at <tmp> line 1??»
09:24 lookatme m: say :2(1);
09:24 camelia rakudo-moar 15b259: OUTPUT: «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??»
09:26 zengargoyle i think that's a repurosing of an invalid thing into something useful.
09:26 kimmyleo joined #perl6
09:26 zengargoyle *repurposing
09:27 lookatme yeah, but not friendly to newbie
09:27 cpage_ joined #perl6
09:28 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
09:28 zengargoyle and :42nd *could* be '42nd' => True
09:29 lookatme zengargoyle, Hmm
09:31 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:32 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:33 * zengargoyle thinks that's probably wrong... :)
09:45 zakharyas joined #perl6
09:45 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:46 lookatme Hmm, I know that is construct a Pair
09:47 zengargoyle and foo => "bar" is fixed at compile time.  well the key part..
09:48 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:49 jnthn "foo" => "bar" isn't a syntactic identifier, (foo => "bar") isn't directly in the argument list, nor is (:foo<bar>)
09:50 jnthn foo => "bar" and :foo("bar") are equivalent and, both have a key that is a syntactic identifier
09:53 zengargoyle does :ident<foo> promote to "ident"=>"foo" outside of an argument list.
09:55 jnthn That's the wrong way round
09:56 jnthn 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?
09:57 zengargoyle ah, *nods*
09:57 jnthn :2nd is just :nd(2)
09:57 zengargoyle why not "2nd" => "True"
09:57 zengargoyle because not identifier?
09:58 jnthn Also because it'd not be very useful
09:58 jnthn Imagine trying to implement s:2nd/foo/bar/
09:58 zengargoyle that too...
09:58 jnthn Would have to take a slurpy hash and try to parse the number out of it
10:00 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
10:00 lookatme off work now
10:01 jnthn Yeah, anything non-identifier after it is a special form
10:11 * zengargoyle puts sytatic identifier on the list of things.
10:14 Cabanossi joined #perl6
10:25 mr-foobar joined #perl6
10:27 xtreak joined #perl6
10:28 xtreak joined #perl6
10:45 xtreak joined #perl6
10:47 notbenh joined #perl6
10:47 xtreak_ joined #perl6
10:50 someuser joined #perl6
10:56 cpage__ joined #perl6
10:59 Cabanossi joined #perl6
11:15 robertle joined #perl6
11:15 lizmat I need inspiration for a Perl 6 presentation
11:16 lizmat 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)
11:16 camelia rakudo-moar 15b259: OUTPUT: «42?{bar => 25, baz => 50}?»
11:16 AlexDaniel m: sub foo($x) { say $x; say %_ }; foo(42, :25bar, :50baz)
11:16 camelia rakudo-moar 15b259: OUTPUT: «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?»
11:16 sjn lizmat: "The speed nut's guide to making Perl 6 run faster"
11:16 AlexDaniel why is it different? ?
11:17 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:18 lizmat sjn: well, there's my dilemma
11:18 lizmat I'm cheating all of the time by using nqp
11:18 lizmat I'm not sure we want to have that wind up in user land minds
11:18 lizmat :-)
11:19 sjn lizmat: no worries; tell people how to cheat well. the goal is to create more people who can participate in the work :)
11:20 sjn participate in a positive way, that is.
11:20 sjn no point in teaching people how to leave behind a mess
11:20 Zoffix joined #perl6
11:21 Zoffix AlexDaniel: because methods already have %_
11:21 Zoffix lizmat: "The Iterables of Rakudo"
11:25 lizmat hmmm
11:26 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:27 Zoffix In Rakudo, you Do The Right thing by default
11:27 Zoffix "The 3 most important things missing from Perl 6?": https://www.reddit.com/r/perl/comments/6qvf55/the_3_most_important_things_missing_from_perl_6/?utm_content=title&amp;utm_medium=hot&amp;utm_source=reddit&amp;utm_name=perl
11:29 Cabanossi joined #perl6
11:32 tbrowder m: say 'a'.chr
11:32 camelia rakudo-moar 15b259: OUTPUT: «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??»
11:32 Zoffix .chr convers from number to character; you likely want .ord
11:32 timotimo m: say 'a'.ord
11:32 camelia rakudo-moar 15b259: OUTPUT: «97?»
11:33 tbrowder say '00110011'.chr
11:33 evalable6 tbrowder, rakudo-moar 15b2596e3: OUTPUT: «????»
11:34 Zoffix m: say +'00110011'
11:34 camelia rakudo-moar 15b259: OUTPUT: «110011?»
11:35 moritz m: say :2('00110011')
11:35 camelia rakudo-moar 15b259: OUTPUT: «51?»
11:35 tbrowder m: say '01100110'.chr
11:35 camelia rakudo-moar 15b259: OUTPUT: «?????»
11:35 Zoffix Looks like another item for my inconsistencies doc. .chr takes a Str and converts it to Numeric, but
11:35 Zoffix base doesn't
11:37 moritz m: say 42.base('2')
11:37 camelia rakudo-moar 15b259: OUTPUT: «101010?»
11:38 tbrowder m: say '00110011'.chr
11:38 camelia rakudo-moar 15b259: OUTPUT: «?????»
11:38 Zoffix m: say '42'.base: 2
11:38 camelia rakudo-moar 15b259: OUTPUT: «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??»
11:38 Zoffix tbrowder: it's not parsing it as base 2 number. Just a normal decimal
11:39 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
11:40 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
11:40 Zoffix tbrowder: .parse-base(2).chr
11:40 moritz m: $string = '11011'; say :2($string)
11:40 camelia rakudo-moar 15b259: OUTPUT: «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)?»
11:40 moritz m: my $string = '11011'; say :2($string)
11:40 camelia rakudo-moar 15b259: OUTPUT: «27?»
11:40 moritz m: my $string = '11011'; say :2($string); say :2($string).chr
11:40 camelia rakudo-moar 15b259: OUTPUT: «27��»
11:40 moritz m: my $string = '111011'; say :2($string); say :2($string).chr
11:41 camelia rakudo-moar 15b259: OUTPUT: «59?;?»
11:42 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 Zoffix like .parse-base I mentioned above
11:42 Zoffix m: '111011'.parse-base(2).chr.say
11:42 camelia rakudo-moar 15b259: OUTPUT: «;?»
11:43 tbrowder m: say :2('01000100').chr
11:43 camelia rakudo-moar 15b259: OUTPUT: «D?»
11:43 nattefrost joined #perl6
11:43 tbrowder thanks all!
11:44 Zoffix m: my $string = '0xDEADBEEF'; say :2($string)
11:44 camelia rakudo-moar 15b259: OUTPUT: «3735928559?»
11:44 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.
11:45 Zoffix Ah
11:45 lizmat Something like "2.5 years of Perl 6 Weekly"
11:45 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
11:45 Zoffix :D
11:45 Zoffix Yeah, sounds interesting.
11:45 zengargoyle lizmat: yeah, that-ish i guess. :)
11:46 Zoffix left #perl6
11:47 lizmat "A Gross Of Perl 6 Weeklies"
11:47 tbrowder m: my $s = "01000100_01000100".parse-base(2).chr
11:47 camelia rakudo-moar 15b259: ( no output )
11:49 tbrowder m: my $s="01000100";say $s.parse-base(2).str
11:49 camelia rakudo-moar 15b259: OUTPUT: «No such method 'str' for invocant of type 'Int'. Did you mean 'Str'??  in block <unit> at <tmp> line 1??»
11:50 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:51 zengargoyle 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
11:51 camelia rakudo-moar 15b259: OUTPUT: «D?68?»
11:53 tbrowder m: say 68.chr
11:53 camelia rakudo-moar 15b259: OUTPUT: «D?»
11:54 tbrowder m: say 68.Str
11:54 camelia rakudo-moar 15b259: OUTPUT: «68?»
11:58 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
11:59 moritz Perl 6 syntax *is* complex (unfortunately for syntax hilighting)
12:01 jeromelanteri moritz, if i can, you can...
12:02 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.
12:02 jeromelanteri zengargoyle, vim 8 is fast... but depend of plugins you add also.
12:02 AlexDaniel perl6-mode in emacs does not feel slow at all
12:05 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:07 zengargoyle and i have a new laptop since then, so maybe it's just fast enough i wouldn't notice. :)
12:08 araraloren joined #perl6
12:10 Aaronepower Cloning the latest vim-perl6 seemed to help a bit. https://github.com/vim-perl/vim-perl6
12:11 jeromelanteri what is the "best" way to remove a key/value pair from a hash ?
12:11 jeromelanteri or inside a hash
12:12 jnthn %hash<key>:delete (or %hash{$key}:delete) probably
12:12 jeromelanteri perfect thank you jnthn
12:12 AlexDaniel joined #perl6
12:16 jeromelanteri no such method delete jnthn.. nevermind, i'm going to search in the api of hash
12:16 vendethiel joined #perl6
12:17 jeromelanteri %a<key>:delete
12:17 jnthn Did you write . instead of : ?
12:17 zengargoyle m: my %h = a => "1', b => "2";, say %h; say %h<a>:delete; say %h;
12:17 camelia rakudo-moar 15b259: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>?Two terms in a row?at <tmp>:1?------> 3my %h = a => "1', b => "7?2";, say %h; say %h<a>:delete; say %h;?    expecting any of:?        infix?        infix stopper?        postfix?     …»
12:17 zengargoyle m: my %h = a => "1', b => "2"; say %h; say %h<a>:delete; say %h;
12:17 camelia rakudo-moar 15b259: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>?Two terms in a row?at <tmp>:1?------> 3my %h = a => "1', b => "7?2"; say %h; say %h<a>:delete; say %h;?    expecting any of:?        infix?        infix stopper?        postfix?      …»
12:18 jnthn zengargoyle: mismatched quote around 1
12:18 zengargoyle m: my %h = a => "1", b => "2"; say %h; say %h<a>:delete; say %h;
12:18 camelia rakudo-moar 15b259: OUTPUT: «{a => 1, b => 2}?1?{b => 2}?»
12:18 zengargoyle must be my bed time.
12:19 jeromelanteri zengargoyle, good night.
12:19 zengargoyle did you see the :delete
12:19 jeromelanteri yes
12:19 zengargoyle cool, bon nuit
12:19 jeromelanteri and same for an array as i can see
12:19 jeromelanteri bonne nuit
12:23 tbrowder m: my $b="010001000100010001000100";say $b.comb.(0..7).parse-base(2).chr
12:23 camelia rakudo-moar 15b259: OUTPUT: «No such method 'CALL-ME' for invocant of type 'Seq'?  in block <unit> at <tmp> line 1??»
12:24 sena_kun joined #perl6
12:25 tbrowder m: my $b="01000100";say $b.comb.[0..7].parse-base(2).chr
12:25 camelia rakudo-moar 15b259: OUTPUT: «No such method 'parse-base' for invocant of type 'List'?  in block <unit> at <tmp> line 1??»
12:26 mr-foobar joined #perl6
12:26 sena_kun m: my %h = :a($("1", "3", "4")); say %h<a>[*];
12:26 camelia rakudo-moar 15b259: OUTPUT: «P6opaque: no such attribute '$!todo' in type List when trying to get a value?  in block <unit> at <tmp> line 1??»
12:27 sena_kun Can someone RT it? The guilty is likely https://github.com/rakudo/rakudo/commit/a256c26d850c0e5ff986a6dfa1b1ef1ffaf55f40#diff-73b320f44150e274a14987ce4e9f0fdaR220
12:27 sena_kun ping lizmat
12:28 lizmat sena_kun: consider me pinged :-)
12:28 sena_kun lizmat, o/
12:28 lizmat please RT it and write a test  :-)
12:28 sena_kun Sure... Where should the test be placed to fit nicely?
12:29 lizmat good question :-)
12:29 Cabanossi joined #perl6
12:30 tbrowder m: my $b="01000100"; say $b.comb.[0..7].flat.pares-base(2).chr
12:30 camelia rakudo-moar 15b259: OUTPUT: «No such method 'pares-base' for invocant of type 'Seq'?  in block <unit> at <tmp> line 1??»
12:31 Aaronepower joined #perl6
12:31 lizmat parse-base ?
12:31 tbrowder yep, fumble finger!
12:32 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? https://paste.rs/PHO
12:33 tbrowder m: my $b="01000100";say $b.comb.[0..7].flat.parse-base(2).chr
12:33 camelia rakudo-moar 15b259: OUTPUT: «No such method 'parse-base' for invocant of type 'Seq'?  in block <unit> at <tmp> line 1??»
12:34 tbrowder probably need a join in the mix...
12:34 araraloren m: say (^10).grep({ $_ > 5 });
12:34 camelia rakudo-moar 15b259: OUTPUT: «(6 7 8 9)?»
12:34 araraloren Aaronepower, ^^
12:36 tbrowder m: my $b="01000100";say $b.comb.[0..7].join.parse-base(2).chr
12:36 camelia rakudo-moar 15b259: OUTPUT: «D?»
12:36 tbrowder \o/
12:37 Aaronepower araraloren: So now with this code https://paste.rs/rY8 I get this error.https://paste.rs/M6a
12:38 xtreak joined #perl6
12:40 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 joined #perl6
12:41 araraloren Aaronepower, what's the type of $epoch
12:41 Aaronepower araraloren: Date
12:42 araraloren Date ?
12:43 Aaronepower araraloren: Ah, I got it.
12:43 araraloren Hmm, ok
12:43 Aaronepower araraloren: I just needed to add `.Date` to `DateTime.new($time)`.
12:48 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.
12:51 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 rakudo-moar 15b259: OUTPUT: «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?      …»
12:51 jeromelanteri how to go two level deep with map in a variable ?
12:52 jeromelanteri first map give *, and then after ?
12:52 jeromelanteri ** ?
12:52 araraloren m: say so (^10).any.grep({ $_ > 5 });
12:52 camelia rakudo-moar 15b259: OUTPUT: «True?»
12:52 araraloren Is this helpful ? Aaronepower
12:53 mcmillhj joined #perl6
12:53 jeromelanteri Aaronepower, match ?
12:54 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 }})});
12:54 camelia rakudo-moar 15b259: OUTPUT: «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?      …»
12:54 jeromelanteri (i'ù not sure that you want) https://docs.perl6.org/type/Match#(Cool)_routine_match
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 }})});
12:54 camelia rakudo-moar 15b259: OUTPUT: «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?»
12:54 Aaronepower araraloren: Does that any somehow change the type? Because now I get nil on hash lookup.
12:55 jeromelanteri araraloren, i let you help our friend Aaronepower first...
12:56 Aaronepower jeromelanteri: Could you provide an example of how to use match?
12:56 Aaronepower As there is none in the documentation.
12:56 lizmat Aaronepower: .first ?
12:56 jeromelanteri Aaronepower, that is my problem to... :)
12:56 araraloren m: say (^10).any.grep({ $_ ~~ Int });
12:56 camelia rakudo-moar 15b259: OUTPUT: «any((0), (1), (2), (3), (4), (5), (6), (7), (8), (9))?»
12:56 jeromelanteri ha yes... first
12:58 jeromelanteri no, it doesn't give back a boolean.
12:59 araraloren yeah, first also work
13:00 lizmat it doesn't give back a Bool, but you can coerce to Bool
13:01 araraloren use
13:01 araraloren use so convert a object to Bool
13:01 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:02 lizmat jeromelanteri: if your array contains truthy values only, that should be ok
13:02 araraloren Aaronepower, you can use .first replace .grep and add a `so` after your `say`
13:03 Aaronepower araraloren: What does so do?
13:03 lizmat it's the opposite of not
13:03 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 jeromelanteri deeply
13:03 Aaronepower lizmat: So like `!!(expr)`?
13:03 lizmat yes, but with lower precedence
13:04 lizmat like and / or vs && / ||
13:04 jeromelanteri so i do $x.map: { *.map { *:delete } };
13:04 araraloren m: say so ^10 .grep({$_ > 5})
13:04 camelia rakudo-moar 15b259: OUTPUT: «True?»
13:05 Aaronepower Can you use adverbs with heredoc strings?
13:06 moritz I think you can
13:06 lizmat yes
13:06 moritz q:w:to...
13:06 Aaronepower Ah, I missing the extra colon.
13:06 * lizmat needs to commute&
13:12 AlexDaniel joined #perl6
13:14 Cabanossi joined #perl6
13:15 * [Coke] chuckles over http://blog.plover.com/2017/07/31/#ogonek
13:18 huf :)
13:18 huf yeah, it's a lot easier if you already know what it says
13:25 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?  ;)
13:25 Aaronepower Or is this like `10 > 5` => `1 > 0`?
13:25 moritz if you think they work like (10 > 5) && (5 > 0), then yes
13:25 Aaronepower moritz: Really?
13:26 perlpilot m: say 10 > 7 > 5 > 3 > 1
13:26 camelia rakudo-moar 15b259: OUTPUT: «True?»
13:26 Aaronepower Wow.
13:27 Aaronepower That's honestly too intuitive.
13:27 moritz we call them "chaining operators"
13:28 perlpilot Hmm.  I just tried to search for "chaining" and "listfix" on docs.perl6.org ...  that didn't turn out too useful.
13:32 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:41 mienaikage joined #perl6
13:44 xtreak joined #perl6
13:48 lichtkind joined #perl6
13:49 skids joined #perl6
13:50 rindolf joined #perl6
13:51 kerframil joined #perl6
13:58 Actualeyes joined #perl6
14:06 tadzik joined #perl6
14:06 mack[m] joined #perl6
14:06 M-Illandan joined #perl6
14:06 tyil[m] joined #perl6
14:06 unclechu joined #perl6
14:06 wictory[m] joined #perl6
14:06 ilmari[m] joined #perl6
14:06 Matthew[m] joined #perl6
14:06 CIAvash[m] joined #perl6
14:06 xui_nya[m] joined #perl6
14:09 zakharyas joined #perl6
14:18 araraloren_ joined #perl6
14:22 Aaronepower Sorry to keep asking questions. Is there a sort of in place grep? Where the results are removed from the original array?
14:24 jeromelanteri how to nested map with perl6 ... any link around ?
14:25 sena_kun m: my @a = <1 2 3 4 5>; @a .= grep(* > 3);
14:25 camelia rakudo-moar 15b259: ( no output )
14:25 sena_kun Aaronepower, maybe ^
14:25 sena_kun m: my @a = <1 2 3 4 5>; say @a; @a .= grep(* > 3); say @a;
14:25 camelia rakudo-moar 15b259: OUTPUT: «[1 2 3 4 5]?[4 5]?»
14:26 Aaronepower sena_kun: I think you misunderstood me, what I is `[1 2 3]` part.
14:27 Aaronepower I want is the*
14:27 sena_kun Aaronepower, ah, sorry.
14:27 sena_kun Can't you just invert your condition with `not`?
14:27 sena_kun m: my @a = <1 2 3 4 5>; say @a; @a .= grep(not * > 3); say @a;
14:27 camelia rakudo-moar 15b259: OUTPUT: «[1 2 3 4 5]?[1 2 3]?»
14:29 Aaronepower sena_kun: That seems a bit annoying to have to run grep twice to get the two intersections.
14:31 Aaronepower 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)
14:32 sena_kun Aaronepower, well, maybe someone knows a better way to do it.
14:33 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 }}};
14:33 camelia rakudo-moar 15b259: OUTPUT: «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?      …»
14:34 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 rakudo-moar 15b259: OUTPUT: «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 }}};?»
14:34 jeromelanteri voilà...
14:34 jeromelanteri so how to just remove the find nested element mapped ?
14:35 jeromelanteri $_:delete, i hope, will be the second condion mapped $_)
14:36 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:36 camelia rakudo-moar 15b259: OUTPUT: «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?»
14:36 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:36 camelia rakudo-moar 15b259: OUTPUT: «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?»
14:36 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. :)
14:37 Aaronepower sena_kun: Don't arbitrarily gate-keep yourself. :D
14:38 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 rakudo-moar 15b259: OUTPUT: «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?»
14:38 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 }}};
14:38 camelia rakudo-moar 15b259: OUTPUT: «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 }}};?»
14:39 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 rakudo-moar 15b259: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>?Missing block?at <tmp>:1?------> 3{ if ( $_<t> eq "bip") {my $_delete }}};7?5<EOL>?»
14:39 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 rakudo-moar 15b259: ( no output )
14:39 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 rakudo-moar 15b259: ( no output )
14:39 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:39 camelia rakudo-moar 15b259: OUTPUT: «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 }}}};?»
14:39 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:39 merced wow
14:39 camelia rakudo-moar 15b259: ( no output )
14:40 merced are you editing that inline lol
14:40 jeromelanteri merced, i done yes
14:40 jeromelanteri one time
14:41 jeromelanteri i search how to remove a found nested variable element from map
14:41 jeromelanteri i'm searching (sorry)
14:41 jeromelanteri merced, any idea (or just one would be suffisant) ?
14:42 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 merced dunno, i'm still learning perl x]
14:43 jeromelanteri merced we are in the same boat then...
14:43 sena_kun Aaronepower, sure. My (long) version would be...
14:43 sena_kun m: my &block = * > 5; say (^10).grep(&block);
14:43 camelia rakudo-moar 15b259: OUTPUT: «(6 7 8 9)?»
14:43 sena_kun I am sure there are other ways to do it though.
14:44 Aaronepower sena_kun: Good enough for me.
14:44 ilmari m:: my $predicate = * > 5; say (^10).grep({ not &$predicate })
14:44 evalable6 ilmari, Full output: https://gist.github.com/55e2cfccb38f10f264feafe4bbccd8ed
14:44 evalable6 ilmari, rakudo-moar 15b2596e3: OUTPUT: «(exit code 1) ===SORRY!=== Error while compiling /tmp/6TccaCXdXR?Bogus s…»
14:44 ilmari m: my &predicate = * > 5; say (^10).grep({ not &predicate })
14:44 camelia rakudo-moar 15b259: OUTPUT: «()?»
14:45 ilmari m: my &predicate = * > 5; say (^10).grep(not &predicate)
14:45 camelia rakudo-moar 15b259: OUTPUT: «Cannot use Bool as Matcher with '.grep'.  Did you mean to use $_ inside a block??  in block <unit> at <tmp> line 1??»
14:45 jeromelanteri not * >5 is like * < 5... or not ?
14:45 ilmari bah
14:45 pharv joined #perl6
14:46 sena_kun m: my &predicate = * > 5; say (^10).grep({not &predicate($_)})
14:46 camelia rakudo-moar 15b259: OUTPUT: «(0 1 2 3 4 5)?»
14:46 sena_kun ilmari, ^?
14:46 ilmari mm
14:47 jeromelanteri i mean... if x is NOT > 5, then x IS =< 5 (this day, maybe tomorrow same)
14:47 jeromelanteri anyway, good night
14:48 sena_kun o/
14:51 khw joined #perl6
14:51 Zoffix joined #perl6
14:52 Zoffix Just use `none` Junction instead of `not`:
14:52 Zoffix m: my &predicate = * > 5; say (^10).grep(none &predicate)
14:52 camelia rakudo-moar 15b259: OUTPUT: «(0 1 2 3 4 5)?»
14:52 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:
14:52 Zoffix m: my @a = <1 2 3 4 5>; .[.grep: * > 3, :k]:delete with @a; say @a
14:52 camelia rakudo-moar 15b259: OUTPUT: «[1 2 3]?»
14:53 tony-o Zoffix: modules.zef.pm should be back up now
14:53 tony-o including search
14:53 tony-o working on the module browsing aspect
14:53 Zoffix jeromelanteri: not guranteed:
14:53 Zoffix m: say [ NaN <= 5, NaN > 5 ]
14:53 camelia rakudo-moar 15b259: OUTPUT: «[False False]?»
14:53 Zoffix tony-o++ grep
14:54 Zoffix I mean...
14:54 Zoffix tony-o++ great
14:54 Zoffix :)
14:54 mr-fooba_ joined #perl6
14:57 Zoffix jeromelanteri: what did you want to delete from your thing? Just the `t` key or the entire upper level?
14:59 Aaronepower Zoffix: How do you also retain the results? Can you also retain the results?
15:01 Zoffix Aaronepower: results being what? The stuff that was deleted?
15:01 Aaronepower Zoffix: Yes, [4 5]
15:01 timotimo if you want to have both, may i suggest classify?
15:01 Zoffix Aaronepower: that's returned from :delete
15:02 Zoffix 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 rakudo-moar 15b259: OUTPUT: «[1 2 3]?[4 5]?»
15:02 Aaronepower Zoffix: Okay thanks!
15:02 timotimo m: my @a = <1 2 3 4 5>; my (@tossed, @kept) = @a.classify(* > 3); dd @tossed, @kept;
15:02 camelia rakudo-moar 15b259: OUTPUT: «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 = []?»
15:02 Zoffix And yeah, there's .classify that's likely a tool for the job
15:02 timotimo whoops :)
15:03 timotimo 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;
15:03 camelia rakudo-moar 15b259: OUTPUT: «[4 5]?[1 2 3]?»
15:05 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:08 Zoffix m: my @a = <1 2 3 4 5>; my @tossed; :(@ (@tossed, @a) ) := \(@a.classify(* > 3){True, False}); say @tossed; say @a;
15:08 camelia rakudo-moar 15b259: OUTPUT: «[4 5]?[1 2 3]?»
15:08 Zoffix close, but no cigar
15:10 itaipu joined #perl6
15:11 Aaronepower Zoffix: What is `:=`?
15:11 jeromelanteri Zoffix, the t key/value
15:12 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") { $_:kv:delete }}}};
15:12 camelia rakudo-moar 15b259: OUTPUT: «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 }}}};?»
15:12 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
15:12 Zoffix huggable: Signature
15:12 huggable Zoffix, Parameter list pattern: https://docs.perl6.org/type/Signature
15:12 Zoffix Unsure where that stuff's documented; maybe there ^
15:13 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 rakudo-moar 15b259: OUTPUT: «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 }}}};?»
15:13 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 rakudo-moar 15b259: ( no output )
15:14 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 rakudo-moar 15b259: OUTPUT: «[{g => rock, r => [{t => bip, u => bap} {t => loula}]} {g => jazzy, r => [{t => that's, u => awond} {t => erfull, u => world}]}]?»
15:14 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
15:14 jeromelanteri ok
15:14 jeromelanteri thank you
15:14 Zoffix jeromelanteri: also, camelia accepts /msg, if you want to spam the channel
15:15 Zoffix 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 rakudo-moar 15b259: OUTPUT: «[{g => rock, r => ({t => loula})} {g => jazzy, r => [{t => that's, u => awond} {t => erfull, u => world}]}]?»
15:15 zakharyas joined #perl6
15:15 Zoffix jeromelanteri: ^ that's the result you wanted?
15:15 jeromelanteri Zoffix, fantastic !
15:15 Zoffix sweet
15:15 jeromelanteri thk u
15:16 Zoffix *don't want to spam I meant :)
15:16 jeromelanteri Zoffix, humour is better
15:20 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?
15:20 Aaronepower Zoffix: One I define.
15:22 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"
15:22 camelia rakudo-moar 15b259: OUTPUT: «Teh bar => meows | foo => 42 iterpolator?»
15:23 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 rakudo-moar 15b259: OUTPUT: «Teh some hash with 2 keys iterpolator?»
15:25 Aaronepower Zoffix: So you're saying you can override methods per variable?!
15:25 Zoffix Per object; yeah
15:25 Zoffix There's `does` infix operator for that and also `but` operator that makes a shallow copy of the object first.
15:26 Zoffix m: say True but False
15:26 camelia rakudo-moar 15b259: OUTPUT: «False?»
15:26 Zoffix m: my $truthy-zero = 0 but True; say so 0; say so $truthy-zero; say $truthy-zero + 42
15:26 camelia rakudo-moar 15b259: OUTPUT: «False?True?42?»
15:27 Aaronepower Zoffix: Does anything made from that object also have it?
15:27 Aaronepower Zoffix: Like a pair copied out.
15:28 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 Zoffix Like a pair copied out
15:28 Zoffix m: say (%() but role meower {}).^name
15:28 camelia rakudo-moar 15b259: OUTPUT: «Hash+{meower}?»
15:29 Zoffix m: say (%() but role meower {})<foo>:kv.^name
15:29 camelia rakudo-moar 15b259: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>?Malformed postfix call?at <tmp>:1?------> 3say (%() but role meower {})<foo>:kv.7?5^name?»
15:29 Zoffix m: say ((%() but role meower {})<foo>:kv).^name
15:29 camelia rakudo-moar 15b259: OUTPUT: «List?»
15:29 Zoffix m: say ((%() but role meower {})<foo>:kv).head.^name
15:29 camelia rakudo-moar 15b259: OUTPUT: «Nil?»
15:29 Zoffix m: say ((%(:42foo) but role meower {})<foo>:kv).head.^name
15:29 camelia rakudo-moar 15b259: OUTPUT: «Str?»
15:30 Zoffix m: say ((%(:42foo) but role meower {})<foo>:p).head.^name
15:30 camelia rakudo-moar 15b259: OUTPUT: «Pair?»
15:30 Zoffix :)
15:33 Zoffix m: role mooer {}; say ((%(:42foo) but role meower { method AT-KEY (|) { callsame() but mooer } })<foo>).^name
15:33 camelia rakudo-moar 15b259: OUTPUT: «Int+{mooer}?»
15:33 Zoffix hehe
15:33 Zoffix (no idea how to mix into the Pair; I guess that needs to override the `postcircumfix:<{ }>` op)
15:35 Zoffix m: role mooer {}; sub postcircumfix:<{ }>(|c) { CORE::(q|&postcircumfix:<{ }>|)(|c) but mooer }; say (%(:42foo)<foo>:p).^name
15:35 camelia rakudo-moar 15b259: OUTPUT: «Pair+{mooer}?»
15:35 Zoffix haha :)
15:36 lizmat joined #perl6
15:37 Kyo91 joined #perl6
15:41 Aaronepower Zoffix: I was just being curious not actually looking for the solution. :p
15:44 cdg joined #perl6
15:49 AlexDaniel joined #perl6
16:04 jonathon joined #perl6
16:05 mr-foobar joined #perl6
16:05 jonathon joined #perl6
16:06 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:08 * Zoffix shrugs
16:08 bennofs joined #perl6
16:09 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?
16:10 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.
16:11 Zoffix No idea. Never seen that error before.
16:11 kaare__ joined #perl6
16:12 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
16:14 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 gabiruh joined #perl6
16:16 raschipi joined #perl6
16:19 mspo jonathon: I saw that the other day too
16:20 jonathon mspo: with zef or another perl6 program?
16:21 ugexe whats the --ll-exception output?
16:21 nhywyll joined #perl6
16:22 mspo jonathon: with zef trying to install zef
16:22 mspo jonathon: I think when it might have already been installed?
16:22 jonathon ugexe: bear with me, i'm a p6 noob (but a fairly experienced packager)
16:22 mspo jonathon: I was attempting to make pkgsrc package for zef, in fact
16:22 * Zoffix braces to be proven wrong about --ll-exception bug being insignicant :)
16:22 jonathon zef --ll-exception\n ===SORRY!===\n '/usr/share/perl6/vendor/short/34674DE0B49051C42E89F10D51FE788C3C3A3816' is a directory, cannot do '.open' on a directory
16:23 ugexe you'll have to do `perl6 --ll-exception $path-to-zef`
16:25 jonathon ugexe: https://hastebin.com/irixiwozed.js
16:25 ugexe Zoffix: heh
16:26 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 mspo nfi what that was about
16:26 ugexe jonathon: what if you `rm -rf ~/.perl6` and try again?
16:27 jonathon exact same output
16:31 Zoffix ugexe: haha :)
16:31 * Zoffix doesn't mind being wrong once in a while :)
16:32 bennofs left #perl6
16:32 mspo ugexe: I only got it once but here's the output: https://gist.github.com/msporleder/8cc6b0186db970bda0cb052754c801ae
16:32 geekosaur nspo, you;re on a platform that can't chain #!s
16:32 mspo ugexe: I think I had the '.' in the wrong place or something
16:33 geekosaur likely
16:33 ugexe its failing during precomp for some reason
16:33 mspo oh, no, the '.' is right there too
16:33 cdg joined #perl6
16:33 ingy m: sub foo(*@args) {.say for @args}; foo [1, 2], 3
16:33 camelia rakudo-moar 59ba9c: OUTPUT: «1?2?3?»
16:34 mspo ugexe: it only happened once so a bit of a mystery bug (for me)
16:34 ingy m: sub foo(*@args) {.say for @args}; foo {1 => 2}, 3
16:34 camelia rakudo-moar 59ba9c: OUTPUT: «1 => 2?3?»
16:34 ingy how can you rationalize the difference between those?
16:35 Zoffix ingy: *@ slurps Iterables. You get a list of Pairs from a Hash
16:35 raiph ingy: * flattens a list into its elements
16:35 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.
16:35 yoleaux 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>
16:35 ingy etoomuchmagikz
16:35 Zoffix No magics at all.
16:35 Zoffix m: sub foo(*@args) {.say for @args}; foo {1 => 2, :42foo}, 3
16:35 camelia rakudo-moar 59ba9c: OUTPUT: «1 => 2?foo => 42?3?»
16:36 ingy what sig do I use to get [1,2],3 as 2 args?
16:37 Zoffix m: sub foo(+@args) {.say for @args}; foo [1, 2],
16:37 camelia rakudo-moar 59ba9c: OUTPUT: «1?2?»
16:37 Zoffix m: sub foo(+@args) {.say for @args}; foo [1, 2],  3
16:37 camelia rakudo-moar 59ba9c: OUTPUT: «[1 2]?3?»
16:37 jonathon is precompilation tied to disk inodes?
16:37 ingy Zoffix: cheers
16:37 mspo jonathon: it's tied to timestamps
16:37 Zoffix I don't think it's tied to timestamps anymore
16:37 mspo Zoffix: since yesterday? :)
16:37 mspo lol
16:38 Zoffix Since ~middle of 2017.06-2017.07 IIRC
16:38 Cabanossi joined #perl6
16:38 zakharyas joined #perl6
16:38 Zoffix Or maybe that was only for CUI::FileSystem
16:39 Kyo91 joined #perl6
16:41 Zoffix Since April; no idea if it's just File or all repos: https://github.com/rakudo/rakudo/commit/ca0a74398b9385053c79de62a42418258905c715
16:41 ugexe it still gets used in creating a compiler or repo-id or some such
16:41 Zoffix Ah
16:42 Kyo91_ joined #perl6
16:42 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: https://www.reddit.com/r/perl6/comments/6htztl/no_candidate_found_for_zef/dj1bc4p/ Do you consider what I said there appropriate?
16:42 yoleaux raiph: I'll pass your message to nine.
16:43 ingy still, possible ironic quote of the year: "Zoffix | [Perl 6...] No magics at all." :)
16:44 tony-o ingy: meant to call you earlier this month but couldn't make it all the way up to seattle
16:44 tony-o now i'm driving to north dakota
16:44 ingy tony-o: bummer
16:44 ingy some day
16:45 Zoffix ingy: not ironic. I don't think there's much magics in Rakudo, at least compared to Perl
16:46 tony-o not with that attitude
16:46 Zoffix m: .say for flat {1 => 2, :42foo}, 3
16:46 camelia rakudo-moar 59ba9c: OUTPUT: «1 => 2?foo => 42?3?»
16:46 Zoffix ^ notice how similar it is to your *@ slurpy results. No magics :)
16:47 ingy I still want it on a t-shirt
16:47 Zoffix haha :)
16:48 robertle joined #perl6
16:49 nadim_ joined #perl6
16:50 mspo geekosaur: not sure what to do about that
16:50 mspo geekosaur: I guess linux supports it?
16:50 geekosaur linux does, *bsd and os x don't
16:50 mspo geekosaur: can I use moar directly in the #! line instead of sh + exec?
16:51 geekosaur probably? you could also try using env, since it's an executable
16:51 geekosaur #!/usr/bin/env ...
16:54 Zoffix m: sub infix:<?> is assoc(<list>) { flip ~@_ }; say "scigam"?"on"?"si"?"erehT"
16:54 camelia rakudo-moar 59ba9c: OUTPUT: «There is no magics?»
16:58 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:59 camelia rakudo-moar 59ba9c: OUTPUT: «There is no magics?»
17:00 Zoffix m: sub infix:<?> { [+] @_ }; say 2?2?2?2?2?2?2
17:00 camelia rakudo-moar 59ba9c: OUTPUT: «14?»
17:00 Zoffix hehe. Good times.
17:00 Zoffix left #perl6
17:05 mr-foobar joined #perl6
17:08 wamba joined #perl6
17:13 jdv79 Calling decode() will never work with declared signature ($str is copy)
17:13 jdv79 what exactly is that saying?
17:14 jdv79 oh, nevermind.  read it wrong.
17:16 raschipi joined #perl6
17:20 zakharyas joined #perl6
17:25 nhywyll joined #perl6
17:25 hoelzro joined #perl6
17:30 Cabanossi joined #perl6
17:48 mcmillhj joined #perl6
17:54 rindolf jdv79: hey! Long time. How are you?
18:14 f0x joined #perl6
18:15 f0x hey, I'm trying to get a perl6 program to work, and it needs Readline, which I can't seem to get
18:19 raschipi f0x: Which operating system are you using?
18:21 setty1 joined #perl6
18:26 sufrostico joined #perl6
18:30 [Coke] f0x: also, how are you trying to install Readline?
18:30 [Coke] (also: what does "perl6 --version" say)
18:38 raschipi And does it need the development symbols?
18:44 mcmillhj joined #perl6
18:45 f0x raschipi: Debian Sid, perl 6.c
18:46 raschipi What compiler version do you have ("perl6 --version")?
18:46 raschipi 6.c is the version of the language. It's like GCC7 vs C89
18:47 f0x Rakudo 2017.06 MoarVM 2017.06
18:48 f0x 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:49 raschipi panda is deprecated, zef took over
18:49 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 #perl6
18:53 f0x https://hastebin.com/cuyipereme.sql
18:53 Skarsnik joined #perl6
18:56 mcmillhj joined #perl6
18:59 jonathonf joined #perl6
19:01 ugexe look at the path names
19:06 lucasb joined #perl6
19:09 mcmillhj joined #perl6
19:11 lucasb possibly, the user arrived at some interaction between the Rakudo 2017.06 installation and the rakudo-star-2017.07 modules
19:14 Kyo91_ joined #perl6
19:21 mcmillhj joined #perl6
19:25 sufrostico joined #perl6
19:25 raschipi Are you using rakudobrew? Where did you get zef from?
19:26 ugexe their PATH is not setup properly
19:27 silug joined #perl6
19:27 markmont joined #perl6
19:32 sufrostico joined #perl6
19:41 zakharyas joined #perl6
19:44 Cabanossi joined #perl6
19:50 bwisti joined #perl6
19:54 itaipu joined #perl6
19:55 nadim_ Hi, do we have way to take rakudo, module, code, whatnot and make some archive/executable of it?
19:56 El_Che nadim_: no (although incidently I created a private repo yesterday to play with the idea)
19:56 El_Che (everything except rakudo though)
19:59 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
20:00 nadim_ timotimo: I wrote "whatnot" ;)
20:00 El_Che nadim_: the cunning plan was to work on it during TPCiA
20:00 timotimo https://github.com/samcv/rakudo-appimage-module-test-automation - this might be the one
20:00 timotimo no i mean el che was forgetting the appimages
20:01 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 El_Che nadim_: kind of inspired by Go deps and Rust cargo tool
20:01 nadim_ what size docker do you get for a rakudo, some dependencies and some code?
20:02 El_Che no idea if it's workable, just though about the interface with the user
20:02 El_Che nadim_: smallish
20:02 El_Che 200mb
20:02 nadim_ hohoho!
20:02 El_Che but I could get it around 30 I think
20:02 nadim_ ah
20:03 El_Che 200mb == debian/ubuntu + debs I build
20:03 El_Che (so no Rakudo Star, nor rakudobrew)
20:03 El_Che faster and smaller this way
20:03 El_Che 30 == alpine
20:03 nadim_ I have a package in some distributions, not sure they would distribute a docker  image,
20:03 nadim_ I think I saw someone talking about rakudo being packaged
20:03 El_Che I have Ruby trouble (I use fpm to create pkgs) on alpine, so not there yet
20:04 El_Che nadim_: that was me
20:04 El_Che or the debian guys
20:04 El_Che https://github.com/nxadm/rakudo-pkg/releases/
20:04 nadim_ a relatively new rakudo? I mean, do they update often?
20:05 El_Che the distro debian pkg is integrated in Debian. Mine (debian/ubuntu/fedora/centos) are selfcontained in /opt/rakudo
20:05 El_Che I update for every release
20:05 nadim_ every week I find a bug and I pull, compile and voila magic fingers fixed it
20:05 nadim_ good to know
20:05 El_Che the debian guys update often (they do a great job), but you need unstable to keep up
20:06 El_Che I target stable
20:06 nadim_ sounds like a good idea if you want some life
20:06 raschipi "stable" in debian means: "the offered features won't change", therefore it wouldn't be stable if they put new packages in there.
20:06 El_Che actually, funny story. My pkgs are just a byproduct of docker images I build the automate the pkgs creation
20:06 El_Che it was meant for sysadmins
20:06 nadim_ also good to know
20:07 El_Che but since I had the images, I create pkgs for users as well
20:07 El_Che I wanted rakudo in my containers and compiling each time was just too slow
20:08 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
20:08 nadim_ compiling each time as updating rakudo in the container
20:09 nadim_ timotimo: it's asciio, I doubt I have many windows users since the camel perl distributuin stopped working
20:10 Aaronepower joined #perl6
20:11 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
20:12 El_Che 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?
20:12 El_Che in order to create a bundle I wanted to use zef to write all the deps in a dir and pkg that
20:12 nadim_ sure
20:12 El_Che and feed the pkg to the same tool
20:12 nadim_ timotimo: I had the feeling you'd like this error
20:12 El_Che that would unpack it and version it in ~/.perl6
20:12 El_Che and run it
20:13 El_Che 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
20:13 El_Che dunno if it make sense
20:13 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 )
20:14 timotimo right at the top
20:14 nadim_ I think it makes sense to keep the dependencies separated by applications, never too sure
20:14 MasterDuke nadim_: i believe lizmat fixed that since your rakudo version
20:15 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
20:15 timotimo as long as the version gets bumped properly for releases, that is
20:15 El_Che nadim_: I was thinkg of a dir with the app and its applications
20:15 El_Che anyway, just thinking out loud
20:15 nadim_ El_Che: good thinking
20:15 El_Che being so busy with other stuff, I fear it may be just talk :(
20:16 El_Che (hence just a private repo)
20:17 nadim_ El_Che: do it, do it!
20:18 El_Che nadim_: I need to submit a dessertation this year (not a student, but full time employed + 2 kids)
20:18 El_Che :)
20:18 mspo geekosaur: so I made a c program to use instead of the shell script for #!
20:18 El_Che life is a bitch with little time
20:19 nadim_ Amin Amin, been there but I need to do something with my head to keep sane (whatever little sane I usually am)
20:20 mspo ttps://gist.github.com/msporleder/62d5bbd5dda6dd23d81d83730e8c77de
20:20 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 #perl6
20:20 El_Che bbl
20:25 espadrine joined #perl6
20:27 lizmat decommute&
20:30 nadim_ someone over did the demo in Terminal::Print, good to see people still like to have fun
20:31 timotimo <3
20:39 nadim_ I am actually impressed.
20:41 nadim_ where do we blog? some open blog that is perl oriented
20:45 mspo open blog?  is that a thing?
20:47 andreoss joined #perl6
20:49 Zoffix joined #perl6
20:49 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:50 mspo nadim_: reddit?
20:50 raschipi reddit has a new blog feature, but it's written in their dialect of markdown.
20:50 Zoffix nadim_: do you mean starting your own blogging site or are you just looking for a place to blog about Perl? http://blogs.perl.org/ is what the cool kids use. No pod, but you can use Markdown
20:51 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
20:52 nadim_ Zoffix: I can always write pod and transform to MD
20:53 timotimo pandoc probably can do that?
20:54 Zoffix nadim_: I guess... wouldn't MD be easier to write? :)
20:56 AlexDaniel moritz: unicode in irc logs plz :(
20:56 Zoffix moritz: yes, double plz
20:56 nadim_ nahh, been writting pod for 20 years, I am kinda used. and all the -------------------------- in MD makes me tired. Otherwise I like MD.
20:57 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 :)
20:58 nadim_ I think half of I what I need to say I already have in pod, just being lazy
20:59 andreoss m: macro foo($h) { say $h.perl }; foo(foo);
20:59 camelia rakudo-moar 59ba9c: OUTPUT: «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 andreoss m: use experimental :macros;macro foo($h) { say $h.perl }; foo(foo);
20:59 camelia rakudo-moar 59ba9c: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>?Too few positionals passed; expected 1 argument but got 0?at <tmp>:1?»
21:02 Zoffix left #perl6
21:08 andreoss m: use experimental :macros;macro foo(&block) { say &block.perl }; foo(->{...});
21:08 camelia rakudo-moar 59ba9c: OUTPUT: «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 #perl6
21:21 f0x left #perl6
21:26 geekosaur joined #perl6
21:52 geekosaur joined #perl6
21:54 dwimmy joined #perl6
21:55 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 cpage_ joined #perl6
21:56 dwimmy Two Questions: what is the meaning of the construction "(++$); and why does this hang after the second statement?
21:56 dwimmy $ time perl6 -e 'no strict; @alist = {(++$)**2} ...Inf; say @alist[^10]; if 25 == any(@alist) { say "OK " } else { say "NG" }'
21:57 dwimmy (1 4 9 16 25 36 49 64 81 100)
21:57 dwimmy [hangs indefinitely] ^C ^C
21:57 AlexDaniel dwimmy: hm, interesting. This is exactly what I would have expected, but I wonder if we can do better
21:58 dwimmy real    21m23.308s user    20m47.186s sys     0m4.167s
21:58 dwimmy OK what do you suggest?
21:58 AlexDaniel dwimmy: so it hangs because it attempts to create any junction of an infinite amount of elements…
21:58 AlexDaniel dwimmy: I think your understanding is that it would stop if it finds 25, correct?
21:59 dwimmy I can see that but it is able to print eg the first ten elements because "say" forces evaluation
21:59 dwimmy yes correct
21:59 AlexDaniel but only of the first 10 elements
21:59 AlexDaniel it's lazy
21:59 Cabanossi joined #perl6
22:00 dwimmy so what is the use of a lazy list especially an infinite one?
22:00 dwimmy [back in 5 minutes]
22:02 AlexDaniel dwimmy: well, having an infinite list that is non-lazy has no uses for sure :)
22:03 markmont joined #perl6
22:03 Skarsnik_ joined #perl6
22:03 AlexDaniel but if it's lazy, then you can have on-demand generation of elements, which may be useful sometimes
22:03 AlexDaniel that said, unless you're working with Seqs, you probably don't want to go too high :)
22:04 dwimmy A lazy list is therefore a virtual list - the elements don't exist until they are evaluated?
22:04 dwimmy here is another example:
22:05 dwimmy no strict;
22:05 AlexDaniel well, yes, pretty much
22:05 dwimmy my @alist = {(++$)**2} ... Inf;
22:05 AlexDaniel dwimmy: about ++$, $ is simply an anonymous state variable
22:05 dwimmy @Ns = < 64 128 256 512 1024 2048 4096 8192 16384 31768 65536 >;
22:05 Kyo91 joined #perl6
22:05 AlexDaniel so you're using ++ prefix op on a state variable basically
22:05 dwimmy for (@Ns)
22:05 dwimmy {
22:05 dwimmy $uBound = $_.sqrt.Real.truncate + 1;
22:06 dwimmy if $_ == any(@alist[^$uBound]) { say "$_\t== square" };
22:06 dwimmy if $_ != any(@alist[^$uBound]) { say "$_\t!= square" };
22:07 AlexDaniel dwimmy: you can write {state $foo; (++$foo)**2} instead, but arguably this is less readable
22:07 dwimmy }
22:07 cpage_ joined #perl6
22:10 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 ??
22:10 dwimmy Well it works with the infinite list whereare the other didn't
22:11 dwimmy By setting an upper bound I can get it to evaluate everything up to that point - it doesn't try to eval everything
22:12 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 AlexDaniel dwimmy: yes, that :)
22:12 dwimmy By computing and setting an upper bound
22:13 dwimmy But this is particular to this one piece of code - which deals with squares.
22:13 dwimmy I am looking for a more general way to work with these type lists
22:14 dwimmy It seems odd to me that the list seems to be implicitly ordered
22:14 AlexDaniel implicitly ordered?
22:14 dwimmy And the items in the list are always greater than the last
22:14 dwimmy but the any function is not taking advantage of this fact
22:15 dwimmy You start with a ordered sequence of integers, which is always increasing
22:15 dwimmy And so the squares of those numbers are also increasing
22:16 AlexDaniel here's one thing to note
22:16 AlexDaniel m: my @a = < a b c >; say any(@a) eq "b"
22:16 camelia rakudo-moar 59ba9c: OUTPUT: «any(False, True, False)?»
22:17 kerframil joined #perl6
22:17 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.
22:17 dwimmy with an infinite list it will go on working forever.
22:18 dwimmy That answers my question
22:18 dwimmy However what were you saying about Seqs?  Hang the Punch and Judy on me ..
22:18 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
22:19 AlexDaniel 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 #perl6
22:20 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" }'
22:20 dwimmy (1 4 9 16 25 36 49 64 81 100)
22:20 Zoffix Or if I can't, how can I check its version from withing another module?
22:20 Zoffix (and just die if it's too low)
22:20 dwimmy The second statement prints the first 10 elements
22:21 dwimmy 25 is  the fifth element
22:21 dwimmy Anyone can tell me more about Seqs ?
22:22 dwimmy BTW I'm looking for a good tutorial type site
22:23 AlexDaniel dwimmy: basically, Seqs produce values without storing them anywhere. See https://docs.perl6.org/type/Seq and maybe https://perl6.party/post/Perl-6-Seqs-Drugs-and-Rock-n-Roll
22:23 dwimmy Perl6Maven and Perl6Advent both have limitations but are the best Ive found so far ..
22:23 Zoffix dwimmy: rakudo.party
22:24 AlexDaniel dwimmy: official docs are quite good also. For example: https://docs.perl6.org/language/list#Sequences
22:24 Zoffix dwimmy: second and third posts from the top talk about seqs
22:24 dwimmy Thank you alexD.  I keep coming across that 2nd URL but I thought it was a joke
22:24 Zoffix :)
22:24 dwimmy Thanks
22:24 dwimmy [back in 30 minutes]
22:24 El_Che marketeers :)
22:24 Zoffix :D
22:29 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 Zoffix (and the docs for it are barely there; which is why I set out to write the article in the first place)
22:32 AlexDaniel .oO( why not write some docs instead? … )
22:33 lizmat joined #perl6
22:33 Zoffix Why not write an article first?
22:36 zengargoyle i sorta thought version could be :ver(some sort of range like thing that smart matches)
22:37 zengargoyle like :ver(v1.3 .. *) would be '1.003001' or above...
22:39 * lizmat is back home and goes to bed
22:42 skids joined #perl6
22:44 Cabanossi joined #perl6
22:54 https_GK1wmSU joined #perl6
22:54 Zoffix HTTP::UserAgent-- (not setting User-Agent) GitHub-- (403ing stuff without User-Agent) WWW-- (not setting headers with get/jget reqs)
22:56 ryu0 did anyone already open a ubuntu ppa for rakudo? i'm not finding one.
22:56 Zoffix No idea
22:56 Zoffix huggable: debs
22:56 huggable Zoffix, nothing found
22:56 Zoffix huggable: deb
22:56 huggable Zoffix, CentOS, Debian, Fedora and Ubuntu Rakudo packages: https://github.com/nxadm/rakudo-pkg/releases
22:56 Zoffix There are these packages tho
22:56 https_GK1wmSU left #perl6
22:56 ryu0 oh.
22:57 ryu0 that works.
22:57 ryu0 i was going to package it in a PPA if something didn't already exist.
23:02 Zoffix Solved my thing with `BEGIN WWW.^ver andthen $_ >= v1.004001 orelse die 'Need WWW.pm6 version 1.004001 or newer';`
23:02 Zoffix Needed to add `unit module WWW:ver<1.004001>` for that to register tho
23:03 Zoffix also, doing * >= v1.004001 instead borks
23:03 Zoffix m: 42 andthen *.say
23:03 camelia rakudo-moar 59ba9c: OUTPUT: «42?»
23:03 Zoffix m: .say with 42 andthen * >= 42
23:03 camelia rakudo-moar 59ba9c: OUTPUT: «True?»
23:03 Zoffix Oh, that might've been fixed already
23:04 zengargoyle i thought i saw recent issues regarding Version matching, but assume you probably read them.
23:05 Zoffix it was dying with "Cannot invoke this object (REPR: Null; VMNull)" and there was some commit fixing that somewher
23:06 TEttinger joined #perl6
23:10 andreoss left #perl6
23:11 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:12 zengargoyle seems PITA to have to actually do that yourself for each versionable thing.
23:12 Zoffix yeah
23:13 zengargoyle i sorta hope it's just a NYI type of thing.
23:13 zengargoyle or there's some other explanation of why it's not a good idea.
23:16 Zoffix oops. Actually that `orelse` should be just `or`
23:20 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 nadim_ http://blogs.perl.org/users/nadim_khemir/2017/08/perl-6-datadumptree-version-15.html
23:25 BenGoldberg joined #perl6
23:28 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:30 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 timotimo lovely pictures in that post btw
23:31 timotimo and i appreciate the ddt shortcut
23:37 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:38 Zoffix buggable: help
23:38 buggable Zoffix, tags | tag SOMETAG | eco | eco Some search term | author github username | speed | testers CPANTesters report ID
23:38 nadim_ now I think about it, I think one can easilly write a filter for that and it can be applies very specifically.
23:38 Zoffix buggable: testers f878354a-6183-11e7-89a5-c5f577a92919
23:38 zengargoyle ouch, name collision with App::Ddt authoring tool... :)
23:39 Zoffix nadim_: it was that ^
23:39 Zoffix buggable: source
23:39 Zoffix Stupid robot
23:39 nadim_ timotimo: wasn't it you who wanted to display a structure in a "window" then resume in your script?
23:39 nadim_ Zoffix: they tend to be
23:40 buggable Zoffix, Cound not find that ID or API is down. Try manually: http://api.cpantesters.org/v3/report/f878354a-6183-11e7-89a5-c5f577a92919
23:40 buggable Zoffix, See: https://github.com/zoffixznet/perl6-buggable
23:40 timotimo nadim_: yeah, i see you have it :)
23:40 AlexDaniel buggable: maybe you can learn something from your 10 siblings :)
23:40 Zoffix buggable: testers f878354a-6183-11e7-89a5-c5f577a92919
23:40 buggable Zoffix, Proc::Q:ver(1.001003) test result PASS. See more at https://temp.perl6.party/buggable/8572664894770011501630857.txt
23:41 * zengargoyle Cound
23:41 Zoffix nadim_: ^ there
23:42 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 nadim_ Zoffix: can I get the source data please?
23:43 Zoffix nadim_: http://api.cpantesters.org/v3/report/f878354a-6183-11e7-89a5-c5f577a92919
23:43 Zoffix decode from json
23:45 Cabanossi joined #perl6
23:45 nadim_ Does JSON::Tiny give back a perl data structure or just a match structure?
23:45 Zoffix perl
23:45 nadim_ I give it a try
23:47 AlexDaniel m: my $x = 50; do { $x = 42; $x = ENTER $x; say $x }
23:47 camelia rakudo-moar 59ba9c: OUTPUT: «42?»
23:47 AlexDaniel m: my $x = 50; do { $x = 42; $x = ENTER { my $temp = $x; $temp }; say $x }
23:47 camelia rakudo-moar 59ba9c: OUTPUT: «50?»
23:47 AlexDaniel :S
23:47 andrzejku joined #perl6
23:48 AlexDaniel is it a bug or not?
23:48 AlexDaniel definitely does not DWIM, unless I actually mean something else…
23:49 AlexDaniel m: my $x = 50; do { $x = 42; $x = ENTER $x.clone; say $x }
23:49 camelia rakudo-moar 59ba9c: OUTPUT: «50?»
23:50 Zoffix m: my $x := 50; do { $x := 42; $x := ENTER $x; say $x }
23:50 camelia rakudo-moar 59ba9c: OUTPUT: «50?»
23:51 timotimo nadim_: i'm not sure i understand what that means exactly, but it sure sounds neat
23:51 nadim_ hahaha
23:52 nadim_ 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:54 timotimo so like if i iterate over a list of lists i can show only the "current" inner list by default
23:54 timotimo if i dump it multiple times in a row
23:55 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:56 AlexDaniel m: my $x = 50; do { $x = 42; $x = ENTER +$x; say $x }
23:56 camelia rakudo-moar 59ba9c: OUTPUT: «50?»
23:56 AlexDaniel I think I've seen this kind of “trap” or whatever that is previously
23:57 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:58 nadim_ 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:59 nadim_ 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

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

Perl 6 | Reference Documentation | Rakudo