Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-10-31

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 rindolf joined #perl6
00:31 Cabanossi joined #perl6
00:41 perlawhirl I don't even understand what to the final output was supposed to be. Did he wan to combine @a and @b and get 27 elems?
00:48 perlawhirl .tell Thrush @b.map( |(@a X |*) )
00:48 yoleaux perlawhirl: I'll pass your message to Thrush.
00:52 Herby__ joined #perl6
01:01 BenGoldberg joined #perl6
01:01 Cabanossi joined #perl6
01:14 colomon_ joined #perl6
01:31 Cabanossi joined #perl6
01:41 Ben_Goldberg joined #perl6
01:48 mcmillhj joined #perl6
01:59 awwaiid joined #perl6
02:08 COMBORICO joined #perl6
02:09 COMBORICO Why is A < a == True ?
02:10 COMBORICO I mean what is the reason purpose. It seems counter intuitive.
02:13 raiph m: say 'A' lt 'a' # True <-- is this what you mean?
02:13 camelia rakudo-moar 8a0eb7fa6: OUTPUT: «True␤»
02:14 wamba joined #perl6
02:14 raiph (if so, then cuz ASCII)
02:14 COMBORICO Raiph, I'm confused.
02:14 COMBORICO Ohh! Ascii! I forgot about that.
02:15 COMBORICO Thanks!
02:21 cdg joined #perl6
02:28 araujo joined #perl6
02:28 araujo joined #perl6
02:31 Cabanossi joined #perl6
02:32 bitrauser joined #perl6
02:35 aindilis joined #perl6
02:38 cdg joined #perl6
02:55 mson joined #perl6
02:56 ilbot3 joined #perl6
02:56 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!
02:58 colomon joined #perl6
03:01 Cabanossi joined #perl6
03:30 riatre joined #perl6
03:30 noganex_ joined #perl6
03:40 Mrofnet joined #perl6
03:50 noganex joined #perl6
04:15 napo1eon joined #perl6
04:20 noganex_ joined #perl6
04:21 Merfont joined #perl6
04:22 shadoxx joined #perl6
04:23 titsuki joined #perl6
04:31 Cabanossi joined #perl6
04:44 Cabanossi joined #perl6
04:51 schelcj joined #perl6
05:22 Geth ¦ doc/W4anD0eR96-patch-1: 0fcc648cab | (Alex Chen)++ (committed using GitHub Web editor) | doc/Language/regexes.pod6
05:22 Geth ¦ doc/W4anD0eR96-patch-1: Rewrite the document of Longest Alternation: C<|>
05:22 Geth ¦ doc/W4anD0eR96-patch-1:
05:22 Geth ¦ doc/W4anD0eR96-patch-1: Review needed.
05:22 Geth ¦ doc/W4anD0eR96-patch-1:
05:22 Geth ¦ doc/W4anD0eR96-patch-1: Try to close
05:22 Geth ¦ doc/W4anD0eR96-patch-1: review: https://github.com/perl6/doc/commit/0fcc648cab
05:23 Geth ¦ doc: W4anD0eR96++ created pull request #1640: Rewrite the document of Longest Alternation: C<|>
05:23 Geth ¦ doc: review: https://github.com/perl6/doc/pull/1640
05:26 Geth ¦ doc/W4anD0eR96-patch-1: bc84b2c64e | (Alex Chen)++ (committed using GitHub Web editor) | doc/Language/regexes.pod6
05:26 Geth ¦ doc/W4anD0eR96-patch-1: Update regexes.pod6
05:26 Geth ¦ doc/W4anD0eR96-patch-1: review: https://github.com/perl6/doc/commit/bc84b2c64e
05:30 Cabanossi joined #perl6
05:34 jaush joined #perl6
05:37 jaush like a small child bouncing up and down outside the not-yet-open sweets shop, i must ask:  when does rakudo star 2017.10 open for business?
05:44 wander joined #perl6
05:59 Cabanossi joined #perl6
06:04 cpage_ joined #perl6
06:13 shmibs joined #perl6
06:17 sena_kun joined #perl6
06:25 raydiak__ joined #perl6
06:26 darutoko joined #perl6
06:31 nadim joined #perl6
06:31 todd joined #perl6
06:32 todd Hi All,  I question on "if".  Is there a wasy to shorten the following "if"?
06:32 todd if ( $x ~~ /"<html>"/ && $x ~~ /"<body>"/ && $x ~~ /"</html>"/ and $x ~~ /"</body>"/ )
06:32 todd Any way to only say `$x ~~` once?
06:37 Piotr_ joined #perl6
06:41 geekosaur you can distribute the && inside the ~~
06:41 geekosaur m: my $b = '<html><body></body></html>'; say so $b ~~ (/"<html>"/ && /"</body>"/)
06:41 camelia rakudo-moar 8a0eb7fa6: OUTPUT: «True␤»
06:42 geekosaur m: my $b = '<html><body></body></html>'; say so $b ~~ (/"<html>"/ && /"</boxy>"/)
06:42 camelia rakudo-moar 8a0eb7fa6: OUTPUT: «False␤»
06:48 El_Che jaush: it's already released!
06:50 El_Che jaush: depending on your operating system may be available. I released Linux packages yesterday (https://github.com/nxadm/rakudo-pkg). Rakudo Star released a Release Candidate
06:50 El_Che hombrew on mac is very quick in releasing builds as well
06:51 todd This is the whole line:
06:51 todd $ perl6 -e 'my $x="<html><br>\n<body><br>\nblah blah blah<br>\n</body><br>\n</html><br>\n"; if ( $x ~~ /"<html>"/ && $x ~~ /"<body>"/ && $x ~~ /"</html>"/ and $x ~~ /"</body>"/ ) { say "yes";} else { say "no";}'
06:52 geekosaur was there a problem with my suggestion?
06:53 todd I am looking at string full of html code.  If I find<html>, <body>,</html>,</body>, my if statement is to presume it is properly formatted html.  These four tests will not be in a row, but separated by many lines inside the string.
06:53 todd $b = '<html><body></body></html>'   look like everything had to be in a row, not scatters all over the string.  Am I mistaken?
06:53 jaush El_Che:  i reside in the Land of Windows :/
06:54 geekosaur that weas the test string
06:54 geekosaur it doesn;t have to be in order
06:54 todd opps.  Did not look close enough.  wait before responding
06:54 geekosaur $b ~~ (/"<html>"/ && /"</boxy>"/) # doesn't check order, just that each one matches
06:55 geekosaur er, grabbed the wrong one. but still
06:55 todd That did the trick.  Than y oU!
06:55 todd $ perl6 -e 'my $x="<html><br>\n<body><br>\nblah blah blah<br>\n</body><br>\n</html><br>\n"; if $x ~~ ( /"<html>"/ && /"<body>"/ && /"</html>"/ && /"</body>"/ ) { say "yes";} else { say "no";}' yes
06:57 cgfbee joined #perl6
06:58 todd And I wrote it down, so I don't have to ask it again!
06:58 Actualeyes joined #perl6
06:59 todd Another question: how do I capture a pipe in a line liner?
06:59 todd ecoh "abc" | perl6 -e 'say "the pipe was ????";'
06:59 todd echo nor ecoh
07:02 todd one liner.  Man I make a lot of typos
07:02 geekosaur read from $*IN or possibly $*ARGFILES depending on whether you might also want to do command line parameters
07:03 moritz slurp()
07:03 moritz or lines()
07:03 moritz or get()
07:03 geekosaur ^ ways to 'read from'
07:08 todd $ echo "abc" | perl6 -e 'say "the pipe was $*IN";' the pipe was <STDIN>  $ echo "abc" | perl6 -e 'say "the pipe was " ~ $*IN.lines;' the pipe was abc  $ echo "abc\ndef" | perl6 -e 'say "the pipe was " ~ $*IN.lines;' the pipe was abc\ndef  $ echo "abc\ndef" | perl6 -e 'my $x=get(); say "the pipe was $x";' the pipe was abc\ndef  $ echo "abc\ndef" | perl6 -e 'my $x=slurp(); say "the pipe was $x";' the pipe was abc\ndef   Note the extra line
07:08 todd That did not format too well, but every suggestion worked.  "slurp" gave me an extra line.  What was that about?
07:09 sjn todd: slurp reads everything in one go
07:09 moritz todd: echo appends a newline
07:09 sjn no splitting on lines
07:09 moritz slurp included it
07:09 moritz get and lines remove it
07:09 geekosaur and say added its own newline
07:11 geekosaur (for things like this, it can be useful to bracket or delimit the output so you can see what's part of that and what's part of the fixed output e.g. "the pipe was |$x|"
07:13 todd Ah Ha!  This shows it very clearly.
07:13 todd ls *Test.pl6* | perl6 -e 'my $x=slurp(); say "$x";'
07:14 jaush goodnight #perl6
07:14 moritz or say $x.perl
07:15 moritz good morning jast
07:15 geekosaur or dd, etc.
07:15 todd If I want keep the formatting of the bash command, I would use "slurp".  If I only wanted the raw data, I would use "lines".  $x=$*IN.slubp also keeps teh format.
07:15 moritz erm, jaush
07:15 moritz sorry
07:22 ChoHag joined #perl6
07:22 todd Ah had.  the deliter || adn {} both work to keep the format:
07:22 todd $ ls *Test.pl6* | perl6 -e 'my $x=$*IN.slurp; say "the pipe was {$x}";'
07:22 todd Question: was the format always there, just that say reacted differently to it?
07:23 geekosaur that actually surprises me, {} is normally arbitrary interpolation and shouldn't be visible in output
07:24 todd oops, I used slurp.  the demiters did not work to retain the format
07:24 geekosaur slurp grabs everything as one string which may have newlines in it
07:25 geekosaur the || I suggested was just show which newlines are in $x and which were added by e.g. say
07:25 todd I can see where I would want that at times!
07:25 todd I understand
07:25 geekosaur and .lines gives you an array of lines, each with the trailing newline removed
07:26 todd I am not gettting that with "lines"
07:26 todd ls *Test.pl6* | perl6 -e 'my $x=$*IN.lines; say "the pipe was $x";'
07:26 todd the pipe was CallFrameTest.pl6 CommandLineTest.pl6 CurlUtilsTest.pl6 FileTest.pl6 HashIndexTest.pl6 InlineTest.pl6 LogTest.pl6 LogTest.pl6.log MonthTest.pl6 RunNoShellTest.pl6 ShArTest.pl6 SubTest.pl6 TermTest.pl6 Timo.Attachmnet.Test.pl6 X11Clipboard.Test.pl6 X11Test.pl6 Xlib.Test.pl6
07:26 todd oops missed the :newlines removed"
07:27 geekosaur also that $x has an array in it, and it stringifies to concatenating them all with no delimiter
07:28 geekosaur oh, with a space between, sorry
07:28 geekosaur m: my $x = <a b c>; say $x.Str
07:28 camelia rakudo-moar 8a0eb7fa6: OUTPUT: «a b c␤»
07:29 todd Got it!
07:29 todd ls *Test.pl6* | perl6 -e 'my @x=$*IN.lines; for @x { say $_ };'
07:30 Cabanossi joined #perl6
07:31 todd Thank you all.  You guys saved me about two hours of head banging!  Bye bye
07:35 abraxxa joined #perl6
07:42 rindolf joined #perl6
07:43 eugene_barsky joined #perl6
07:53 Actualeyes /&
07:58 domidumont joined #perl6
08:00 Cabanossi joined #perl6
08:01 parv joined #perl6
08:04 domidumont joined #perl6
08:22 jameslenz joined #perl6
08:26 abraxxa joined #perl6
08:45 Cabanossi joined #perl6
08:50 sproctor joined #perl6
08:50 domidumont joined #perl6
08:56 sproctor joined #perl6
08:59 moritz can anybody from the US or UK please check if you see a kindle version for preorder at https://www.amazon.com/Parsing-Perl-Regexes-Grammars-Recursive/dp/1484232275/ ?
09:04 moritz my first book wasn't available as an ebook from all countries, so I want to catch it early this time
09:04 moritz ... if it is indeed a problem
09:07 parv moritz, i see only the option of paperback (w/ note of being not released yet) in US
09:09 wander joined #perl6
09:11 moritz parv: ok, thanks
09:12 parv moritz, happy to help
09:15 cono same here (Ukraine)
09:18 robertle joined #perl6
09:20 pmurias joined #perl6
09:22 wander it docs "As with Perl 6, in general, comments in regexes start with a hash character # and go to the end of the line."
09:22 wander is this sentence worthy?
09:22 wamba joined #perl6
09:23 DrForr moritz - I see only Paperback Dec 29th here from .cz.
09:23 moritz DrForr, cono: thanks
09:24 DrForr English language, not logged in althoguh I have an account. And price in USD for that matter.
09:24 moritz wander: sounds OK
09:24 wander it is right, but feels redundant
09:25 moritz why?
09:25 moritz PCRE doesn't have comments in regexes
09:25 moritz so it makes sense mentioning it
09:25 moritz you can try to make it more concise if you want
09:27 wander ok
09:27 wander m: say "abc" ~~ /abc #`()/
09:27 camelia rakudo-moar e95b02f15: OUTPUT: «「abc」␤»
09:27 wander m: say "abc" ~~ /abc # something /
09:27 camelia rakudo-moar e95b02f15: OUTPUT: «5===SORRY!5===␤Regex not terminated.␤at <tmp>:1␤------> 3say "abc" ~~ /abc # something /7⏏5<EOL>␤Unable to parse regex; couldn't find final '/'␤at <tmp>:1␤------> 3say "abc" ~~ /abc # something /7⏏5<EOL>␤    expecting any…»
09:28 wander I think the form  #`() is more worthy to mention, not just as what it docs
09:28 wander that's why I think the doc strange
09:28 moritz the docs are meant to be comprehensive
09:29 moritz so it should mention both
09:29 wander agree
09:29 pmurias moritz: doesn't PCRE have (?#...)?
09:30 Cabanossi joined #perl6
09:30 wander leave for a moment
09:31 moritz pmurias: ah, you're right
09:32 moritz still, different enough from #\N*$$ to make it worth mentioning
09:32 Merfont joined #perl6
09:32 pmurias moritz: #\N*$$ is allowed with a x modifier
09:33 moritz pmurias: right, but that's Perl 5 regex, not PCRE :-)
09:33 pmurias moritz: doesn't PCRE have a x modifier?
09:34 moritz and only as long as it doesn't contain the closing character for the regex, or some such
09:35 moritz "man 3 pcrepattern" talks about it as being a compile-time decision
09:35 moritz ah
09:35 moritz If  a  pattern  is  compiled with the PCRE_EXTENDED option, most white space in the pattern
09:35 moritz (other than in a character class), and characters between a # outside a character class and
09:35 moritz the  next  newline,  inclusive, are ignored. An escaping backslash can be used to include a
09:36 moritz white space or # character as part of the pattern.
09:36 moritz pmurias++
09:37 roguelazer joined #perl6
09:38 jercos joined #perl6
09:39 cdg joined #perl6
09:45 mcmillhj joined #perl6
09:48 TheGrimFandango joined #perl6
09:49 cog_ joined #perl6
09:52 cog__ joined #perl6
09:53 wamba joined #perl6
09:58 aborazmeh joined #perl6
09:58 aborazmeh joined #perl6
09:59 noganex joined #perl6
10:00 cpage__ joined #perl6
10:00 Cabanossi joined #perl6
10:01 perlpilot_ joined #perl6
10:01 aeruder_ joined #perl6
10:01 jonas1 joined #perl6
10:01 atta joined #perl6
10:01 kaare_ joined #perl6
10:01 jdv79_ joined #perl6
10:02 cgfbee joined #perl6
10:03 roguelazer joined #perl6
10:04 coverable6 joined #perl6
10:04 unicodable6 joined #perl6
10:04 evalable6 joined #perl6
10:05 eliasr joined #perl6
10:06 shmibs joined #perl6
10:09 roguelazer joined #perl6
10:09 perlawhirl joined #perl6
10:12 shmibs joined #perl6
10:14 TheGrimFandango joined #perl6
10:16 TheGrimFandango joined #perl6
10:17 roguelazer joined #perl6
10:18 TheGrimFandango joined #perl6
10:20 TheGrimFandango joined #perl6
10:25 ChoHag joined #perl6
10:30 Cabanossi joined #perl6
10:34 TheGrimFandango joined #perl6
10:36 gugod joined #perl6
10:36 TheGrimFandango joined #perl6
10:46 wander joined #perl6
10:46 wander I've seen "Next #Rakudo #Perl6 SQUASHathon is in 7 days and ≈17 hours (2017-11-04 UTC-12⌁UTC+14)"
10:47 wander To introduce it to my friends, I wonder what is the exact time it starts
10:48 wander or it is a loose restriction
10:51 geekosaur joined #perl6
10:51 wander .ask AlexDaniel` ^^
10:51 yoleaux wander: I'll pass your message to AlexDaniel`.
10:51 AlexDaniel squashable6: next
10:51 squashable6 AlexDaniel, ⚠🍕 Next SQUASHathon in 2 days and ≈23 hours (2017-11-04 UTC-12⌁UTC+14). See https://github.com/rakudo/rakudo/wiki/Monthly-Bug-Squash-Day
10:53 AlexDaniel wander: it's an all-timezone thing :) So technically it lasts for 50 hours so that people in all timezones can squash bugs for their whole Saturday
10:53 wander got it, thank you
10:55 margeas joined #perl6
11:08 TheGrimFandango joined #perl6
11:10 TheGrimFandango joined #perl6
11:12 TheGrimFandango joined #perl6
11:14 TheGrimFandango joined #perl6
11:17 sena_kun joined #perl6
11:19 wander I've write an essay to introduce the SQUASHathon in zh_CN at https://zhuanlan.zhihu.com/p/30618098
11:21 wander I'll appreciate if someone reviews it and corrects the improper express
11:22 cpage joined #perl6
11:22 zakharyas joined #perl6
11:22 TheGrimFandango joined #perl6
11:24 TheGrimFandango joined #perl6
11:34 TheGrimFandango joined #perl6
11:36 TheGrimFandango joined #perl6
11:39 ChoHag joined #perl6
11:40 harrison joined #perl6
11:42 cognominal joined #perl6
11:45 Cabanossi joined #perl6
11:49 AlexDaniel wander: I've added a link to your blog post here: https://github.com/rakudo/rakudo/wiki/Monthly-Bug-Squash-Day
11:50 wander thank you
11:50 AlexDaniel wander: feel free to edit that page, I think you should have access to do it
11:51 wander :-)
11:52 TheGrimFandango joined #perl6
11:54 TheGrimFandango joined #perl6
11:56 TheGrimFandango joined #perl6
11:58 TheGrimFandango joined #perl6
12:01 mcmillhj joined #perl6
12:10 TheGrimFandango joined #perl6
12:11 tyil wander: are you W4anD0eR96 on github? :>
12:11 wander yes
12:11 tyil I left some remarks on your latest PR
12:11 tyil thanks for all your contributions thus far, I hope I'm not too hard on you
12:11 wander I see, thank you
12:12 wander of course not. your review is quite helpful
12:12 tyil ^_^
12:12 TheGrimFandango joined #perl6
12:14 TheGrimFandango joined #perl6
12:16 TheGrimFandango joined #perl6
12:18 TheGrimFandango joined #perl6
12:20 TheGrimFandango joined #perl6
12:21 mcmillhj joined #perl6
12:23 bjz joined #perl6
12:24 Actualeyes joined #perl6
12:29 number8 joined #perl6
12:43 mcmillhj joined #perl6
12:45 Cabanossi joined #perl6
12:47 APic joined #perl6
12:51 cdg joined #perl6
12:52 rgrau joined #perl6
12:55 cdg joined #perl6
12:56 TheGrimFandango joined #perl6
12:58 TheGrimFandango joined #perl6
13:12 pecastro joined #perl6
13:12 mson joined #perl6
13:13 knight__ joined #perl6
13:13 knight__ m: class a { has %.b;}; my $c = a.new; say $c.b.defined;
13:13 camelia rakudo-moar 2f963b14a: OUTPUT: «True␤»
13:13 knight__ m: class a { has $.b;}; my $c = a.new; say $c.b.defined;
13:13 camelia rakudo-moar 2f963b14a: OUTPUT: «False␤»
13:14 knight__ Hmm, why is difference between hash/ scalar?
13:14 jnthn Because a % variable is always initialized with an empty Hash
13:17 knight__ jnthn: I understand, but for me is this slightly strange.
13:18 TheGrimFandango joined #perl6
13:19 perlpilot joined #perl6
13:20 TheGrimFandango joined #perl6
13:34 mcmillhj joined #perl6
13:37 Geth ¦ doc/W4anD0eR96-patch-1: 7e878dd4c6 | (Alex Chen)++ (committed using GitHub Web editor) | doc/Language/regexes.pod6
13:37 Geth ¦ doc/W4anD0eR96-patch-1: Update regexes.pod6
13:37 Geth ¦ doc/W4anD0eR96-patch-1: review: https://github.com/perl6/doc/commit/7e878dd4c6
13:38 TheGrimFandango joined #perl6
13:40 wander m: class a { has $.b;}; my $c = a.new; say $c.b;
13:40 camelia rakudo-moar 2f963b14a: OUTPUT: «(Any)␤»
13:40 wander m: class a { has @.b;}; my $c = a.new; say $c.b;
13:40 camelia rakudo-moar 2f963b14a: OUTPUT: «[]␤»
13:40 wander m: class a { has %.b;}; my $c = a.new; say $c.b;
13:40 camelia rakudo-moar 2f963b14a: OUTPUT: «{}␤»
13:41 wander .tell knight__ ^^ what it is initialized
13:41 yoleaux wander: I'll pass your message to knight__.
13:43 fatguy joined #perl6
13:44 fatguy how can i call subroutine using $sigil e.g my $s="my_function"; sub my_function {return "halo"}; say &$s ????
13:45 timotimo you want ::($s)()
13:45 Cabanossi joined #perl6
13:45 timotimo oh
13:45 timotimo but you have to put a & in front of the name
13:45 timotimo so either have $s be "&my_function" or use ::("&" ~ $s)()
13:46 fatguy timotimo: thanks, that's exactly i want !
13:53 mempko joined #perl6
13:53 moritz or use &::($s)()
13:54 timotimo oh, good point
13:56 wander joined #perl6
14:01 khw joined #perl6
14:05 raschipi joined #perl6
14:06 Khisanth joined #perl6
14:07 harrison joined #perl6
14:14 stmuk eek GH is Halloween themed
14:15 ilmari where?
14:17 mcmillhj joined #perl6
14:21 raschipi squashable6: next
14:21 squashable6 raschipi, ⚠🍕 Next SQUASHathon in 2 days and ≈19 hours (2017-11-04 UTC-12⌁UTC+14). See https://github.com/rakudo/rakudo/wiki/Monthly-Bug-Squash-Day
14:27 stmuk the dots are pumpkin coloured
14:28 COMBORICO joined #perl6
14:30 COMBORICO I'm just wondering why "where" was created when it seems "if" could have done the job:
14:31 COMBORICO sub foo( Int $bar where $n >= 0 ) { .... }
14:33 raschipi COMBORICO, Perl6 has a design rule that says that different things should be different
14:33 raschipi That's not an if, therefore it has a different name
14:34 [Coke] squash a thon edit: if there's a lot of discussion on a ticket, don't necessarily create a new ticket; Add a summary comment saying "here is what is left to do to resolve this issue".
14:34 raschipi [Coke]: What about tickets that need to be split?
14:35 COMBORICO sub foo( Int $bar if $n >= 0 ) doesn't this logically mean the same statement?
14:35 raschipi Nope, very different under the hood.
14:36 COMBORICO Hmm.  I'll need to meditate on this.  Thank you for your response.
14:37 raschipi COMBORICO: the type system is mostly enforced by the optimizer
14:37 raschipi Well, I'm not very familiar with it, but that's what I heard
14:40 COMBORICO What is the optimizer? (I did a search already.)
14:42 raschipi the optimizer is a part of the compiler that takes code and turns it into different (meaning better) code.
14:45 Cabanossi joined #perl6
14:48 raschipi COMBORICO: C++ has an optimizer too, it's not something Perl specific. It's the -O option for CC.
14:50 COMBORICO Hmm. I've never run into that topic in the beginner programming book i read.  It was probably too old of a book (1998).
14:50 ugexe it doesn't make sense if you consider multidispatch, in which case maybe a switch statement would technically be ok since it can fall through, but definitely not an if statement
14:51 mr-foobar joined #perl6
14:52 [Coke] raschipi: splitting tickets is fine, sure.
14:53 DrForr https://stackoverflow.blog/2017/10/31/disliked-programming-languages/
14:54 DrForr prepare for an onslaught, or at least a mild drizzle of trolling.
14:54 bdmatatu joined #perl6
14:58 darkmorph joined #perl6
15:01 ugexe some trolling surely... who dislikes delphi for anything other than the pricing
15:04 zakharyas joined #perl6
15:06 ugexe visual basic has 80% dislike but is in a different table
15:06 raschipi Pricing is a way deeper issue than you imagine, it becomes ugly when people write applications in delphi and then stop paying for decades but depend on the application just the same.
15:13 ugexe its not their fault someone stops paying. the real problem is it creates a barrier to entry, but this is not a problem in enterprise immediately (talent in this area will grow slower due to barrier to entry)
15:14 raschipi I'm dealing with enterprise here. It's a mess. Enterprise mean damaged goods most of the time.
15:14 raschipi In my experience at least
15:15 ugexe it usually means goods that are making money, and with that comes the fact you can typical get the licenses/support you need paid for
15:15 raschipi If it at least went through the IT department.
15:16 ugexe the code being shit or not doesn't really matter in this sense, although yeah enterprise code is usually what people have nightmares of
15:17 raschipi sure, but there is a fundamental problem with delphi that causes endless headaches, so that's why people dislike it.
15:23 callyalater joined #perl6
15:24 epony joined #perl6
15:26 raschipi m: my @a = Nil, |<a b c>
15:26 camelia rakudo-moar 2f963b14a: ( no output )
15:27 ugexe m: say my @a = Nil, |<a b c>
15:27 camelia rakudo-moar 2f963b14a: OUTPUT: «[(Any) a b c]␤»
15:30 raschipi I changed to the REPL after writing that, thanks.
15:36 ugexe might be neat if camelia had REPL like function with like a 30s timeout, and global so all users in channel can build on the same program (for teaching, or as a game)
15:37 callyalater m: say 3 <=> 5;
15:37 camelia rakudo-moar 2f963b14a: OUTPUT: «Less␤»
15:40 Zoffix joined #perl6
15:43 zakharyas joined #perl6
15:44 TheGrimFandango joined #perl6
15:45 Cabanossi joined #perl6
15:46 wamba joined #perl6
15:48 Zoffix COMBORICO: there's some cross-over between `if` and `when` because they're general enough, but they perform fundamenally different things. `when` smartmatches the given conditional against the $_ topic variable, while `if` tests the conditional for truthiness. So for example, `$_ = "   "; 42.say when 0` would print 42, because `0` smartmatches numerically and white-space-only string is also zero. `42.say if 0`
15:48 TheGrimFandango joined #perl6
15:48 Zoffix on the other hand would never print 42, because 0 is false. Another case would be `$_ = 0; 42.say when 0 or 5`; naively that looks like a test for whether $_ is 0 or 5, but it's actually only testing for whether it's 5. Lastly, there's a difference in block forms: `$_ = 42; when 42 { .say }; say "never here"` will only print 42, because `when` bails out of the block when it matched something, while `$_ = 42;
15:48 Zoffix if $_ == 42 { .say }; say "never here"'` would print "never here"
15:49 Zoffix m: 0 does True; 42.say if 0 # well, it can print 42 in this case, but it's a hack :P
15:49 camelia rakudo-moar 2f963b14a: OUTPUT: «42␤»
15:54 COMBORICO Zoffix, why does your second example only tests for 5 and not 0?
15:55 TheGrimFandango joined #perl6
15:56 Zoffix COMBORICO: because the expression gets evaluated; 0 is false so the conditional evaluates to 5, and it's that 5 that's used for smartmatching.
15:56 Zoffix You can use a Junction to test for both:  `when 0|5 { ... }`
15:56 * Zoffix backlogs and nitpicks:
15:57 Zoffix .lines returns a Seq, not an Array. It's an important difference, as Seqs are lazy and improperly taking care of them from .lines (e.g. closing the handle before you iterated it) will cause issues
15:57 TheGrimFandango joined #perl6
15:58 ugexe didn't there used to be a .lines(:close)?
15:59 lizmat ugexe: indeed, but there was no way to make it close when you would stop reading before the last line read
16:00 ugexe ah, .close on anything lazy can't really work i suppose
16:00 Zoffix ugexe: it's still there, but it won't close until you iterate the Seq fully, so code `{ my $fh will leave {.close} = "foo".IO.open; return $fh.lines }` will crash if the returned Seq is riefied, 'cause the handle is closed already
16:02 Zoffix todd, FWIW, you can change $*IN.nl-in, to affect what get/lines split on. https://docs.perl6.org/type/IO::Handle#method_nl-in
16:04 Zoffix jaush, the compiler just got released and usually when Star release is planned, it follows in about 1-2 weeks afterwards. There's already a Release Candidate available that you can help test: http://pl6anet.org/drop/
16:04 * Zoffix &
16:04 Zoffix left #perl6
16:06 COMBORICO Zoffix, okay; i understand now that 'when' bails when matched, and 'if' continues on to the rest of the statement.  What is this m: notation people keep using? (I didn't understsnd the hack.)
16:06 COMBORICO (no need to explain hack, as i barley got through the initial explanation.)
16:11 stmuk moritz: I see "pre-order" US Amazon and "Currently Unavailable" UK
16:11 moritz stmuk: thanks!
16:12 Redrield_ joined #perl6
16:12 Redrield_ Can I use libraries from cpan in perl 6?
16:13 Redrield_ I need to interact with inotify but I couldn't find anything that does that in the perl 6 module directory
16:13 aindilis joined #perl6
16:14 Zoffix joined #perl6
16:14 ilmari you can use Inline::Perl5, but if the Perl5 module just wraps a C library, it's probably better to use NativeCall to call that directly
16:14 ugexe m: use JSON:from<Perl5>;
16:14 camelia rakudo-moar 2f963b14a: ( no output )
16:16 Zoffix COMBORICO: the `m: ` is the eval bot trigger. The hack is using `does` infix operator to mix-in a role that overrides `.Bool` method on `0` object to return `True` and since integer constants 0-100 are cached, the second 0 in the `if` statement gets that modification and when `if` calls .Bool on it, it returns True instead of normal False
16:17 Zoffix COMBORICO: and to clarify: the block form of `when` (e.g. `when 42 {...}`) bails out; the postfix form (e.g. `... when 42`) does not
16:19 Piotr_ joined #perl6
16:19 COMBORICO Bot trigger. Hmm.  So it is a remote Perl 6 terminal?
16:20 moritz m: say 'Hello, COMBORICO'
16:20 camelia rakudo-moar 2f963b14a: OUTPUT: «Hello, COMBORICO␤»
16:20 moritz yes, but it's stateless (so it doesn't remember variables from previous executions)
16:20 moritz so it's a very simple thing
16:20 COMBORICO Oh. I see.
16:21 COMBORICO I remember typing in code, and the bot was triggered by just that.
16:22 Zoffix Yeah, there's another bot that heuristically triggers for some code
16:22 Zoffix say 42
16:22 evalable6 Zoffix, rakudo-moar c1867ba19: OUTPUT: «42»
16:23 TheGrimFandango joined #perl6
16:24 ilmari m: my %h<foo bar baz> = 1..3;
16:24 camelia rakudo-moar 2f963b14a: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Shaped variable declarations not yet implemented. Sorry.␤at <tmp>:1␤------> 3my %h<foo bar baz>7⏏5 = 1..3;␤»
16:25 TheGrimFandango joined #perl6
16:25 moritz m: my %h = (%<foo bar baz> = 1..3); say %h
16:25 camelia rakudo-moar 2f963b14a: OUTPUT: «Use of Nil in string context␤  in block <unit> at <tmp> line 1␤Died with X::Hash::Store::OddNumber␤  in block <unit> at <tmp> line 1␤␤»
16:25 Zoffix m: (my %h)<foo bar baz> = 1..3;
16:25 camelia rakudo-moar 2f963b14a: ( no output )
16:25 callyalater say "Hello!"
16:25 evalable6 callyalater, rakudo-moar c1867ba19: OUTPUT: «Hello!»
16:25 moritz m: my %h = <foo bar baz> Z=> 1..3; say %h
16:25 camelia rakudo-moar 2f963b14a: OUTPUT: «{bar => 2, baz => 3, foo => 1}␤»
16:26 ilmari nice
16:26 Zoffix m: my %h = 1..3 RZ <foo bar baz>; say %h
16:26 camelia rakudo-moar 2f963b14a: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Missing infix inside R␤at <tmp>:1␤------> 3my %h = 1..3 RZ7⏏5 <foo bar baz>; say %h␤    expecting any of:␤        infix␤        infix stopper␤»
16:26 Zoffix m: my %h = 1..3 RZ, <foo bar baz>; say %h
16:26 camelia rakudo-moar 2f963b14a: OUTPUT: «Odd number of elements found where hash initializer expected:␤Found 3 (implicit) elements:␤Last element seen: $("baz", 3)␤  in block <unit> at <tmp> line 1␤␤»
16:26 Zoffix :(
16:27 ilmari m: my %h = 1..3 RZ=> <foo bar baz>; say %h
16:27 camelia rakudo-moar 2f963b14a: OUTPUT: «{bar => 2, baz => 3, foo => 1}␤»
16:27 Zoffix Ahh
16:27 raschipi m: my %h = 1..3 RZ=> <foo bar baz>; say %h
16:27 camelia rakudo-moar 2f963b14a: OUTPUT: «{bar => 2, baz => 3, foo => 1}␤»
16:27 raschipi ops, dupe
16:27 ilmari m: my %h = 1..3 ZR=> <foo bar baz>; say %h
16:28 camelia rakudo-moar 2f963b14a: OUTPUT: «{bar => 2, baz => 3, foo => 1}␤»
16:28 eythian joined #perl6
16:28 eythian joined #perl6
16:28 dalek joined #perl6
16:28 synopsebot joined #perl6
16:29 callyalater It looks like the zip and reverse operators (is that what they would be called?) can be put in any order (ie. `RZ=
16:30 callyalater RZ=> or ZR=>
16:30 Zoffix metaoperators yeah
16:30 Zoffix m: my %h = 1..3 ZRRRRRRRRRRRRRRRRR=> <foo bar baz>; say %h # can even do this :P
16:30 camelia rakudo-moar 2f963b14a: OUTPUT: «{bar => 2, baz => 3, foo => 1}␤»
16:30 zostay omgosh... that is amazing lol
16:31 callyalater m: my %h = 1..3 ZR=> <foo bar baz>; say %h
16:31 camelia rakudo-moar 2f963b14a: OUTPUT: «{bar => 2, baz => 3, foo => 1}␤»
16:31 TheGrimFandango joined #perl6
16:31 callyalater m: my %h = 1..3 ZRR=> <foo bar baz>; say %h
16:31 camelia rakudo-moar 2f963b14a: OUTPUT: «{1 => foo, 2 => bar, 3 => baz}␤»
16:31 callyalater m: my %h = 1..3 ZRRR=> <foo bar baz>; say %h
16:31 camelia rakudo-moar c1867ba19: OUTPUT: «{bar => 2, baz => 3, foo => 1}␤»
16:31 callyalater m: my %h = 1..3 RZR=> <foo bar baz>; say %h
16:31 camelia rakudo-moar c1867ba19: OUTPUT: «{1 => foo, 2 => bar, 3 => baz}␤»
16:32 callyalater That is interesting.
16:32 Zoffix mm: my &infix:<♥> = &[ZRRRRRRRRRRRRRRRRR=>]; my %h = (1..3) ♥ <foo bar baz>; say %h # can even do this... :P
16:33 TheGrimFandango joined #perl6
16:33 callyalater m: my &infix:<♥> = &[ZRRRRRRRRRRRRRRRRR=>]; my %h = (1..3) ♥ <foo bar baz>; say %h # can even do this... :P
16:33 camelia rakudo-moar c1867ba19: OUTPUT: «{bar => 2, baz => 3, foo => 1}␤»
16:33 callyalater That is cool
16:33 callyalater m: my &infix:<♥> = &[ZRRRRRRRRRRRRRRRRR=>]; my %h = (1..3) R♥ <foo bar baz>; say %h
16:33 camelia rakudo-moar c1867ba19: OUTPUT: «{1 => foo, 2 => bar, 3 => baz}␤»
16:34 callyalater WOW!
16:34 callyalater I like it.
16:34 Geth joined #perl6
16:36 committable6 joined #perl6
16:37 TheGrimFandango joined #perl6
16:39 TheGrimFandango joined #perl6
16:39 tbrowder hi, #perl6, good <local-day-part> to you all!
16:39 Zoffix \o
16:41 mcmillhj joined #perl6
16:42 tbrowder hi, Zoffix! i’m lookng for a kind soul who will volunteer to critique my advent blog during its development prior to publishing at mignight utc on 3 dec.
16:43 tbrowder s/mig/mid/
16:44 * Zoffix is a bad critic, sorry.
16:45 tbrowder not so, Zoffix, but anyway you have too much on your plate all the time...
16:45 Zoffix :)
16:46 moritz tbrowder: I'll be happy to proof-read it for you
16:46 moritz the sooner you are done, the better :-)
16:49 tbrowder thanks, moritz. i have a draft started, and i would appreciate your thoughts on the general flow and bullet points, but not until i get it fleshed out a bit more—maybe in a few days.
16:50 khw joined #perl6
16:50 moritz tbrowder: sure, just ping me when you think it's ready
16:50 tbrowder roger, thnx
16:52 moritz fwiw I also have a first draft of my advent post sidding on my hard drive
16:53 moritz it's written as if my second book was already released, which I hope it will be by the time the advent calendar starts
16:53 moritz if not, I have to rewrite some portions :-)
16:53 raschipi moritz++
16:55 COMBORICO m: my $test = string; say substr "hello world" , 0 , 6; say $string;
16:55 Zoffix left #perl6
16:55 camelia rakudo-moar 0a8096989: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Variable '$string' is not declared. Did you mean 'Stringy'?␤at <tmp>:1␤------> 3; say substr "hello world" , 0 , 6; say 7⏏5$string;␤»
16:56 COMBORICO Don't laugh at me!
16:56 moritz nobody laughs. We've all been there.
16:57 COMBORICO Too long to type again on my phone.  I know i need to say $test.
16:57 ugexe for me its usually do I want subst or substr
16:57 timotimo Substr 2.0 Beta
16:57 COMBORICO Heh. Yeah. I was just kiddin' around.
16:58 COMBORICO Heh
16:58 raschipi COMBORICO: It would fail anyway, complaining it doesn't know a string subroutine.
16:58 COMBORICO "string", u happy? Haha.
16:58 moritz anyway, substr() doesn not modify in place
16:58 Geth ¦ mu: 76c5211554 | (Tom Browder)++ (committed using GitHub Web editor) | misc/perl6advent-2017/schedule
16:58 Geth ¦ mu: tweak title
16:58 Geth ¦ mu: review: https://github.com/perl6/mu/commit/76c5211554
16:59 raschipi I'm not the one you need to make happy, it's the compiler, ahahaha
16:59 COMBORICO I'm just trying to determine if substr is copy and paste or cut and paste.
16:59 moritz the former
16:59 COMBORICO Heh. True
16:59 COMBORICO Thanks.  Back to the book.
16:59 moritz m: my $x = 'abcdef'; say substr $x, 3; say $x
16:59 camelia rakudo-moar 0a8096989: OUTPUT: «def␤abcdef␤»
16:59 moritz COMBORICO: which book are you reading?
17:00 COMBORICO *grinning
17:00 COMBORICO Think Perl 6
17:00 moritz ah, good one
17:00 COMBORICO Yours is the Fundamental?
17:01 moritz yes
17:01 moritz and working on a book on regexes and grammars
17:02 raschipi moritz will make parsing easy for the first time ever, it will be a revolution in computer science
17:03 COMBORICO I will submit a VERY detailed review it this book in time.
17:04 * moritz chuckles
17:04 COMBORICO Of*
17:04 raschipi are you liking it?
17:05 COMBORICO Having already learned the fundamentals in C++ from Dietel, it is an okay book.  But for the first-timer, it is coming short.
17:06 kyan joined #perl6
17:10 moritz this inspires me to go off-topic a bit
17:10 moritz when writing documentation, or even books, I find it very hard to decide how detailed or how fast to describe something
17:10 COMBORICO Dietel (at least the father, I'm not sure about the son) has been the best book, though i also struggled and have complaints with his book.
17:11 moritz if you gloss over something, the less experienced readers will be confused or lost
17:11 moritz if you go into great detail, the more advanced readers will be bored
17:12 moritz and if you bore them too often, you lose them too
17:12 moritz but very often you don't even know those readers
17:12 COMBORICO I hated Stroustrupe's book for beginners.  I like to learn from seeing full programs, not just code snippets.
17:12 moritz so, I really want a technology-assisted solution to that
17:13 COMBORICO And i like to see the output of the program. Very helpful.
17:13 moritz sjn++ has been working on something related a while ago
17:13 moritz COMBORICO: you might like my style :-)
17:14 moritz here's an excerpt chapter: http://perltricks.com/article/plotting-with-perl-6/
17:14 COMBORICO Great detail and doses of repeating yourself in the immediate lesson, and also reminding the reader in subsequent chapters, is what i like.
17:14 moritz (though might a bit too far when you're in the early chapters of "Learning Perl 6")
17:16 COMBORICO Moritz, yes, i realized a few days ago that i should have picked yours.  I actually went to your perl6 book list, but i forgot about it. Then a few months later, I got some more books mainly concerning with networking and see, and I decided to pick up a pearl book, and somehow pink pearl 6 was purchased.
17:18 COMBORICO ( apologies for using voice recognition)
17:19 COMBORICO Yeah,  I think I was attracted to think Pearl 6 because the idea of learning from the ground up with a peeling.
17:19 COMBORICO Was appealing
17:20 COMBORICO Afk
17:20 raschipi away from voice recognition that is.
17:20 Ven joined #perl6
17:24 COMBORICO Heh yeah I was thinking the same thing. I just wanted to say that before I go so all this text is in one block. that I'm a different kind of reader than the typical programming a reader. I I hate math. Actually I don't hate math, math hates me. And so my style of writing these programming books is not easy exercises rather I'm just reading through them. I'm not sure exactly what kind of programmer or job I'm looking to get into tha
17:24 COMBORICO Is not to read I'm sorry is not to do the exercises
17:25 COMBORICO I understand that this is contrary to what most people say you should do.
17:25 COMBORICO This is the main reason that I like to go through full programs in textbooks, and why I like repetition especially in subsequent subsequent chapters
17:26 COMBORICO Afv
17:26 perllearner89 joined #perl6
17:29 knight__ joined #perl6
17:31 knight__ Hello, is there any kind of exception like ImportError in python. I would like to create try/catch when use 'use module', because I would like to print prettier error message, but I do not know how to catch this error.
17:31 yoleaux 13:41Z <wander> knight__: ^^ what it is initialized
17:31 knight__ ?
17:32 epony joined #perl6
17:33 knight__ Or what is the perl way to handle problem with dependencies...
17:33 moritz knight__: "use" is (unlike "import in python") compile-time, so you can't catch its errors with a runtime construct such as try
17:33 moritz knight__: you have to switch to "require" if you want custom error handling for it
17:34 AlexDaniel squashable6: next
17:34 squashable6 AlexDaniel, ⚠🍕 Next SQUASHathon in 2 days and ≈16 hours (2017-11-04 UTC-12⌁UTC+14). See https://github.com/rakudo/rakudo/wiki/Monthly-Bug-Squash-Day
17:36 knight__ moritz: Thanks
17:39 HoboWithAShotgun joined #perl6
17:39 HoboWithAShotgun g'day
17:43 raschipi day
17:53 rindolf HoboWithAShotgun: hi
17:53 callyalater I'm looking at the Metamodel::EnumHOW nqp class, but I can't get it to work like the Metamodel::ClassHOW nqp class. Is there any documentation about it?
17:56 COMBORICO joined #perl6
17:57 moritz callyalater: if there is none on docs.perl6.org, likely not
17:57 moritz callyalater: what exactly are you trying to do?
18:00 Cabanossi joined #perl6
18:07 mcmillhj joined #perl6
18:08 wamba joined #perl6
18:10 callyalater I'm looking at this question on StackOverflow: https://stackoverflow.com/questions/47033465/how-to-use-metaprogramming-to-create-an-enum-in-perl-6
18:10 darkmorph joined #perl6
18:14 troys joined #perl6
18:14 geekosaur I think enums are still a bit of a hack that requires nqp code to make work... and this hasn't been fixed because enums need to be rethought? (in particular, things tend to go wrong when the underlying type isn't Int iirc)
18:15 callyalater Dang.
18:16 callyalater On the perl6 website it has a deadlink to the Metamodel::EnumHOW class (see here: https://docs.perl6.org/language/typesystem#Metaclass)
18:17 raschipi m: say Order ~~ Enumeration; say Bool ~~ Enumeration; #Maybe it has to do with the fact that Bool is defined very early in NQP and that requires defining enum?
18:17 camelia rakudo-moar dcf3e28c5: OUTPUT: «True␤False␤»
18:17 zakharyas joined #perl6
18:17 AlexDaniel callyalater: indeed. Please file an issue for it on https://github.com/perl6/doc/issues/
18:17 moritz callyalater: I've added my answer on SO
18:18 Mrofnet joined #perl6
18:21 callyalater moritz: Awesome.
18:22 callyalater AlexDaniel: I filed an issue for it.
18:22 AlexDaniel callyalater++
18:23 moritz fwiw I read the source code from EnumeHOW.nqp, and used two of the first three methods in there :-)
18:26 callyalater moritz: I was looking at the source code as well, but was unable to get it to work properly.
18:31 Piotr_ joined #perl6
18:34 moritz some experience with the MOP certainly helps :-)
18:36 callyalater True. True.
18:37 domidumont joined #perl6
18:44 knight__ moritz: require, shall I make some change in some $PATH?
18:44 knight__ becauce when I change use -> require
18:44 moritz knight__: no. But you should be aware that require doesn't import any symbols by default
18:44 darkmorph joined #perl6
18:45 knight__ No such symbol
18:45 knight__ Yes :-)
18:45 knight__ I see
18:47 epony joined #perl6
18:48 epony joined #perl6
18:52 epony joined #perl6
18:53 COMBORICO I'm back.
18:53 knight__ Seems, I do not understand how it works. So, I am going out, thank you for today.
18:57 setty1 joined #perl6
19:04 Merfont joined #perl6
19:10 Voldenet m: say so "ą" eq [*.NFKD,*.NFC,*.NFD].map({ $^a("ą") }).all
19:10 camelia rakudo-moar dcf3e28c5: OUTPUT: «True␤»
19:10 Voldenet hm, this doesn't look the most succinct
19:11 Voldenet am I missing some trick to use here?
19:13 p6steve joined #perl6
19:14 moritz m: say "ą".NFD
19:14 camelia rakudo-moar dcf3e28c5: OUTPUT: «NFD:0x<0061 0328>␤»
19:15 moritz m: say "ą".NFD.Str
19:15 camelia rakudo-moar dcf3e28c5: OUTPUT: «ą␤»
19:15 moritz Voldenet: it seems that eq coerces its arguments to Str
19:15 moritz m: say "ą".NFD eqv "ą".NFC
19:15 camelia rakudo-moar dcf3e28c5: OUTPUT: «False␤»
19:15 Voldenet that's okay, that's what I wanted to show
19:16 [Coke] there is no shortcut for { stuff; CATCH { .message.note && exit 1 } } , is there?
19:21 moritz m: say so "ą" eq (.NFKD, .NFC, .NFD).all given "ą"; # another way to write it, for Voldenet
19:21 camelia rakudo-moar dcf3e28c5: OUTPUT: «True␤»
19:22 moritz m: say so "ą" eq <NFKD NFC NFD>.map({"ą"."$_"()).all
19:22 camelia rakudo-moar dcf3e28c5: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Missing block␤at <tmp>:1␤------> 3so "ą" eq <NFKD NFC NFD>.map({"ą"."$_"()7⏏5).all␤    expecting any of:␤        statement end␤        statement modifier␤        statement modifier l…»
19:22 moritz m: say so "ą" eq <NFKD NFC NFD>.map({"ą"."$_"()}).all
19:22 camelia rakudo-moar dcf3e28c5: OUTPUT: «True␤»
19:24 Voldenet I like the last one, but 'say so "ą" eq (.NFKD, .NFC, .NFD).all given "ą";' sounds more readable :P
19:25 Ven joined #perl6
19:26 moritz aye :-)
19:28 sjn is it possible to make a hyper operator out of . and a list of functions?
19:29 moritz if you have actual function objects, >>() or >>.() should invoke them
19:29 sjn something like... "ą" «.« NFD, NFC
19:30 moritz but there you only have method names
19:30 moritz m: say (&sin, &cos, &sqrt)».(0.5)
19:30 camelia rakudo-moar dcf3e28c5: OUTPUT: «(0.479425538604203 0.877582561890373 0.707106781186548)␤»
19:30 moritz m: say (&sin, &cos, &sqrt)»(0.5)
19:30 camelia rakudo-moar dcf3e28c5: OUTPUT: «No such method 'CALL-ME' for invocant of type 'Rat'␤  in block <unit> at <tmp> line 1␤␤»
19:31 moritz this tries a coercion, not an invocation, it seems
19:31 moritz so with . it is
19:31 telex joined #perl6
19:32 Voldenet m: say so "ą" eq [*.NFKD,*.NFC,*.NFD]».("ą").all
19:32 camelia rakudo-moar dcf3e28c5: OUTPUT: «True␤»
19:35 ChoHag joined #perl6
19:36 * gfldex issued that ENODOC
19:44 Cabanossi joined #perl6
19:45 COMBORICO Is it correct to say -> converts a variable into a topical variable?
19:45 moritz not really
19:45 moritz -> introduces a signature
19:46 moritz m: my $block = -> $a, $b { $a + $b }; say $block(1, 4)
19:46 camelia rakudo-moar dcf3e28c5: OUTPUT: «5␤»
19:46 COMBORICO Hmm. Okay.  I'll need to go more reviewing. Thanks.
19:47 moritz a construct like "for 1, 2, 3 -> $x { ... }" is "just" a special case of that syntax
19:49 COMBORICO Yes, that's the construct in question.
19:50 COMBORICO Pointy block introduces signatures?  I'll add this note into the book.
19:51 HoboWithAShotgun i'm lost. I want to pass a hashref as a positional argument to EXPORT.
19:52 HoboWithAShotgun but neither use Foo { :a(1) } nor use Foo %{ :a(1) } works
19:52 ugexe :a<1>
19:52 HoboWithAShotgun the first complains about the tag not existing (why does it even care? it's a psitional hashref),
19:53 HoboWithAShotgun the second doesnt even compile
19:53 ugexe ah i see, maybe ${}
19:53 TEttinger joined #perl6
19:53 HoboWithAShotgun "Could not evaluate arguments"
19:56 HoboWithAShotgun .oO( Raider heißt jetzt Twix )
19:58 geekosaur I think the syntax is not designed for your use case
19:58 p6steve joined #perl6
19:58 espadrine joined #perl6
19:58 COMBORICO moritz, how would you finish this? 'for 0..$fruit.chars - 1 -> $index' in English reads, " 4 through however many characters are in variable fruit (which is being determined by method chars) minus one, where index is BLANK by the pointy-block."
19:59 COMBORICO 4 = for
19:59 lizmat joined #perl6
20:00 cdg joined #perl6
20:05 moritz ... where $fruit is a parameter to the pointy block
20:06 moritz or ... where the index is passed to the pointy block
20:08 HoboWithAShotgun it works with a closure:
20:08 HoboWithAShotgun use Test::Color sub { :ok("blue on_green"), :nok("red on_white") };
20:09 geekosaur yes, it avoids the syntax that considers what you are doing a tag
20:09 HoboWithAShotgun i consider not being able to use a hashref a bug though
20:09 cdg joined #perl6
20:11 HoboWithAShotgun ok, cool. i am going to upload this within the hour
20:11 gfldex HoboWithAShotgun: this may help https://gfldex.wordpress.com/2016/01/18/a-story-of-export-and-indirection/
20:11 ivans joined #perl6
20:14 [Coke] "what's a hashref?"
20:15 [Coke] (I think that's a p5-ism that doesn't have a corresponding thing in six.)
20:19 HoboWithAShotgun m: my %hash = :a(1); my $hashref = %{ :a(1) }; %hash.perl.say; $hashref.perl.say
20:19 camelia rakudo-moar dcf3e28c5: OUTPUT: «{:a(1)}␤${:a(1)}␤»
20:20 ivans good morning
20:20 geekosaur it's not a hashref
20:20 geekosaur just a hash stored in a scalar
20:20 El_Che generics
20:21 El_Che oops
20:21 El_Che ignore
20:21 ivans #java is that way ----->
20:21 geekosaur *some* things wil lbehave like the p5-think you are using. and then you will get bitten hard when what they really refuses to play like p5 hashrefs
20:21 El_Che actually it was about c++ :)
20:21 ivans :o :D
20:21 ivans I thought generics is a forbidden word among c++ people
20:22 El_Che yes, exactly. That's why I used
20:22 HoboWithAShotgun exactly. it's a scalar
20:22 geekosaur uh
20:22 HoboWithAShotgun and therefore it must be a positional! argument when i say
20:22 geekosaur no
20:22 El_Che ivans: someone was explaining that to me without using the word generics :)
20:22 HoboWithAShotgun use Foo %{ :a };
20:23 HoboWithAShotgun but Perl interprets that as if i wrote use Foo :a;
20:23 geekosaur $ *defaults* to scalar. it can be whatever you put in it
20:23 HoboWithAShotgun that's abug
20:23 geekosaur and % doesn''t do what you think either
20:24 HoboWithAShotgun m: my $x = :a; say $x
20:24 camelia rakudo-moar dcf3e28c5: OUTPUT: «a => True␤»
20:25 COMBORICO I seem not to be able to use search at https://docs.perl6.org/ on my Android.
20:25 AlexDaniel joined #perl6
20:25 COMBORICO "Enter" is not executing the search.
20:26 COMBORICO Dolphin browser
20:27 ugexe m: BEGIN my $a = %(a => 1, b => 2); use Test $a, :DEFAULT;
20:27 camelia rakudo-moar dcf3e28c5: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Error while importing from 'Test':␤no EXPORT sub, but you provided positional argument in the 'use' statement␤at <tmp>:1␤------> 3%(a => 1, b => 2); use Test $a, :DEFAULT7⏏5;␤»
20:29 ugexe so if you also pass a named argument it seems to pick up that $a is positional
20:29 Zoffix joined #perl6
20:29 Zoffix COMBORICO: works for me. What search term are you using?
20:30 moritz that does looks kinda fishy for me
20:30 COMBORICO Pointy block
20:30 Zoffix COMBORICO: it displays results without pressing "ENTER"; just searches as you type
20:30 COMBORICO Oh!
20:30 Zoffix COMBORICO: for that term it shows a red "No search results" message right under the box. Does it show up for you?
20:30 geekosaur hm. javbascript disabled?
20:30 COMBORICO No
20:31 COMBORICO I don't know *blushing
20:32 COMBORICO I'll just use a search engine go-around. Thanks guys.
20:35 Zoffix COMBORICO: can't repro, sorry. Even set the most puritanical settings and it still worked. Perhaps your network is blocking some of the used resources vOv
20:37 COMBORICO Thanks for trying.
20:38 cdg_ joined #perl6
20:39 ugexe `BEGIN my $hash = %(:a<1>, :b<2>); use MyModule $hash, "\$var";` this seemed to work, where $var is one of the symbols it actually exports (e.g. a key of $hash) based on the example in https://docs.perl6.org/language/modules#EXPORT
20:39 [Coke] COMBORICO: what browser/OS?
20:39 [Coke] (any errors in the JS console?)
20:40 COMBORICO Dolphin Android version...
20:40 [Coke] ah, sorry, iphone stack here. :|
20:41 Zoffix ugexe: work how? It's still isn't passing the hash
20:42 Zoffix And it doesn't complain with `use Foo $bar` for me; so there's no reliance on also passing a named arg
20:42 ugexe yes it does: https://gist.github.com/
20:43 ugexe grr
20:43 ugexe https://gist.github.com/ugexe/ed706e8fd6131ed4f3836491525e807c
20:45 bajanme joined #perl6
20:45 Cabanossi joined #perl6
20:46 Zoffix ugexe: ah, I was using binding. If you bind instead of assign to $hash it ends up as `Any` and also works with just as `use Foo $hash;`
20:48 COMBORICO What is ~$0 in English?
20:48 koto joined #perl6
20:49 geekosaur the matched string from a regex, as a string instead of as a match object
20:49 [Coke] ~ is "convert to Str" (string)
20:49 Zoffix m: "foobar" ~~ /(.**3).+/; say $0; say ~$0
20:49 camelia rakudo-moar dcf3e28c5: OUTPUT: «「foo」␤foo␤»
20:50 COMBORICO Thank you. Must it always be 0? Or will ~$x work?
20:50 Zoffix COMBORICO: yes, the `~` is just a prefix operator that calls .Str
20:50 [Coke] m: my $x = 2e3; say ~$x;
20:50 camelia rakudo-moar dcf3e28c5: OUTPUT: «2000␤»
20:50 * Zoffix relocates
20:50 Zoffix left #perl6
20:51 knight__ joined #perl6
20:51 COMBORICO Larry Wall wasn't playing around when he said Perl 6 is operator-rich.
20:52 geekosaur COMBORICO, $0, $1, etc. will work. $x for some variable x will not; use $/[$x] instead
20:53 COMBORICO My face is melting.
20:53 COMBORICO Thanks, though.  So much going on.
20:55 mcmillhj joined #perl6
21:03 hankache joined #perl6
21:07 COMBORICO Zoffix, is .Str method the thing under-the-hood in string concatenation, ex. [ say "ban" ~ "ana"; ]
21:12 SourceBaby joined #perl6
21:13 Zoffix joined #perl6
21:14 Zoffix s: &infix:<~>, \('', '')
21:14 SourceBaby Zoffix, Sauce is at https://github.com/rakudo/rakudo/blob/4fca94743/src/core/Str.pm#L2793
21:14 Zoffix s: &infix:<~>, \(42, 42)
21:14 SourceBaby Zoffix, Sauce is at https://github.com/rakudo/rakudo/blob/4fca94743/src/core/Stringy.pm#L21
21:14 Thrush joined #perl6
21:15 Thrush I read somewhere that in Perl6, unlike Perl5, you should always close your filehandles, even when they go out of scope.  Is this true?
21:15 yoleaux 00:48Z <perlawhirl> Thrush: @b.map( |(@a X |*) )
21:16 Zoffix COMBORICO: ^ yes, but only for non-Str objects (it calls .Stringy actually, but that's basically .Str)
21:17 COMBORICO Thank you!
21:17 Thrush Wow... yoleaux.  You remembered me?  I'm impressed!
21:18 Zoffix COMBORICO: there are a lot of operators but there's also a lot of consistency among them, so you have a lot less to learn: infix ~ is concat, prefix ~ is string coercion, ^~ is a stringy bit op
21:18 geekosaur just means someone left a message
21:18 Zoffix All have '~' symbol
21:18 geekosaur the filehandle thing has been fixed, they're garbage collected and closed properly now
21:19 COMBORICO I see.
21:20 Zoffix Thrush: mostly-true, yes. In perl 5, handles are auto-closed when they go out of scope while in Perl 6 they get closed when GCed. So that means in certain situations, if you don't close your handles, you might open too many files before the handles are GCed
21:20 Zoffix Thrush: but many common IO operations can be done with IO::Path class and you never even deal with handles
21:21 Zoffix (not directly I mean; they are still used under the hood)
21:23 Zoffix GC == Garbage Collected
21:23 Thrush So if I wanted to do the p5 equivalent of:  open(my $fh, 'blah.txt') or die ...;  while (<$fh>) { ... };  How would I do that in Perl6 ?
21:24 moritz my $fh = open 'blah.txt; for $fh.lines { ... };
21:24 Zoffix Thrush: I'd write that as:  for lines 'blah.txt' {…}
21:24 Zoffix No handle involved
21:28 Zoffix lines returns a lazy Seq, so just like with Perl 5's version, you wouldn't load entire file into memory, just buffer-sized chunks (0x1000000 bytes) at a time
21:29 Zoffix *0x100000 bytes
21:29 Thrush So, in moritz's suggestion ( my $fh = open 'blah.txt; for $fh.lines { ... }; ), would I have to close the filehandle?
21:29 Zoffix Thrush: it would be a good idea, yeah
21:30 Zoffix Thrush: you can also write it as `my $fh will leave {.close} = open … and it'll get closed when the block is left
21:31 Zoffix eco: Trait::IO
21:31 buggable Zoffix, Trait::IO 'Helper IO traits': https://github.com/zoffixznet/perl6-Trait-IO
21:31 Thrush I just tried:  for lines 'script.pl6' { .flip.say }  and what I got was "6lp.tpircs" as output.  It doesn't look like it read the file.
21:31 Zoffix or use that module and do my $fh does auto-close =
21:32 Zoffix Thrush: sorry brain fart: 'blah.txt'.IO.lines
21:32 Zoffix Typing on the phone and cheated, entirely forgetting that lines(Str) has a non-IO candidate :)
21:33 geekosaur I admit I was wondering of that wanted to have a .IO
21:33 Zoffix wonder what lines(IO:;Path) does, considering IO::Path is Cool :)
21:34 Zoffix s: &lines, \('.'.IO)
21:34 SourceBaby Zoffix, Sauce is at https://github.com/rakudo/rakudo/blob/4fca94743/src/core/io_operators.pm#L98
21:34 Thrush Okay, that printed out the file contents, but as one big line.  That doesn't make sense to me.  Why not as multiple lines?
21:34 Zoffix yeah, does IO
21:35 Zoffix Thrush: weird; can you pastebin your code/input file?
21:35 Zoffix Thrush: wild guess: you're assigning .lines to a $ variable?
21:36 geekosaur Thrush, I get a list of strings. note that displaying that in some ways will concatenate theb back together again
21:36 buggable New CPAN upload: Test-Color-1.001001.tar.gz by HOLLI https://cpan.metacpan.org/authors/id/H/HO/HOLLI/Perl6/Test-Color-1.001001.tar.gz
21:37 Thrush Wait... Zoffix, I got it to work with:  for 'file.txt'.IO.lines { .flip.say }
21:37 Zoffix What was the broken version?
21:39 Thrush The broken version was when I put "lines" in front by accident:  for lines 'file.txt'.IO.lines { .flip.say }
21:40 Zoffix ohho
21:40 Zoffix s: ().Seq, 'lines', \()
21:40 SourceBaby Zoffix, Sauce is at https://github.com/rakudo/rakudo/blob/4fca94743/src/core/Cool.pm#L169
21:41 geekosaur heh, yes, that'd .Str the list and then try to lines it again --- but .Str would use spaces instead of newlines, so you;d get one long line
21:41 timotimo yeah, because you don't get finishing newlines from .lines
21:41 Zoffix m: say Seq ~~ Cool
21:41 camelia rakudo-moar dcf3e28c5: OUTPUT: «True␤»
21:41 Zoffix TIL
21:41 Zoffix kinda lame
21:42 Zoffix oh wait no it's good :)
21:42 * Zoffix &
21:42 Zoffix left #perl6
21:42 El_Che yes
21:42 El_Che got travis to build the packages and upload them automatically
21:43 El_Che first auto-release now uploading as we speak
21:43 Ven joined #perl6
21:44 moritz how does travis handle secrets (for authenticating the upload)?
21:44 El_Che hashes
21:44 El_Che you can encrypt your api key with the travis cli client
21:44 El_Che https://github.com/nxadm/rakudo-pkg/blob/master/.travis.yml#L35
21:45 Cabanossi joined #perl6
21:45 El_Che s/you can/you should/
21:45 Thrush Now:  my $fh does auto-close = open('file.txt');  failed on me, but:  my $fh will leave {.close} = open('file.txt');  succeeded (or rather, didn't fail).  Can I use that idiom ("will leave {.close}") safely even when writing to a file, and I don't even have to close the filehandle?
21:45 El_Che you are free to put your key in clear text there :)
21:45 El_Che it's supported
21:46 cdg joined #perl6
21:46 El_Che it may be geeky, but auto releases (from a tag) make me happy :)
21:46 El_Che s
21:46 ivans happy is good
21:46 moritz aye, that's quite nice
21:47 El_Che as a security guy, having the build in the open is a good thing (TM)
21:47 Thrush Now, for 'file.txt'.IO.lines { .flip.say }  works great for reading a file, but what about writing to a file?  Is there a similar counterpart?
21:48 timotimo m: say join "\n", [1, 2, 3]
21:48 camelia rakudo-moar dcf3e28c5: OUTPUT: «1␤2␤3␤»
21:48 timotimo you can do this:
21:48 Thrush As for:  my $fh will leave {.close} = open('file.txt');  it seems to work, but I've never seen the "will leave {.close}" idiom before.  Where can I read up on that?
21:48 timotimo $path.IO.spurt: join "\n", do for ^10 { $_.Str }
21:50 mempko joined #perl6
21:55 Thrush I just found something about "will leave" here:  https://docs.perl6.org/routine/encoding#class_IO%3A%3AHandle
21:58 Thrush Thanks for all your help, guys.
22:00 Thrush When I do:  [1..1e6].say;  I get:  Failed to write bytes to filehandle: Not enough space.  I figure it's because I'm writing out (to STDOUT) a large amount of text.  But I didn't have this problem in Perl5.  Does this have something to do with flush/autoflush?
22:01 timotimo interesting
22:01 timotimo let me investigate
22:01 timotimo oh, haha
22:01 timotimo it works fine on my end
22:01 Thrush timotimo:  Are you referring to my:  [1..1e6].say;  ?
22:01 timotimo yep
22:02 Thrush I'm using Rakudo on Windows.
22:02 timotimo oh, so an older version?
22:02 Thrush Rakudo should be recent.  Windows, not so much.
22:02 timotimo probably from before we went from async i/o to sync i/o on stdio
22:02 timotimo you're compiling rakudo yourself?
22:02 mcmillhj joined #perl6
22:03 Thrush No, I just downloaded the latest version last week.
22:03 Thrush (Downloaded and installed.)
22:03 timotimo we only have windows builds of rakudo star, the last of which has been a while ago. unless you got the release candidate for this month's
22:05 Thrush timotimo:  The one I installed was:  rakudo-star-2017.07-x86_64 (JIT).msi
22:08 timotimo right, that could be before the i/o switch
22:14 Thrush Thanks, timotimo.  I'll wait for the next release of Rakudo star and see if that fixes it.
22:14 Thrush Say, what's the difference between the "say" and "given" keywords?  They seem to do the same thing.
22:15 Thrush Ignore that last question!
22:15 geekosaur o.O
22:15 Thrush Say, what's the difference between the "with" and "given" keywords?  They seem to do the same thing.
22:15 Thrush with 5 { .say; (4 + $_).say; }
22:15 geekosaur the big difference is with won't run the closure if the value you give it isn't defined
22:15 Thrush m: with 5 { .say; (4 + $_).say; }
22:15 camelia rakudo-moar 0bdda0866: OUTPUT: «5␤9␤»
22:15 Thrush m: given 5 { .say; (4 + $_).say; }
22:15 camelia rakudo-moar 0bdda0866: OUTPUT: «5␤9␤»
22:15 geekosaur whereas given always topicalizes (binds $_ to the value)
22:16 Thrush So when is it best to use which one?
22:16 geekosaur m: with Int {.say}
22:16 timotimo m: with Str { .say }
22:16 camelia rakudo-moar 0bdda0866: ( no output )
22:16 camelia rakudo-moar 0bdda0866: ( no output )
22:16 timotimo m: given Str { .say }
22:16 camelia rakudo-moar 0bdda0866: OUTPUT: «(Str)␤»
22:16 geekosaur when you want to not do some action to an undefined value
22:16 timotimo if you want something more like "if", you need "with"
22:16 geekosaur i.e. only do it if the value is defined
22:16 timotimo if you want something more like my $_ = $blah, you want "given"
22:16 Thrush Oh, thank you for the explanation.
22:21 Thrush The more I learn about Perl 6, the cooler it gets.
22:21 Thrush (But, boy, is there a lot to learn!!)
22:21 gfldex Thrush: a given block changes the behaviour of some nested statements
22:21 gfldex see https://docs.perl6.org/language/control#given
22:22 mcmillhj joined #perl6
22:24 Thrush When I write:  my @a = 'file.txt'.IO.lines;  it makes @a a one-element array.  (But 'file.txt' has ten lines.)  Why is that?
22:25 geekosaur seems to work here
22:25 Thrush Basically, @a is one long line with no newline chars, of all ten lines (concatenated together).
22:26 gfldex Thrush: still on Windows?
22:26 geekosaur pyanfar Z$ 6 'my @a = "MHookSwitch.hs".IO.lines; dd @a[0]'
22:26 geekosaur Str @a = "\{-# LANGUAGE DeriveDataTypeable #-}"
22:26 Thrush I would expect 'file.txt'.IO.lines to return an array of lines, not a scalar.
22:26 Thrush Yes, I'm still on Windows and Rakudo-Star.
22:26 gfldex in that case define "newline"
22:26 Thrush newline == "\n"
22:27 Thrush Can I write out a file using Moar?  Is that allowed?
22:28 Thrush m: 'file.txt'.IO.spurt: join "\n", do for 1..10 { "Line $_.".Str }
22:28 camelia rakudo-moar 0bdda0866: ( no output )
22:28 geekosaur it has limited write access (and it's camelia not 'Moar')
22:28 Thrush m: my @a = 'file.txt'.IO.lines; @a.perl.say
22:28 camelia rakudo-moar 0bdda0866: OUTPUT: «["Line 1.", "Line 2.", "Line 3.", "Line 4.", "Line 5.", "Line 6.", "Line 7.", "Line 8.", "Line 9.", "Line 10."]␤»
22:28 gfldex Rakudo may expect CR+LF on windows
22:28 xi- Thrush newlines on windows are \r\n iirc
22:29 geekosaur ialthough I think the other bot targets currently don't work
22:29 geekosaur j: say 'alive'
22:29 camelia rakudo-jvm a92950fb4: OUTPUT: «Error while reading '/home/camelia/p6eval-token': No such file or directory at /home/camelia/rakudo-j-inst/bin/eval-client.pl line 10.␤»
22:29 Thrush Okay, apparently I was mistaken.  my @a = 'file.txt'.IO.lines;  seems to work just fine.  I was just mis-interpreting the perl6 interactive interpreter output.
22:30 Ven joined #perl6
22:30 Thrush When I type "@a" I get what looks like one long line, but when I type "@a.perl.say" I see all ten elements, each surrounded by double-quotes.
22:31 Thrush My bad.  My mistake.  Culpa mea.
22:31 xi- has anyone used perl6 on jvm here?
22:31 xi- I never could get it working
22:32 geekosaur it's been broken for a while
22:32 xi- yeah, I tried a few versions
22:36 mcmillhj joined #perl6
22:42 bartolin actually, I'm trying to keep the jvm backend alive-ish. on commit e4a5bb17c9b1 I was able to build rakudo-jvm and it passed 50985 out of 55162 planned tests from roast. major things that became broken recently include: a) 'make install' is necessary before trying 'make test' or 'make spectest', b) nativecall is broken , c) the EvalServer leaks threads and memory when using Proc::Async (and isn't usable, therefore)
22:43 mson joined #perl6
22:45 Cabanossi joined #perl6
22:46 Rawriful joined #perl6
22:55 leah2 joined #perl6
22:55 cdg joined #perl6
22:57 Thrush Is there a standard way to get time resolution in milliseconds?  (Kind of like in python.)
22:58 jnthn m: say now
22:58 camelia rakudo-moar 697e4ecff: OUTPUT: «Instant:1509490738.142339␤»
22:59 Thrush jnthn:  Huh... somehow I missed that.  Thanks.
23:01 ivans m: say now - now
23:01 camelia rakudo-moar 697e4ecff: OUTPUT: «-0.0012876␤»
23:01 ivans m: say (BEGIN now) - now
23:01 camelia rakudo-moar 697e4ecff: OUTPUT: «-0.008511␤»
23:01 ivans m: say now - BEGIN now
23:01 camelia rakudo-moar 697e4ecff: OUTPUT: «0.007443␤»
23:02 Thrush I'm not quite sure what:  say now - BEGIN now;  is doing.
23:02 Thrush I assume it computed the "now" in the BEGIN expression right away, before the other.  Am I right?
23:02 mcmillhj joined #perl6
23:03 jnthn BEGIN means "at compile time"
23:04 jnthn So `BEGIN now` is "the instant this line of code was compiled"
23:04 ivans m: say (BEGIN now) - BEGIN now
23:04 camelia rakudo-moar 697e4ecff: OUTPUT: «-0.0296554␤»
23:05 ivans m: say(BEGIN now) - BEGIN now
23:05 camelia rakudo-moar 697e4ecff: OUTPUT: «WARNINGS for <tmp>:␤Instant:1509491150.219156␤Useless use of "-" in expression "say(BEGIN now) - BEGIN now" in sink context (line 1)␤»
23:08 geekosaur spaces matter
23:08 geekosaur say(BEGIN now) treats the () as parameter delimiters
23:09 knight__ Begin block is in compile time?
23:09 geekosaur yes
23:10 ivans geekosaur: thought so, just wanted to check
23:10 ivans some of my perl5 instincts are still right
23:15 mcmillhj joined #perl6
23:16 timotimo Thrush: when you just type @a in the REPL it'll give you the .gist output, which in the case of an array has all items without quotations and separated only by spaces
23:16 timotimo m: say (^10).List.gist; say (^10).List.perl
23:16 camelia rakudo-moar 697e4ecff: OUTPUT: «(0 1 2 3 4 5 6 7 8 9)␤(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)␤»
23:20 ivans m: my @a = ^10; say "@a"; say @a; say @a.gist
23:20 camelia rakudo-moar 697e4ecff: OUTPUT: «@a␤[0 1 2 3 4 5 6 7 8 9]␤[0 1 2 3 4 5 6 7 8 9]␤»
23:21 |oLa| left #perl6
23:22 raschipi joined #perl6
23:22 geekosaur I think you wanted @a.Str (equivalently ~@a)
23:23 ivans m: my @a = ^10; say ~@a
23:23 camelia rakudo-moar 697e4ecff: OUTPUT: «0 1 2 3 4 5 6 7 8 9␤»
23:23 timotimo m: my @a = ^10; say "@a[]"
23:23 camelia rakudo-moar 697e4ecff: OUTPUT: «0 1 2 3 4 5 6 7 8 9␤»
23:23 ivans ahh
23:24 ivans thank you
23:24 timotimo things with $ sigil will interpolate by themselves, anything else only interpolates if followed by a postcircumfix of some kind
23:25 timotimo this makes "foo@bar.com" not try to interpolate @bar or even @bar.com
23:25 timotimo however, this bites people when writing html in their strings
23:25 timotimo because "<em>$foobar</em>" will interpolate $foobar</em> as if you were looking up the key "/em" in $foobar (as if it were a hash)
23:25 timotimo m: my $foobar; $foobar</em> = 99;
23:25 camelia rakudo-moar 697e4ecff: ( no output )
23:25 timotimo m: my $foobar; $foobar</em> = 99; say $foobar
23:25 camelia rakudo-moar 697e4ecff: OUTPUT: «{/em => 99}␤»
23:26 ivans ha
23:26 ivans I'm not doing html so I'm good
23:27 mcmillhj joined #perl6
23:30 mempko joined #perl6
23:30 knight__ What is the cleanest way to make following: I am using some CPAN6 modules like HTTP:Tinyish for example. And my task is make something like if I cannot find module HTTP:Tinyish I have to make prettier error msg. When I use 'use something' - it is compiling time, but in case of require, I am not sure. Based on perl5doc what I understand require "includes" files from path.
23:31 timotimo perl5doc isn't the right place to look for perl 6 docs :)
23:31 knight__ I know
23:31 knight__ But I do not understand require
23:31 knight__ in perl6
23:31 raschipi what require doesn't do is to include the nmes in the local scope
23:32 raschipi names*
23:32 timotimo https://docs.perl6.org/syntax/require - you looked at this?
23:32 raschipi SO you'll have to either use the full name HTTP:Tinyish:somefunc()
23:32 timotimo right. since it works at run time, the compiler can't know what the module will be exporting
23:32 raschipi Or add aliases to the local scope manually.
23:32 timotimo you're allowed to put a list of names that you know will be there after the require, yes
23:33 HoboWithAShotgun but it is possible to call "import" yourself
23:33 jnthn Another trick is at the top of your script to put BEGIN { require HTML::Tinyish; CATCH { note "Some nice message"; exit 1 } }; use HTML::Tinyish;
23:34 timotimo aye, runtime-inside-compiletime has nice benefits
23:34 timotimo (except it's totally torture for the implementors)
23:34 HoboWithAShotgun well, that's the motto, isnt it?
23:34 timotimo it is
23:39 knight__ Thank you, I will try it.
23:39 knight__ I am thinking about diffrences between perl6 require/use vs. python import
23:43 knight__ uch, I must go, Good night and thank you for help.
23:44 knight__ joined #perl6
23:45 knight__ So, In compile time, every symbols from modules is "includes" to namespace?
23:45 knight__ Because I know which symbol exists...
23:45 knight__ and in case require I can modify dynamically state of object, thus I must check every object in runtime?
23:46 knight__ And require is second case?
23:47 mcmillhj joined #perl6
23:48 knight__ In case 2 In python I can add method to class in runtime, I guess it is same reason in Perl
23:48 knight__ For require
23:49 knight__ (AM I RIGHT)?
23:50 cpage_ joined #perl6
23:52 timotimo symbols in packages (what you get from use/require/import) is different from methods in objects
23:52 timotimo in perl6
23:53 knight__ but, I do not understand of purpose of require. if something is in compile time for example module. I cannot change state of object it is something like interface for me and I can handle it in compile time - because I cannot change it.
23:53 knight__ And I think require is In case, when I have some Class/Object/ from dynamic viewpoint
23:54 knight__ I can change the symbols in object
23:54 knight__ dynamically
23:55 knight__ and add some methods/variables AKA symbols.
23:55 knight__ and interpreter calls/delegate required symbols/message to object
23:56 knight__ and returns what I want.
23:56 Thrush I'm signing off now.  Thank you all for all your help.
23:56 knight__ if it exists...
23:56 buggable New CPAN upload: Test-Color-1.001002.tar.gz by HOLLI https://cpan.metacpan.org/authors/id/H/HO/HOLLI/Perl6/Test-Color-1.001002.tar.gz
23:58 knight__ timotimo: Am I Right?

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

Perl 6 | Reference Documentation | Rakudo