Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-11-07

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:17 El_Che [Coke]: https://news.ycombinator.com/item?id=15625311
00:18 El_Che [Coke]: ah you meant his source. Got it slightly too late :)
00:22 ryn1x joined #perl6
00:30 AlexDaniel` joined #perl6
00:30 tadzik joined #perl6
00:30 CIAvash[m] joined #perl6
00:30 tyil[m] joined #perl6
00:30 M-Illandan joined #perl6
00:30 unclechu joined #perl6
00:30 mack[m] joined #perl6
00:30 wamba[m] joined #perl6
00:30 wictory[m] joined #perl6
00:30 ilmari[m] joined #perl6
00:30 Matthew[m] joined #perl6
00:30 Garland_g[m] joined #perl6
00:30 xui_nya[m] joined #perl6
00:39 Cabanossi joined #perl6
00:42 * timotimo chimed in on a few of the stackoverflow questions linked to from the weekly
00:49 mr-foobar joined #perl6
00:52 aborazmeh joined #perl6
00:52 aborazmeh joined #perl6
00:58 mcmillhj joined #perl6
01:06 cdg_ joined #perl6
01:18 epony joined #perl6
01:19 mempko joined #perl6
01:21 mr-foobar joined #perl6
01:21 aindilis joined #perl6
01:22 ryn1x joined #perl6
01:23 telex joined #perl6
01:28 ryn1x joined #perl6
01:31 comborico1611 joined #perl6
01:33 ryn1x joined #perl6
01:34 comborico1611 m: my %test = (one => uno, two => dos);
01:34 camelia rakudo-moar fc9e7241b: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Undeclared routines:␤    dos used at line 1. Did you mean 'cos'?␤    uno used at line 1. Did you mean 'UNDO'?␤␤»
01:35 comborico1611 m: my %test = (one => 'uno', two => 'dos');
01:35 camelia rakudo-moar fc9e7241b: ( no output )
01:35 comborico1611 m: my %test = ('one' => uno, 'two' => dos);
01:35 camelia rakudo-moar fc9e7241b: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Undeclared routines:␤    dos used at line 1. Did you mean 'cos'?␤    uno used at line 1. Did you mean 'UNDO'?␤␤»
01:36 comborico1611 I see.
01:39 geekosaur => autoquotes the left side on the assumption that it wants to be a string key, but not the right
01:39 comborico1611 Hmm.
01:39 geekosaur if you want quoting of both, use a list initializer with <> or <<>> quoting
01:40 geekosaur m: my %test = <one uno two dos>; say %test<two>
01:40 camelia rakudo-moar fc9e7241b: OUTPUT: «dos␤»
01:40 comborico1611 What about with quoting?
01:41 geekosaur m: my %test = «one "uno una" two dos»; say %test<one>
01:41 camelia rakudo-moar fc9e7241b: OUTPUT: «uno una␤»
01:41 geekosaur although I'm not sure what you're asking tbh
01:44 comborico1611 Weird. I just didn't know what quoting was. I don't think it is discussed in the book I'm reading.
01:44 comborico1611 I'll check it out on docs.
01:46 geekosaur the docs aren't as easy to understand as they ought to be, when it comes to quoting. you have to search for « » (or the long form << >>, it's hidden under qqww
01:46 comborico1611 K. Thanks!
01:50 comborico1611 This one is the craziest:
01:50 comborico1611 m: my $a = "1 2";
01:50 comborico1611 say qqww{"$a" $a}.perl
01:50 camelia rakudo-moar fc9e7241b: ( no output )
01:50 evalable6 comborico1611, rakudo-moar fc9e7241b: OUTPUT: «(exit code 1) ===SORRY!=== Error while compiling /tmp/fpPSFKlofK␤Variable '$a' is not declared␤at /tmp/fpPSFKlofK:1␤------> say qqww{"⏏$a" $a}.perl»
01:50 unicodable6 joined #perl6
01:53 Cabanossi joined #perl6
01:54 kalkin--- joined #perl6
01:55 ryn1x joined #perl6
02:05 comborico1611 m: my @a = 'a' .. 'c';
02:05 camelia rakudo-moar fc9e7241b: ( no output )
02:16 BenGoldberg joined #perl6
02:17 geekosaur m: my $a = "1 2"; say qqww("$a" $a).perl
02:17 camelia rakudo-moar fc9e7241b: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in argument list; couldn't find final ')' (corresponding starter was at line 1)␤at <tmp>:1␤------> 3my $a = "1 2"; say qqww("$a"7⏏5 $a).perl␤    expecting any of:…»
02:17 geekosaur m: my $a = "1 2"; say qqww{"$a" $a}.perl
02:17 camelia rakudo-moar fc9e7241b: OUTPUT: «("1 2", "1", "2")␤»
02:17 geekosaur right, can't do parens there
02:18 geekosaur that works much the same way shell quoting does
02:19 mr-foobar joined #perl6
02:20 comborico1611 What are the braces denoting that the parens aren't? { } Is more subscripty
02:20 comborico1611 ?
02:20 geekosaur if you use parens, it's read as a function call instead of a quote
02:21 comborico1611 I see.
02:21 geekosaur m: sub qqww (Str $a) { say "hi, " ~ $a }; qqww("a"); say qqww{"a"}
02:21 camelia rakudo-moar fc9e7241b: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Calling qqww() will never work with declared signature (Str $a)␤at <tmp>:1␤------> 3$a) { say "hi, " ~ $a }; qqww("a"); say 7⏏5qqww{"a"}␤»
02:21 comborico1611 What about with <> instead of braces?
02:21 geekosaur whoops
02:21 geekosaur that would also work
02:22 comborico1611 Brackets?
02:22 comborico1611 I would type, but I'm on my phone.
02:22 geekosaur the names used for things vary by region, sadly. I use () = parens, [] = brackets. {} = braces
02:22 comborico1611 I use the same.
02:22 geekosaur but lots of places do that differently
02:25 geekosaur anyway parentheses are special because anything can be used as a function with them. other paired brackets, or repeated non-paired things (e.g. qqww|foo bar| or even qqww,foo bar,) can be used with it
02:25 mson joined #perl6
02:27 comborico1611 They need a smiley for "went over my head".
02:27 comborico1611 And I'm losing brain power as the night goes on.
02:28 comborico1611 I'm going to rest. Goodnight, geekosaur.
02:32 ryn1x joined #perl6
02:54 yht joined #perl6
02:55 ilbot3 joined #perl6
02:55 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!
03:07 darkmorph joined #perl6
03:09 raiph joined #perl6
03:10 raiph .tell samcv fyi: https://stackoverflow.com/questions/47142274/sorting-with-modified-alphabet-in-perl-6
03:10 yoleaux raiph: I'll pass your message to samcv.
03:14 ufobat_ joined #perl6
03:22 noganex_ joined #perl6
03:23 colomon joined #perl6
03:30 ryn1x joined #perl6
03:43 aborazmeh joined #perl6
03:43 aborazmeh joined #perl6
03:43 ryn1x_ joined #perl6
03:49 ryn1x_ I just set up a new Ubuntu box and can't install anything with zef... Not sure if it an issue with zef or my new ubuntu install... anyone familiar with this error?: Failed to create directory '/home/ryn1x/.perl6/precomp/531476C94944C40F030060AEB60539343668769B.1510010703.49446/C3' with mode '0o777': Failed to mkdir: 13
03:53 geekosaur 13 is ENOENT. what components of that path exist and what are their permissions?
03:54 geekosaur (there's some open moarvm tickets for various failure modes from its mkdir-path)
04:01 ryn1x_ precomp has permissions: drwxrwxr-x
04:02 ryn1x_ that long dir does not exist but others with a similar naming convention fododo
04:03 ryn1x_ do*
04:03 evalable6 joined #perl6
04:04 geekosaur guess I should have been more explicit
04:04 geekosaur (a) permissions includes ownership as the first two rwx mean nothing without knowing the owner/group of the file/dir
04:04 geekosaur (b) permissions in particular of the last component of the path that exists.
04:06 ryn1x_ joined #perl6
04:15 wander joined #perl6
04:16 wander How about the new `$/`? IIRC old style `method TOP($/)` should be modified for new `$/`
04:17 dugword joined #perl6
04:24 ryn1x__ joined #perl6
04:25 mcmillhj joined #perl6
04:26 ryn1x__ geekosaur: the last dir that exists, precomp, has my current user as the owner
04:31 dugword joined #perl6
04:32 dugword joined #perl6
04:38 Cabanossi joined #perl6
04:43 dugword joined #perl6
05:01 ryn1x joined #perl6
05:01 ryn1x_ joined #perl6
05:03 ryn1x__ joined #perl6
05:05 ryn1x__ joined #perl6
05:05 ryn1x___ joined #perl6
05:06 ryn1x____ joined #perl6
05:09 ryn1x__ So I just removed the version of rakudo-star that I built from source and installed the packaged version of rakudo and zef works fine now on ubuntu 16.04.
05:36 quotable6 joined #perl6
05:36 evalable6 joined #perl6
05:36 nativecallable6 joined #perl6
05:36 coverable6 joined #perl6
05:36 committable6 joined #perl6
05:36 bloatable6 joined #perl6
05:36 greppable6 joined #perl6
05:36 bisectable6 joined #perl6
05:36 releasable6 joined #perl6
05:36 unicodable6 joined #perl6
05:36 benchable6 joined #perl6
05:36 squashable6 joined #perl6
05:36 statisfiable6 joined #perl6
05:38 Cabanossi joined #perl6
06:07 cdg joined #perl6
06:13 ryn1x joined #perl6
06:20 wander joined #perl6
06:21 wander .ask moritz How about the new `$/`? IIRC old style `method TOP($/)` should be modified for new `$/`
06:21 yoleaux wander: I'll pass your message to moritz.
06:23 Gtoi joined #perl6
06:26 moritz wander: see https://github.com/rakudo/rakudo/issues/1235 for a discussion
06:26 yoleaux 06:21Z <wander> moritz: How about the new `$/`? IIRC old style `method TOP($/)` should be modified for new `$/`
06:26 wander gotcha
06:30 finanalyst joined #perl6
06:31 finanalyst p6: my @list='name',; say 'name' ne @list
06:31 camelia rakudo-moar fc9e7241b: OUTPUT: «False␤»
06:31 finanalyst shouldn't this be 'True'
06:31 finanalyst p6: my @list='name',; say 'name' ne any @list
06:32 camelia rakudo-moar fc9e7241b: OUTPUT: «False␤»
06:32 finanalyst forget question
06:41 Exodist joined #perl6
06:42 Piotr_ joined #perl6
06:51 ryn1x joined #perl6
06:51 ryn1x_ joined #perl6
06:53 wander .tell [Coke] I find after perl6/Pod-To-HTML#26, you cannot write pod6 inside `=begin Html...=end Html`, this cause messy code at homepage of the doc site
06:53 yoleaux wander: I'll pass your message to [Coke].
06:53 Cabanossi joined #perl6
06:54 wander .ask [Coke] what do you mean saying "=begin Html doesn't emit raw HTML"? Does it mean that every thing inside Html block should be raw Html code?
06:54 yoleaux wander: I'll pass your message to [Coke].
06:57 wander .tell [Coke] if so, then what we should do is remove pod6 code inside Html block of homepage. otherwise, if you mean after parse the code inside, Html block should not add redundant <p> tag, then we can hardcode to remove it, because extra <p></p> is always at both ends of returning Str
06:57 yoleaux wander: I'll pass your message to [Coke].
07:08 nadim joined #perl6
07:16 lowbro joined #perl6
07:16 lowbro joined #perl6
07:21 ryn1x joined #perl6
07:22 17SAA07KB joined #perl6
07:22 ryn1x_ joined #perl6
07:30 wander well, not only both ends
07:32 wander however, the first thing is to make sure which 'raw HTML' we want
07:35 domidumont joined #perl6
07:36 abraxxa joined #perl6
07:36 ZzZombo m: use Data::Dumper;my $m=Match.new;say Dump($m)
07:36 camelia rakudo-moar fc9e7241b: OUTPUT: «===SORRY!===␤Could not find Data::Dumper at line 1 in:␤    /home/camelia/.perl6␤    /home/camelia/rakudo-m-inst-2/share/perl6/site␤    /home/camelia/rakudo-m-inst-2/share/perl6/vendor␤    /home/camelia/rakudo-m-inst-2/share/perl6␤    CompU…»
07:36 ZzZombo ah come on
07:37 ZzZombo ah
07:37 ZzZombo m: use Data::Dump;my $m=Match.new;say Dump($m)
07:37 camelia rakudo-moar fc9e7241b: OUTPUT: «===SORRY!===␤Could not find Data::Dump at line 1 in:␤    /home/camelia/.perl6␤    /home/camelia/rakudo-m-inst-2/share/perl6/site␤    /home/camelia/rakudo-m-inst-2/share/perl6/vendor␤    /home/camelia/rakudo-m-inst-2/share/perl6␤    CompUni…»
07:43 geekosaur you want dd and it's a built-in
07:44 geekosaur or the perl method, likewise
07:44 geekosaur m: my $m = Match.new; dd $m
07:44 camelia rakudo-moar fc9e7241b: OUTPUT: «Match $m = Match.new(list => (), made => Any, pos => 0, hash => Map.new(()), orig => "", from => 0)␤»
07:44 geekosaur m: my $m = Match.new; say $m.perl
07:44 camelia rakudo-moar fc9e7241b: OUTPUT: «Match.new(list => (), made => Any, pos => 0, hash => Map.new(()), orig => "", from => 0)␤»
07:45 ZzZombo no, it's unreadable with real Match, and I wanted to see if exception I got with `Data::Dump` is reproducible here.
07:45 darutoko joined #perl6
07:46 geekosaur I don't see a Data.Dump
07:46 geekosaur were you trying to use perl 5's Data::Dumper? I'm not sure that would do much with a perl 6 Match object
07:46 ZzZombo No...
07:54 domidumont joined #perl6
07:59 konsolebox joined #perl6
08:02 iviv joined #perl6
08:05 jonas1 joined #perl6
08:05 parv joined #perl6
08:12 geekosaur hm. thought so. only reference to Data.Dump I can find is in my IRC logs from back before the GLR. not much chance it would work, if you managed to dig that up from somewhere
08:12 geekosaur hasn't been supported in a long time, because it was a workaround for .perl not quite being up to spec back then
08:22 * lizmat clickbaits https://p6weekly.wordpress.com/2017/11/06/2017-45-uplink-established/
08:22 moritz lizmat++
08:23 moritz I wonder if Match.gist should replace newlines with ␤ to increase readability
08:26 nine This is hilarious. So it takes a StackOverflow survey that finds that Perl is the most hated programming language to get a HackerNews page where people practically speak absolutely positively about Perl.
08:26 yoleaux 6 Nov 2017 23:22Z <azawawi> nine: Could you please take a look at the rakudo heap corruption bug when setting size to beyond 10k elements https://github.com/azawawi/perl6-msgpack/blob/master/benchmark/test-msgpack.pl6 . Thanks
08:27 rindolf joined #perl6
08:27 lizmat nine: yeah, I found that quite ironic as well  :-)
08:32 Geth ¦ doc: c1a8cd230e | (Alex Chen)++ (committed using GitHub Web editor) | doc/HomePage.pod6
08:32 Geth ¦ doc: Convert Z<> into <!---->
08:32 Geth ¦ doc:
08:32 Geth ¦ doc: To clean messy code in homepage.
08:32 Geth ¦ doc:
08:32 Geth ¦ doc: Besides, code within Html block is assumed to be raw HTML.
08:32 Geth ¦ doc:
08:32 Geth ¦ doc: If want to mix up pod6 and HTML in one file, separate them into different blocks.
08:33 Geth ¦ doc: review: https://github.com/perl6/doc/commit/c1a8cd230e
08:33 nine Same is apparently true for reddit.
08:48 aeruder joined #perl6
08:53 ryn1x joined #perl6
08:53 ryn1x_ joined #perl6
08:53 ryn1x__ joined #perl6
08:53 dugword joined #perl6
08:55 dakkar joined #perl6
08:57 holyghost timotimo : here's what I started of my simple game kit, https://pastebin.com/BzEGZfGc
08:58 gfldex joined #perl6
08:59 Geth ¦ Pod-To-HTML/emit-raw-HTML: 8d497c2893 | (Alex Chen)++ (committed using GitHub Web editor) | lib/Pod/To/HTML.pm
08:59 Geth ¦ Pod-To-HTML/emit-raw-HTML: Html block contains raw HTML code
08:59 Geth ¦ Pod-To-HTML/emit-raw-HTML:
08:59 Geth ¦ Pod-To-HTML/emit-raw-HTML: *Everything* within a Html block is assuming raw HTML.
08:59 Geth ¦ Pod-To-HTML/emit-raw-HTML:
08:59 Geth ¦ Pod-To-HTML/emit-raw-HTML: Because of the implementation, pod6 syntax will be removed, only its raw text remind. That is, C<code> -> code.
08:59 Geth ¦ Pod-To-HTML/emit-raw-HTML:
08:59 Geth ¦ Pod-To-HTML/emit-raw-HTML: To write C<> within Html block, you can use C&amp;lt;&amp;&gt;
08:59 Geth ¦ Pod-To-HTML/emit-raw-HTML: <…commit message has 17 more lines…>
08:59 Geth ¦ Pod-To-HTML/emit-raw-HTML: review: https://github.com/perl6/Pod-To-HTML/commit/8d497c2893
09:00 Geth ¦ Pod-To-HTML: W4anD0eR96++ created pull request #28: Html block contains raw HTML code
09:00 Geth ¦ Pod-To-HTML: review: https://github.com/perl6/Pod-To-HTML/pull/28
09:05 holyghost Some bot should do a timezone based upcon connects and talking, I am not going to write it :-)
09:11 holyghost joined #perl6
09:21 robertle joined #perl6
09:22 nine .tell azawawi Can't. MsgPack fails its tests on installation: Cannot look up attributes in a MsgPack::Native::msgpack_object type object in method type at /home/nine/.zef/store/perl6-msgpack.git/6c0c3228ef6859a6879c482e846c5ea8942f77cf/lib/MsgPack/Native.pm6 (MsgPack::Native) line 189
09:23 yoleaux nine: I'll pass your message to azawawi.
09:28 eliasr joined #perl6
09:30 sena_kun joined #perl6
09:33 HoboWithAShotgun joined #perl6
09:33 rgrau joined #perl6
09:34 wander joined #perl6
09:38 wander hey all, any advice on typing unicode such like « and » quickly? especially on mac
09:38 azawawi joined #perl6
09:38 azawawi hi
09:38 yoleaux 09:23Z <nine> azawawi: Can't. MsgPack fails its tests on installation: Cannot look up attributes in a MsgPack::Native::msgpack_object type object in method type at /home/nine/.zef/store/perl6-msgpack.git/6c0c3228ef6859a6879c482e846c5ea8942f77cf/lib/MsgPack/Native.pm6 (MsgPack::Native) line 189
09:39 azawawi nine: did you try to install it via zef? what's your dev environment?
09:40 lizmat wander: https://docs.perl6.org/language/unicode_entry
09:42 nine azawawi: Rakudo version 2017.10-125-g360eb2289 built on MoarVM version 2017.10-56-g68f04144a, zef commit fb9a8bda156e
09:43 azawawi nine: what's your libmsgpack version? it is printed in t/002-version.t
09:43 wander lizmat: oh we have it, thanks ^_^
09:45 nine azawawi: libmsgpackc2-2.1.2-1.2.x86_64
09:49 azawawi nine: if you can provide a full tests gist/pastebin... i know it fails on 1.4.2 but 2.1.2 that's new. I tested against it earlier.
09:51 eythian joined #perl6
09:51 eythian joined #perl6
10:09 nine azawawi: https://gist.github.com/niner/deda3a8c239c9c982703995a234449ca
10:10 Grimy joined #perl6
10:11 Grimy p6: say CHECK now - BEGIN now; sub circumfix:«` `» { @_ }; `42` xx 1
10:11 camelia rakudo-moar fc9e7241b: OUTPUT: «1.3288373␤»
10:11 Grimy Should this be considered a perf bug?
10:15 jnthn Well, custom operators need to calculate a new lexer. That said, I'm not immediately sure why a circumfix costs so much more than, say, a postfix
10:15 gfldex joined #perl6
10:17 moritz because they match in term position?
10:17 moritz and there are more possible terms than postfixes, I'd assume
10:18 jnthn True, but (unless this got optimized some) I thought the whole lexer was re-calculated (lazily and on demand, though)
10:18 ryn1x joined #perl6
10:18 ryn1x_ joined #perl6
10:18 ryn1x__ joined #perl6
10:18 domidumont joined #perl6
10:19 moritz I thought each DFS is re-calculate as needed, but then I'm not deep into that code
10:19 moritz *DFA
10:22 yht joined #perl6
10:23 Cabanossi joined #perl6
10:25 Cabanossi joined #perl6
10:29 wander joined #perl6
10:30 wander Anyone familiar with Pod::To::HTML please tell me why this line need `unescape_html`?
10:30 wander https://github.com/perl6/Pod-To-HTML/blob/8d497c2893456a86859abc5a3959bfae36a89a31/lib/Pod/To/HTML.pm#L351
10:32 wander If we assume text with a Html block is raw HTML, then there is no reason to unescape.
10:33 wander With unescape action, when we want to type &lt;(raw), it should be &amp;lt;, looks stupid
10:44 ZzZombo joined #perl6
10:46 domidumont joined #perl6
10:49 ZzZombo1 joined #perl6
10:50 ryn1x joined #perl6
10:50 ryn1x_ joined #perl6
10:50 ryn1x__ joined #perl6
10:52 ZzZombo joined #perl6
10:54 ZzZombo1 joined #perl6
11:12 eugene_barsky joined #perl6
11:12 eugene_barsky hi
11:12 eugene_barsky How to merge two ranges?
11:12 eugene_barsky I want smth like .say for 1..10 20..30
11:13 jnthn m: .say for flat 1..10, 20..30 # like this?
11:13 camelia rakudo-moar fc9e7241b: OUTPUT: «1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤20␤21␤22␤23␤24␤25␤26␤27␤28␤29␤30␤»
11:13 jnthn m: .say for (1..10).min .. (20..30).max # or like this?
11:13 camelia rakudo-moar fc9e7241b: OUTPUT: «1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤11␤12␤13␤14␤15␤16␤17␤18␤19␤20␤21␤22␤23␤24␤25␤26␤27␤28␤29␤30␤»
11:14 eugene_barsky thanks! I've done it with flat but thought it should be done easier...
11:15 eugene_barsky Then I'll stick to this method.
11:23 Cabanossi joined #perl6
11:24 Ulti eugene_barsky: how about this: sub merge(Range $a, Range $b) returns Range { return min($a, $b).min .. max($a, $b).max }
11:24 Ulti merge might not be the best name there
11:24 Ulti obviously if the two ranges are disjoint it doesn't account for that
11:26 cog_ joined #perl6
11:27 wander m: (1..10).&flat: (20..30) # if you like "infix"(fake)
11:27 camelia rakudo-moar fc9e7241b: ( no output )
11:27 wander m: say (1..10).&flat: (20..30) # if you like "infix"(fake)
11:27 camelia rakudo-moar fc9e7241b: OUTPUT: «(1 2 3 4 5 6 7 8 9 10 20 21 22 23 24 25 26 27 28 29 30)␤»
11:27 ChoHag joined #perl6
11:28 wander otherwise I think flat (1..10), (20..30) is concise enough
11:31 zakharyas joined #perl6
11:32 philomath_ joined #perl6
11:36 wander m: multi sub infix:<+> (Range $a, Range $b) { flat $a.flat, $b.flat }; .say for $a + $b; # or user-defined
11:36 camelia rakudo-moar fc9e7241b: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Variable '$a' is not declared␤at <tmp>:1␤------> 3$b) { flat $a.flat, $b.flat }; .say for 7⏏5$a + $b; # or user-defined␤»
11:36 Ulti is the idea to just represent the two ranges? I thought the idea was to have an encompassing single range
11:37 Ulti surely just a list of ranges is fine
11:37 Ulti in the case they are disjoint, the thing then becomes you want an iterator for that thing
11:37 Ulti RangeList that's iterable job done?
11:37 wander m: multi sub infix:<+> (Range $a, Range $b) { flat $a.flat, $b.flat }; .say for (1..10) + (20..30);
11:37 camelia rakudo-moar fc9e7241b: OUTPUT: «1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤20␤21␤22␤23␤24␤25␤26␤27␤28␤29␤30␤»
11:38 wander m: multi sub infix:<,> (Range $a, Range $b) { flat $a.flat, $b.flat }; .say for (1..10) , (20..30);
11:38 camelia rakudo-moar fc9e7241b: OUTPUT: «1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤20␤21␤22␤23␤24␤25␤26␤27␤28␤29␤30␤»
11:38 Ulti wander ok now I give you 1..10, 1..Inf
11:38 Ulti might be a legit reason like some minus numbers then all natural numbers
11:42 llfourn joined #perl6
11:45 HoboWithAShotgun joined #perl6
11:49 Geth ¦ Pod-To-HTML/emit-raw-HTML: c73c0a3530 | (Alex Chen)++ (committed using GitHub Web editor) | lib/Pod/To/HTML.pm
11:49 Geth ¦ Pod-To-HTML/emit-raw-HTML: Update HTML.pm
11:49 Geth ¦ Pod-To-HTML/emit-raw-HTML: review: https://github.com/perl6/Pod-To-HTML/commit/c73c0a3530
11:51 wander m: 2 (elem) 1..10
11:51 camelia rakudo-moar fc9e7241b: OUTPUT: «WARNINGS for <tmp>:␤Useless use of "(elem)" in expression "2 (elem) 1.." in sink context (line 1)␤»
11:51 wander m: say 2 (elem) (1..10)
11:51 camelia rakudo-moar fc9e7241b: OUTPUT: «True␤»
11:53 Cabanossi joined #perl6
11:55 ilmari m: say 2 ∊ (1..10)
11:55 camelia rakudo-moar fc9e7241b: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Confused␤at <tmp>:1␤------> 3say 27⏏5 ∊ (1..10)␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statement end␤        statement modifier␤     …»
11:55 ilmari unicodable6: ∊
11:55 unicodable6 ilmari, U+220A SMALL ELEMENT OF [Sm] (∊)
11:55 ilmari m: say 2 ∈ (1..10)
11:55 camelia rakudo-moar fc9e7241b: OUTPUT: «True␤»
11:55 ilmari unicodable6: element of
11:55 unicodable6 ilmari, U+2208 ELEMENT OF [Sm] (∈)
11:55 unicodable6 ilmari, U+2209 NOT AN ELEMENT OF [Sm] (∉)
11:55 unicodable6 ilmari, 13 characters in total (∈∉∊⋲⋳⋴⋵⋶⋷⋸⋹⟒⫙): https://gist.github.com/8d19988fa214affdd720e4cbe7d28bc9
12:06 margeas joined #perl6
12:07 wamba joined #perl6
12:07 sproctor joined #perl6
12:11 HoboWithAShotgun m: my @a = 1, 2, 3; say 3|4 ∈ @a;
12:11 camelia rakudo-moar fc9e7241b: OUTPUT: «any(True, False)␤»
12:11 HoboWithAShotgun m: my @a = 1, 2, 3; say "true" if 3|4 ∈ @a;
12:11 camelia rakudo-moar fc9e7241b: OUTPUT: «true␤»
12:12 HoboWithAShotgun m: my @a = 1, 2, 3; say "true" if 0|4 ∈ @a;
12:12 camelia rakudo-moar fc9e7241b: ( no output )
12:12 HoboWithAShotgun m: my @a = 1, 2, 3; say "true" if 1|2 ∈ @a;
12:12 camelia rakudo-moar fc9e7241b: OUTPUT: «true␤»
12:12 HoboWithAShotgun very nice
12:13 philomath_ joined #perl6
12:16 steeznson joined #perl6
12:18 wander m: grammar { token TOP { <atok> { if $<atok> ~~ /^b/ { make 42; } }} token atok { \w+ } }.parse("abcd").made;
12:18 camelia rakudo-moar fc9e7241b: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Strange text after block (missing semicolon or comma?)␤at <tmp>:1␤------> 3ok> { if $<atok> ~~ /^b/ { make 42; } }}7⏏5 token atok { \w+ } }.parse("abcd").made␤    expecting any of:␤       …»
12:18 wander m: grammar G { token TOP { <atok> { if self.match($/) { make 42; } }}; token atok { \w+ }; method match($m) { ($m<atok>) ~~ (/^a/) } }.parse("abcd").made.say;
12:18 camelia rakudo-moar fc9e7241b: OUTPUT: «42␤»
12:18 steeznson hello all! I am looking for a project idea using regular expressions that I can use to explore grammars in perl 6. I've been thinking about a crossword clue solver but I'd love to hear some suggestions.
12:19 wander parser of a subset of C(or any other language)
12:19 ChoHag joined #perl6
12:19 jast convert one syntax to another
12:20 wander that is it
12:20 jast e.g. JSON to XML, something like that
12:20 steeznson ah these are good thanks
12:21 steeznson are the official docs still the best reference point for grammars?
12:21 jast another one, write something that scrapes and parses websites and extracts information from them. of course there are already libraries to do that, but it's a nice and not all too simple thing to play with
12:21 wander by the way, our docs of grammar is a little lack, if having question, welcome to here
12:21 wander no :(
12:21 steeznson ah well thanks for the ideas and advice, i'll be back if I get stuck.
12:22 wander many, many traps/features are not documented yet
12:22 jast well, I've written stuff involving grammars based on the docs, so I'd say it's possible at least :)
12:23 wander maybe the best for now :P
12:24 ryn1x joined #perl6
12:24 ryn1x_ joined #perl6
12:24 ryn1x__ joined #perl6
12:25 wander m: grammar { token TOP { <atok> { if self.match($/) { make 42; } }}; token atok { \w+ }; method match($/) { ($<atok>) ~~ (/^a/) } }.parse("abcd").made.say;
12:25 camelia rakudo-moar fc9e7241b: OUTPUT: «Cannot assign to a readonly variable ($/) or a value␤  in method match at <tmp> line 1␤  in regex TOP at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
12:26 wander huh, this's the new $/
12:27 wander m: grammar { token TOP { <atok> { if $/<atok> ~~ /^a/ { make 42; } }}; token atok { \w+ } }.parse("abcd").made.say;
12:27 camelia rakudo-moar fc9e7241b: OUTPUT: «Nil␤»
12:29 wander This may be the second worst trap when I was building a miniC parser.
12:30 nine steeznson: you could write a parser for some configuration file format. Could then be used as basis for a configuration tool. I've done this e.g. for Apache and nginx config files and used it for a converter from Apache to nginx.
12:32 holyghost2 joined #perl6
12:33 steeznson that's a nice idea, could actually save me a lot of time with nginx in the future
12:34 wander rules, which auto-enable :sigspace, maybe causes confusing result too
12:35 wander only using rules in trivial case would help
12:35 wander other cases use `token` to make sure it does what you want
12:38 wander p6's grammar(https://github.com/rakudo/rakudo/blob/master/src/Perl6/Grammar.nqp) uses much more tokens than rules
12:40 ChoHag joined #perl6
12:47 dugword joined #perl6
12:58 pmurias joined #perl6
12:59 abraxxa joined #perl6
13:00 aborazmeh joined #perl6
13:00 aborazmeh joined #perl6
13:02 darkmorph joined #perl6
13:03 census2 joined #perl6
13:03 census2 I'm trying to figure out the download option at another website, and I'm wondering if someone can please help me
13:03 census2 https://www.clinicaltrials.gov/ct2/results?cond=%22Amyotrophic+Lateral+Sclerosis%22&amp;term=&amp;cntry1=NA:US&amp;state1=&amp;Search=Search&amp;recrs=a&amp;recrs=b&amp;recrs=c&amp;recrs=d&amp;recrs=e&amp;recrs=f&amp;recrs=g&amp;recrs=h&amp;recrs=i&amp;recrs=j&amp;recrs=k&amp;recrs=l&amp;recrs=m&amp;fund=0&amp;fund=1&amp;fund=2&amp;fund=3
13:05 pmurias is there a way to remove a webhook from the github UI?
13:06 lizmat joined #perl6
13:06 pmurias ahh, I just don't have the permission to get to the settings tab on the perl6/nqp repo
13:09 [Coke] pmurias: what do you need removed?
13:09 yoleaux 06:53Z <wander> [Coke]: I find after perl6/Pod-To-HTML#26, you cannot write pod6 inside `=begin Html...=end Html`, this cause messy code at homepage of the doc site
13:09 yoleaux 06:54Z <wander> [Coke]: what do you mean saying "=begin Html doesn't emit raw HTML"? Does it mean that every thing inside Html block should be raw Html code?
13:09 yoleaux 06:57Z <wander> [Coke]: if so, then what we should do is remove pod6 code inside Html block of homepage. otherwise, if you mean after parse the code inside, Html block should not add redundant <p> tag, then we can hardcode to remove it, because extra <p></p> is always at both ends of returning Str
13:09 census joined #perl6
13:09 census hi <[Coke]>
13:10 [Coke] o/
13:12 El_Che Hi [Coke]
13:12 census2 did you catch my posting before? i'm trying to work with a different website. i'm not sure if it has an API, but it has a .csv. However, I'm struggling to figure out the link to the .csv
13:13 konsolebox joined #perl6
13:13 pmurias [Coke]: the appveyor web hook for the nqp repo
13:13 pmurias [Coke]: it's just marking commits as failing
13:14 [Coke] pmurias: there are two appveyor links.
13:15 [Coke] ... and they appear to be identical? (double checking...)
13:16 [Coke] so yes, there are 2 things setup to push to PRs&pushes to appveyor.
13:26 [Coke] census2: Sorry, I've not got a lot of time to help you with the project.
13:33 pmurias [Coke]: I guess those appveyor web hooks are causing false fails
13:35 [Coke] but in general, I find dev tools on chrome invaluable for something like this; showing me what resources are going into making the page, and perhaps you can write something to scrape what they're doing. But I would suggest that if you're doing this for a job, that you talk to the website providing the data - they might have an API or some other way for you to get the data you're looking for.
13:38 ChoHag joined #perl6
13:40 konobi joined #perl6
13:40 mson joined #perl6
13:41 mcmillhj joined #perl6
13:44 ryn1x joined #perl6
13:44 ryn1x_ joined #perl6
13:44 ryn1x__ joined #perl6
13:45 [Coke] pmurias: ok, I deleted them.
13:48 rgrau joined #perl6
13:49 wander joined #perl6
13:51 cdg joined #perl6
13:51 ZzZombo1 Hey, how can I use default value if no type was passed, but otherwise use that type instead? `x //= default` doesn't work for obvious reasons.
13:53 Cabanossi joined #perl6
13:53 lizmat ZzZombo1: not sure what you mean, but what's wrong with:
13:53 lizmat m: sub a($a = Str) { dd $a }; a; a Int
13:53 camelia rakudo-moar fc9e7241b: OUTPUT: «Str $a = Str␤Int $a = Int␤»
13:54 ZzZombo1 this is an inline code block though, no argument list
13:56 lizmat m: my $a = -> $b = Str { dd $a }; $a(); $a(Int)
13:56 camelia rakudo-moar fc9e7241b: OUTPUT: «Block $a = -> $b = Str { #`(Block|65632864) ... }␤Block $a = -> $b = Str { #`(Block|65632864) ... }␤»
13:56 lizmat m: my $a = -> $b = Str { dd $b }; $a(); $a(Int)
13:56 camelia rakudo-moar fc9e7241b: OUTPUT: «Str $b = Str␤Int $b = Int␤»
13:56 abraxxa joined #perl6
13:56 lizmat a sub is mostly just a block with a name and place to return from
13:58 isidoro joined #perl6
14:01 ChoHag joined #perl6
14:02 census hi wander
14:02 wander hi
14:06 census i'm struggling with just 1 line of code. the line with my @terms from the .txt file produces an error. however, when i manually do it, there's no error: https://paste.ubuntu.com/25911080/
14:07 census error is: https://pastebin.com/pBHxg3BW
14:09 wander ()
14:11 perlpilot census: well ... what's different about when you do it "manually" versus when the program does it?
14:12 census perlpilot that 1 line of code
14:12 wander maybe try adding some ()
14:13 Guest56405 joined #perl6
14:13 Guest56405 lizmat: well, but what if I also have another place where I have such a parameter coming from a hash?
14:14 wander installing dependency..
14:14 perlpilot census: whenever I get into a position where something seemingly innocuous is causing breakage in my code, I go back to first principles and question everything I think I know to get to the bottom of it.   So ...  start questioning what's in @terms and what is the actual URL that gets passed to get
14:15 ryn1x joined #perl6
14:16 ryn1x_ joined #perl6
14:17 ryn1x__ joined #perl6
14:17 comborico1611 joined #perl6
14:18 wander agree
14:18 wander I've tested the code, no syntax miss
14:19 wander so it's quite probably that the URL is wrong
14:20 tholyghos joined #perl6
14:21 konsolebox joined #perl6
14:21 wander delete that line and dd/say what exactly the URL is.
14:24 census wander i figured out the issue
14:24 census when there's zero hits and thus no spreadsheet it produces a 404 error
14:25 census i'm not sure if there's a way to circumvent 404 type errors and just assign them to be a 0 ?
14:27 wander m: my $s; (try $s = die) orelse ($s =42); say $s
14:27 camelia rakudo-moar fc9e7241b: OUTPUT: «42␤»
14:27 perlpilot census: there's 0 hits for ALS?  That's strange :)
14:27 census no not ALS
14:27 census perlpilot 0 hits for a different one
14:27 census 207 hits for ALS
14:28 census i have an idea
14:28 census maybe i can do something like this: https://www.clinicaltrials.gov/ct2/results?cond=%22Aarskog+Syndrome%22+OR++%22Amyotrophic+Lateral+Sclerosis%22&amp;term=&amp;cntry1=NA%3AUS&amp;state1=&amp;Search=Search&amp;recrs=a&amp;recrs=b&amp;recrs=c&amp;recrs=d&amp;recrs=e&amp;recrs=f&amp;recrs=g&amp;recrs=h&amp;recrs=i&amp;recrs=j&amp;recrs=k&amp;recrs=l&amp;recrs=m&amp;fund=0&amp;fund=1&amp;fund=2&amp;fund=3
14:28 census so i search for 2 diseases no matter what. and just subtract out the results of ALS each time
14:30 perlpilot census: or ... check the result of the get and only spurt if you don't get a 404  (or, better, only spurt if you get a 2xx)
14:30 census perlpilot how would i do that?
14:32 perlpilot according to the docs, get returns Failure if the request fails or doesn't return a 2xx HTTP code.  So ... check for Failure.
14:32 perlpilot (or non-Failure really  :-)
14:33 census perlpilot where do you see this? like there's a value stored in the get ?
14:33 comborico1611 Who is the caller of function2 in this statement? my %hash = function1 function2 'string' ;
14:33 perlpilot census: I just read the README for WWW
14:34 moritz comborico1611: your own code
14:34 comborico1611 The statement is the caller?
14:34 moritz yes
14:34 raschipi joined #perl6
14:34 comborico1611 Okay. Thank you.
14:34 moritz this is like  my \temp1234 = function2 'string; function1 temp1234
14:36 comborico1611 Oh.
14:36 census perlpilot where are you reading this exactly at https://github.com/zoffixznet/perl6-WWW ?
14:43 perlpilot census: scroll down to where it says "EXPORTED ROUTINES".  There's an example for get and the paragraph immediately following says "Returns Failure if request fails or does not return a successful HTTP code."
14:44 census perlpilot where is that stored?
14:44 perlpilot census: color me confused now. What do you mean "stored"?
14:44 kaare_ joined #perl6
14:45 perlpilot census: you either get back a Str or a Failure.  It's up to you to check and decide what to do
14:45 census perlpilot i don't really understand how this code would go down. is there a variable to which the 'failure' string is stored?
14:45 census cause then i'll write an if statement that's something like if (x=='failure') results = 0; else { }
14:47 perlpilot ah ...  It's not a string.  It's a Failure *type*. So, you might say something like my $result = get "...";   if $result.isa(Failure) { ... } else { ... }
14:48 comborico1611 What is a group of s
14:48 comborico1611 Opp.
14:50 comborico1611 What is a group of characters containing a value called? Example, $[ "a", "b", "c" ]. (This expression is occurring within a hash.)
14:50 comborico1611 A group of characters contained in a variable.
14:50 moritz an array?
14:51 comborico1611 Hmm. Let me look at the code some more and see if an array was declared..
14:51 perlpilot .tell Zoffix you might want to include a couple of sad-path examples in WWW
14:51 yoleaux perlpilot: I'll pass your message to Zoffix.
14:51 comborico1611 I don't see an array. Do hashes automatically create arrays?
14:52 moritz there's autovivification
14:52 comborico1611 The situation is where there are multiple values for a single key.
14:52 moritz m: my %h; %h<a>.push: 'x'; say %h.perl
14:52 camelia rakudo-moar 948a3fa47: OUTPUT: «{:a($["x"])}␤»
14:52 comborico1611 lol. That sounds like a Catholic term.
14:54 moritz m: my %h; %h<a><b> = 'x'; say %h.perl; # autovivifies a second-level hash
14:54 camelia rakudo-moar 948a3fa47: OUTPUT: «{:a(${:b("x")})}␤»
14:56 census perlpilot thanks! that is totally working for the 0 cases of 404 errors; however, now i'm no longer getting correct answers for the ones that were previously correct
14:56 comborico1611 This doesn't look like what is going on.  Yours looks like different kind of manipulation.  I'll type the code in a minute.
14:57 comborico joined #perl6
14:58 comborico This is the most code I've typed in here.  So, hopefully I get it right. It is kind of strung-out over a few pages in the book.
14:58 holyghost2 Is there someone who wants to comment on my module, I've sent it to perl6-user@perl.org it's at http://gomez.yellowcouch.org/holly6src-1.3.tar.gz ?
15:01 neilb joined #perl6
15:01 comborico m: sub histogram(Str $string) { my %histo; for $string.comb -> $letter { %histo[$letter]++; }; return %histo; }; sub invert-hash( %in-hash) { my %out-hash; for %in-hash.kv -> $key, $val { push %out-hash{$val}, $key; }; return %out-hash; }; my %rev-hist = invert-hash histogram 'parrot' ; say %rev-hist; dd %rev-hist;
15:01 camelia rakudo-moar 948a3fa47: OUTPUT: «Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5p' (indicated by ⏏)␤  in sub histogram at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
15:02 census perlpilot how do i do the spurt correctly? https://paste.ubuntu.com/25911355/
15:03 raschipi comborico: use a pastebin next time
15:03 tholyghos joined #perl6
15:06 lizmat joined #perl6
15:07 comborico m: sub histogram( Str $string ) { my %histo; for $string.comb -> $letter { %histo{$letter]++; }; return %histo; }; sub invert-hash( %in-hash ) { my %out-hash; for %in-hash.kv -> $key, $val { push %out-hash{$val}, $key; }; return %out-hash; }; my %rev-hist = invert-hash histogram 'parrot' ;  say %rev-hist; dd %rev-hist;
15:07 camelia rakudo-moar 948a3fa47: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in subscript; couldn't find final '}' (corresponding starter was at line 1)␤at <tmp>:1␤------> 3$string.comb -> $letter { %histo{$letter7⏏5]++; }; return %histo; }; s…»
15:08 comborico m: sub histogram( Str $string ) { my %histo; for $string.comb -> $letter { %histo{$letter}++; }; return %histo; }; sub invert-hash( %in-hash ) { my %out-hash; for %in-hash.kv -> $key, $val { push %out-hash{$val}, $key; }; return %out-hash; }; my %rev-hist = invert-hash histogram 'parrot' ;  say %rev-hist; dd %rev-hist;
15:08 camelia rakudo-moar 948a3fa47: OUTPUT: «{1 => [p a o t], 2 => [r]}␤Hash %rev-hist = {"1" => $["p", "a", "o", "t"], "2" => $["r"]}␤»
15:09 ryn1x joined #perl6
15:09 comborico So there at "1" => $[ ] what is the value variable ($) called that holds multiple characters?
15:09 census thanks perlpilot!! it works :)
15:10 comborico Heh, yeah!
15:10 moritz comborico: the [] is an array
15:10 moritz and the $ just puts it into scalar context
15:10 comborico So the hash DOES automatically create arrays, right?
15:10 moritz the push does
15:11 moritz that's the autovification
15:11 ilmari m: my $foo = 42; push $foo, 37; say $foo;
15:11 comborico1611 Oh. Very good. Thank you.
15:11 camelia rakudo-moar 1bc9936ad: OUTPUT: «Cannot resolve caller push(Int: Int); none of these signatures match:␤    (Any:U \SELF: |values is raw)␤  in block <unit> at <tmp> line 1␤␤»
15:11 ilmari m: my $foo; push $foo, 37; say $foo; psuh $foo, 42; say $foo;
15:11 camelia rakudo-moar 1bc9936ad: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    psuh used at line 1. Did you mean 'push'?␤␤»
15:11 ilmari m: my $foo; push $foo, 37; say $foo; push $foo, 42; say $foo;
15:11 camelia rakudo-moar 1bc9936ad: OUTPUT: «[37]␤[37 42]␤»
15:12 comborico1611 I see.
15:15 comborico1611 raschipi, yeah. I should have just type it in a text editor. Pastebin, right?
15:16 raschipi any pastebin or gist will do
15:16 comborico1611 We're speaking of text editors, though, right?
15:18 comborico1611 I would get rakudo moar on my system, but i have an older machine upstairs here that i prefer to use older OS.
15:18 comborico1611 I didn't want to chance using parrot because of unknown incongruities.
15:21 comborico1611 Is incongruencies or autovivification the word out the day?
15:25 jdv79 is it correct that die'ing in a thread won't print the error?
15:25 jdv79 switching to warn and i see it...
15:25 jnthn Define "in a thread"
15:26 jnthn m: Thread.start({ die "oops" }).join
15:26 camelia rakudo-moar 1bc9936ad: OUTPUT: «No exception handler located for catch␤   at SETTING::src/core/Exception.pm:57  (/home/camelia/rakudo-m-inst-2/share/perl6/runtime/CORE.setting.moarvm:throw)␤ from SETTING::src/core/control.pm:178  (/home/camelia/rakudo-m-inst-2/share/perl6/runtim…»
15:26 jdv79 in a start block
15:26 jnthn Oh
15:26 tyil comborico1611: even with an older OS you can try rakudobrew
15:26 jdv79 i threw a CATCH { default { die $_ } } to debug something and that never printed
15:27 jnthn Sure, well start returns a Promise
15:27 comborico1611 Thank you. I'll look into that!
15:27 jnthn Which will be broken
15:27 jnthn But if you never await it anywhere then (a) the work may not run to completion before the program ends, and (b) nothing will receive the exception
15:27 ilmari m: start { die "aiee" }.result
15:27 camelia rakudo-moar 1bc9936ad: OUTPUT: «Tried to get the result of a broken Promise␤  in block <unit> at <tmp> line 1␤␤Original exception:␤    aiee␤      in block  at <tmp> line 1␤␤»
15:28 jdv79 oh ok
15:28 ilmari m: await start { die "aiee" }
15:28 camelia rakudo-moar 1bc9936ad: OUTPUT: «An operation first awaited:␤  in block <unit> at <tmp> line 1␤␤Died with the exception:␤    aiee␤      in block  at <tmp> line 1␤␤»
15:28 jnthn For 6.d, I've been pondering having a start block that is in sink context automatically do a .then(...) that will pull the program down though
15:28 jnthn (If there's an exception)
15:41 callyalater joined #perl6
15:44 bwisti joined #perl6
15:48 ryn1x_ joined #perl6
15:48 ryn1x joined #perl6
15:48 ryn1x__ joined #perl6
15:48 Exodist joined #perl6
15:49 troys joined #perl6
15:50 cdg joined #perl6
15:51 callyalater m: my $index = 0; say 'abcdefghij'.subst: /./, 'A', :nth($index+1); $index = 3; say 'abcdefghij'.subst: /./, 'A', :nth($index+1);
15:51 camelia rakudo-moar 1bc9936ad: OUTPUT: «Abcdefghij␤abcAefghij␤»
15:53 Cabanossi joined #perl6
15:56 mempko joined #perl6
15:58 khw joined #perl6
16:23 Cabanossi joined #perl6
16:33 philomath_ joined #perl6
16:42 wamba joined #perl6
16:47 lizmat joined #perl6
16:51 Kharec joined #perl6
16:51 Kharec left #perl6
16:54 ryn1x joined #perl6
16:54 ryn1x_ joined #perl6
16:54 ryn1x__ joined #perl6
16:54 sftp joined #perl6
16:59 darkmorph joined #perl6
17:02 comborico1611 tyil, can you send me a link of where to download a . deb for rakudobrew for Ubuntu 14? A search did not produce.
17:03 tyil I dont think there's debs of it, you just clone the repo and run the script(s)
17:03 comborico1611 Are roles done previously in any other programming language?
17:03 tyil https://github.com/tadzik/rakudobrew
17:03 comborico1611 Ty!
17:04 comborico1611 (my other question is completely unrelated to what we're talking about.)
17:04 ilmari comborico1611: yes, they originated in Self (called Traits) in 1982
17:04 ilmari https://en.wikipedia.org/wiki/Trait_(computer_programming)#Supported_languages
17:05 ilmari https://dl.acm.org/citation.cfm?doid=966873.806468 # the original Traits paper
17:05 comborico1611 Thank you.
17:06 cdg_ joined #perl6
17:06 sftp joined #perl6
17:07 cdg_ joined #perl6
17:11 mcmillhj joined #perl6
17:12 sftp joined #perl6
17:13 setty1 joined #perl6
17:13 sftp joined #perl6
17:19 zakharyas joined #perl6
17:20 imcsk8 joined #perl6
17:21 cdg joined #perl6
17:21 Ulti I just had a great idea for how to not do an ORM in Perl 6, just have SQL native in the language which abstracts the SQL :S then if the grammar doesnt match you assume someone is putting in some SQL literal at that point
17:22 Ulti job done
17:22 Ulti everyone is happy
17:22 Ulti and I dont have to suffer your obscure as hell method chaining verbage thats different between every orm and every programming language
17:33 AlexDaniel Ulti: by the way, have you seen https://github.com/tony-o/perl6-slang-sql ?
17:38 Cabanossi joined #perl6
17:38 mcmillhj joined #perl6
17:39 sftp joined #perl6
17:42 ryn1x joined #perl6
17:42 ryn1x_ joined #perl6
17:42 ryn1x__ joined #perl6
17:46 mcmillhj joined #perl6
17:50 domidumont joined #perl6
17:54 Exodist joined #perl6
17:55 [Coke] I have never worked on a project where something other than raw SQL was preferable. I'm amazed when people find it helpful.
17:55 [Coke] it==ORM
18:01 darkmorph joined #perl6
18:03 neilb joined #perl6
18:04 Exodist joined #perl6
18:08 Cabanossi joined #perl6
18:11 Exodist joined #perl6
18:17 timotimo perhaps it's there to allow the ORM itself to more easily make sense of the results that are coming back?
18:18 timotimo if you have a raw sql string it'd have to parse the sql itself to find out what it's doing, if you build the query with methods or whatever the orm will know first-hand and can generate the sql at the same time
18:19 timotimo i haven't used orms much, though. i think the only orms i've tried were django's own one and sqlalchemy - though django has sqlalchemy now, i believe?
18:19 * timotimo bbl
18:20 Exodist joined #perl6
18:26 hahainternet [Coke]: they are often useful, i can give you many examples if you care for them
18:28 mspo eh in php world I encounter tons of ad-hoc sql based on partial strings
18:28 mspo and it's quite some spaghetti
18:28 * ilmari finds DBIx::Class helpful when dealing with ~600 tables and ~1k foreign key relationships across ~20 schemas
18:28 ilmari several of those being compound foreign keys
18:28 hahainternet yes dbic is quite nice
18:28 ilmari and some of the schema not being terribly well designed
18:28 hahainternet django's ORM is acceptable also
18:28 hahainternet i wrote a translation layer from that to golang
18:28 hahainternet in order to get performance
18:29 hahainternet having the metadata about your schema is valuable
18:35 mr-foobar joined #perl6
18:42 [Coke] hahainternet: I get that some people find it useful; probably don't bother giving me an example (no time to dig into that now)
18:43 [Coke] (but if you have one ready, sure.)
18:43 hahainternet [Coke]: i don't have one to hand, but it really isn't 'some people'
18:43 hahainternet it is just a way of encoding the metadata about your structure
18:43 hahainternet if you want to operate on anything indirectly in SQL, you will need something storing this metadata
18:45 mcmillhj joined #perl6
18:50 neilb joined #perl6
18:52 Cabanossi joined #perl6
18:59 HoboWithAShotgun joined #perl6
19:04 mcmillhj joined #perl6
19:05 cdg joined #perl6
19:09 mcmillhj joined #perl6
19:14 ryn1x joined #perl6
19:14 ryn1x_ joined #perl6
19:14 ryn1x__ joined #perl6
19:20 cdg joined #perl6
19:31 cdg_ joined #perl6
19:33 buggable New CPAN upload: Bailador-0.0.14.tar.gz by UFOBAT https://cpan.metacpan.org/authors/id/U/UF/UFOBAT/Perl6/Bailador-0.0.14.tar.gz
19:34 ufobat_ \o/
19:39 Cabanossi joined #perl6
19:48 espadrine joined #perl6
19:51 ChoHag_ joined #perl6
19:54 wander ufobat_: could you please should me a picture of website built by Bailador?
19:54 wander s/should/show
19:56 ufobat_ i dont know which one uses it
19:56 ufobat_ bailador.net does, but it's currently down. It is not maintained by me. sorry
19:57 ryn1x joined #perl6
19:57 ryn1x_ joined #perl6
19:57 ryn1x__ joined #perl6
19:58 wander sad :(
20:04 domidumont joined #perl6
20:12 zakharyas joined #perl6
20:29 wander squashable6: next
20:29 squashable6 wander, Next SQUASHathon in 23 days and ≈13 hours (2017-12-02 UTC-12⌁UTC+14). See https://github.com/rakudo/rakudo/wiki/Monthly-Bug-Squash-Day
20:36 darkmorph joined #perl6
20:37 neilb joined #perl6
20:40 mson joined #perl6
20:48 Aaronepower joined #perl6
20:53 pmurias https://github.com/tc39/proposal-bigint # bigints are coming to JavaScript :)
20:53 unicodable6 joined #perl6
20:57 ryn1x_ joined #perl6
20:57 ryn1x joined #perl6
20:57 ryn1x__ joined #perl6
20:59 cdg joined #perl6
20:59 lostinfog joined #perl6
21:04 cdg_ joined #perl6
21:07 zakharyas joined #perl6
21:13 luke joined #perl6
21:14 luke Hello
21:14 Guest71897 I'm a Ubuntu user and I'm interested in learning Perl6
21:15 Guest71897 However, I can get Rakudo to install
21:15 Guest71897 Could anyone help me with this?
21:15 Guest71897 cannot*
21:15 El_Che Hi Guest71897, you can have a look at resources at: https://perl6.org/resources/
21:15 El_Che there are some books recomendations there
21:16 El_Che some of the authors are here :)
21:16 Guest71897 Thanks
21:16 El_Che Guest71897: if you're running Ubuntu 17.10, the rakudo version if fine
21:17 El_Che if something older, have a look here: https://github.com/nxadm/rakudo-pkg
21:17 El_Che if -> is
21:17 Guest71897 I'm using 16.04, and I downloaded the 2017.07 release from that repo.
21:17 Guest71897 However, I'm not really sure on what to do next
21:18 El_Che sudo dpkg -i *.deb
21:19 El_Che that will install rakudo in /opt/rakudo-pkg/bin
21:19 El_Che the instructions to change the path are in that page (I am the author of that page)
21:20 El_Che got to go, now. bbl
21:20 El_Che stick around people come and go all the time here
21:21 Guest71897 Thanks for the help!
21:22 MasterDuke joined #perl6
21:23 lizmat decommute&
21:24 mcmillhj joined #perl6
21:25 comborico1611 joined #perl6
21:29 Guest71897 El_Che: thanks for the help, I got it working now :-)
21:34 mr-fooba_ joined #perl6
21:38 ryn1x joined #perl6
21:42 Cabanossi joined #perl6
21:59 * HoboWithAShotgun hears scary sounds as he streches his spine
22:00 ChoHag joined #perl6
22:03 ryn1x joined #perl6
22:03 ryn1x_ joined #perl6
22:25 darkmorph joined #perl6
22:26 HoboWithAShotgun m: class X {}; class Foo is X {}; class Bar is X; sub foo returns Array[X] { return @(Foo.new, Bar.new); }; foo
22:26 camelia rakudo-moar 965575710: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Too late for unit-scoped class definition;␤Please use the block form.␤at <tmp>:1␤------> 3X {}; class Foo is X {}; class Bar is X;7⏏5 sub foo returns Array[X] { return @(Foo␤»
22:27 HoboWithAShotgun m: class X {}; class Foo is X {}; class Bar is X {}; sub foo returns Array[X] { return @(Foo.new, Bar.new); }; foo
22:27 camelia rakudo-moar 965575710: OUTPUT: «Type check failed for return value; expected Array[X] but got List ($(Foo.new, Bar.new))␤  in sub foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
22:27 HoboWithAShotgun m: class X {}; class Foo is X {}; class Bar is X {}; sub foo returns Array[X] { return @(Foo.new, Bar.new).Array; }; foo
22:27 camelia rakudo-moar 965575710: OUTPUT: «Type check failed for return value; expected Array[X] but got Array ($[Foo.new, Bar.new])␤  in sub foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
22:28 HoboWithAShotgun m: class X {}; class Foo is X {}; class Bar is X {}; sub foo returns Array where *.isa("X") { return @(Foo.new, Bar.new).Array; }; foo
22:28 camelia rakudo-moar 965575710: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Missing block␤at <tmp>:1␤------> 3class Bar is X {}; sub foo returns Array7⏏5 where *.isa("X") { return @(Foo.new, Ba␤    expecting any of:␤        new name to be defined␤»
22:28 HoboWithAShotgun m: class X {}; class Foo is X {}; class Bar is X {}; sub foo returns Array where *.all({.isa("X")}) { return @(Foo.new, Bar.new).Array; }; foo
22:28 camelia rakudo-moar 965575710: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Missing block␤at <tmp>:1␤------> 3class Bar is X {}; sub foo returns Array7⏏5 where *.all({.isa("X")}) { return @(Foo␤    expecting any of:␤        new name to be defined␤»
22:33 HoboWithAShotgun so how do i tell perl i want an array of things that are all subclasses of X?
22:39 sena_kun m: role A {}; class B does A {}; class C does A {}; my A @rray = B.new, C.new, B.new;
22:39 camelia rakudo-moar 965575710: ( no output )
22:39 sena_kun m: role A {}; class B does A {}; class C does A {}; my A @rray = B.new, C.new, B.new; @rray.say;
22:39 camelia rakudo-moar 965575710: OUTPUT: «[B.new C.new B.new]␤»
22:39 sena_kun HoboWithAShotgun, like that? ^
22:40 sena_kun m: role A {}; class B does A {}; class C does A {}; my A @rray = B.new, C.new, B.new; @rray.say; @rray.push: 3;
22:40 camelia rakudo-moar 965575710: OUTPUT: «[B.new C.new B.new]␤Type check failed in assignment to @rray; expected A but got Int (3)␤  in block <unit> at <tmp> line 1␤␤»
22:41 HoboWithAShotgun no, as i tried to do above as a signature
22:41 sena_kun dunno about subclasses though.
22:41 ryn1x joined #perl6
22:41 sena_kun ah, a signature one.
22:41 HoboWithAShotgun this is my best that works: subset UnitArray of Array where *.grep({ !.isa("Units::Unit") }).elems == 0;
22:41 ryn1x_ joined #perl6
22:41 ryn1x__ joined #perl6
22:42 sena_kun what about, give me a second...
22:42 sena_kun m: sub foo(--> Array[Int]) { Array.new(1,2,3) }; foo(); sub bar(--> Array[Int]) { Array.new(1,2,3,'no') }; bar();
22:42 camelia rakudo-moar 965575710: OUTPUT: «Type check failed for return value; expected Array[Int] but got Array ($[1, 2, 3])␤  in sub foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
22:42 sena_kun m: sub foo(--> Array[Int]) { Array.new(1,2,3) }; foo();
22:42 camelia rakudo-moar 965575710: OUTPUT: «Type check failed for return value; expected Array[Int] but got Array ($[1, 2, 3])␤  in sub foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
22:43 sena_kun eeeeh.
22:43 HoboWithAShotgun that*s better: subset UnitArray of Array where not *.grep({ !.isa("Units::Unit") });
22:43 sena_kun ah, ok, I've failed. :/
22:43 HoboWithAShotgun not an array of int. that's easy. an array of things that are subclasses of X
22:44 HoboWithAShotgun here X being Units::Unit
22:44 sena_kun I am assuming I should be able to replace Int with Units::Unit, to be honest.
22:45 HoboWithAShotgun that works as the array contains Units::Unit Objects
22:45 sena_kun ugh.
22:45 HoboWithAShotgun but it fails when it contains say, Units::Voltage objects
22:45 mempko joined #perl6
22:45 sena_kun well, sorry I couldn't help much then.
22:46 HoboWithAShotgun where Units::Voltage isa Units::Unit
22:46 HoboWithAShotgun nah, it's ok. the above is fine.
22:46 HoboWithAShotgun echo chamber effect ;-)
22:46 HoboWithAShotgun i used to have a tortoise for the desk to tell stuff to but it broke
22:47 HoboWithAShotgun and it feels weird to talk to a bottle or something :)
22:48 sena_kun it's already 00:48 here, so need to sleep. at least a little bit.
22:50 samcv .
22:50 yoleaux 03:10Z <raiph> samcv: fyi: https://stackoverflow.com/questions/47142274/sorting-with-modified-alphabet-in-perl-6
22:52 samcv hmm
22:56 colomon joined #perl6
22:58 rjbs Is Patrick M. ever around here anymore?
22:58 yoleaux 8 Apr 2017 01:12Z <[Coke]> rjbs: https://github.com/coke/p6-uni
23:05 ryn1x joined #perl6
23:05 ryn1x_ joined #perl6
23:05 ryn1x__ joined #perl6
23:06 AlexDaniel .seen pmichaud
23:06 yoleaux I saw pmichaud 18 Jul 2017 14:45Z in #perl6: <pmichaud> (Wishing I could get to Amsterdam this year for #yapceu)
23:06 AlexDaniel rjbs: ↑ ?
23:08 cpage_ joined #perl6
23:10 geekosaur that sounds like "not really"
23:11 comborico1611 Three more chapters to go in this book!
23:11 AlexDaniel well, you can still send a pigeon with .tell and hope for the best :)
23:11 AlexDaniel (although email is probably a better choice in this case)
23:12 timotimo if you care about performance, don't isa with a string, HoboWithAShotgun
23:12 timotimo you can actually directly .grep(Units::Unit)
23:12 timotimo because grep uses smartmatch to do its thing
23:13 HoboWithAShotgun that's useful. ty
23:13 timotimo two or three years ago i was looking at why some program wasn't performing well, it was because of an isa + string being crazy slow
23:14 timotimo m: say (1 xx 1000).grep(Rat); say now - INIT now
23:14 camelia rakudo-moar 0e50993f4: OUTPUT: «()␤0.00517439␤»
23:14 timotimo m: say (1 xx 1000).grep(*.isa(Rat)); say now - INIT now
23:14 camelia rakudo-moar 0e50993f4: OUTPUT: «()␤0.0074191␤»
23:14 timotimo m: say (1 xx 1000).grep(*.isa("Rat")); say now - INIT now
23:14 camelia rakudo-moar 0e50993f4: OUTPUT: «()␤0.0306595␤»
23:14 timotimo still a very noticable difference
23:14 timotimo especially with a non-match it has to go through the whole mro, of course
23:15 timotimo it's likely a bit better if the type matches directly, let's see
23:15 timotimo m: say +(1 xx 1000).grep(*.isa("Int")); say now - INIT now
23:15 camelia rakudo-moar 0e50993f4: OUTPUT: «1000␤0.0285461␤»
23:15 timotimo m: say +(1 xx 1000).grep(*.isa(Int)); say now - INIT now
23:15 camelia rakudo-moar 0e50993f4: OUTPUT: «1000␤0.0067902␤»
23:15 timotimo m: say +(1 xx 1000).grep(Int); say now - INIT now
23:15 camelia rakudo-moar 0e50993f4: OUTPUT: «1000␤0.00549737␤»
23:16 timotimo that's more than i expected
23:19 HoboWithAShotgun i now have subset UA of List where { $_.grep(Units::Unit).elems == $_.elems };
23:20 timotimo probably faster than looking for none(Units::Unit) and seeing if that's positive
23:20 timotimo perhaps something with .first and the negation would be better? not sure if the grep there uses a count-only thing
23:21 timotimo if you have negation and check for booleanness, it only has to pull a single value, which means if there's a wrong value somewhere near the beginning it'll immediately reject
23:22 * HoboWithAShotgun adds a comment: todo: performance
23:27 rjbs AlexDaniel: Thanks.
23:30 Redrield joined #perl6
23:32 Redrield Is there something that I could add to neovim to get Neomake lints for Perl 6?
23:38 dct joined #perl6
23:44 mcmillhj joined #perl6
23:47 ryn1x joined #perl6
23:47 ryn1x_ joined #perl6
23:47 ryn1x__ joined #perl6
23:47 AndChat|688961 joined #perl6
23:50 lizmat joined #perl6
23:54 callyalater left #perl6
23:58 ryn1x joined #perl6
23:58 ryn1x_ joined #perl6
23:58 ryn1x__ joined #perl6

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

Perl 6 | Reference Documentation | Rakudo