Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2018-01-04

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:08 itaylor57 joined #perl6
00:24 comborico1611 joined #perl6
00:27 Kaiepi joined #perl6
00:32 Kaiepi joined #perl6
00:38 Kaiepi joined #perl6
00:56 comborico1611 Can someone check out a little program from Think Perl6.
00:56 comborico1611 ?
00:57 comborico1611 I use slightly unconventional style.  But I've double-checked the code, and I'm getting a bazaar output.
00:57 timotimo feel free to upload it and send us the link
00:57 comborico1611 You mean on Github?
00:57 comborico1611 Hmm.  I'll see if I can figure it out realquick.
00:58 comborico1611 Thanks!
00:58 timotimo you can just gist it
00:58 timotimo gist.github.com
00:58 timotimo doesn't even need a github account
01:00 astj joined #perl6
01:01 comborico1611 Okay, thanks!
01:01 timotimo if you paste the link with "m: " in front on the channel, camelia will pull the code and run it for us
01:03 comborico1611 That's pretty crazy.
01:03 comborico1611 m: https://gist.github.com/clint-who/e9ce11b443241446fc57995edf1ea8f2
01:03 camelia rakudo-moar f8d8481c9: OUTPUT: «(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤»
01:03 comborico1611 Yup.  Same output as my end.
01:03 comborico1611 It is suppose to be a picture frame drawing.
01:06 timotimo you're calling print-grid before any of the variables have been assigned to
01:06 timotimo so you're getting the default value for all of them
01:07 comborico1611 Hmm.  I didn't think that was an issue.
01:07 timotimo since those are definitions, you may want to use "constant" instead of "my" here
01:07 timotimo that makes them evaluated at compile time, so they'll have their value immediately
01:07 comborico1611 It's just a little sample problem.  I just like to keep the "fluff" under "Definitions"
01:07 comborico1611 Hmm.  Interesting.
01:07 timotimo then you can have the program begin like:
01:07 timotimo sub MAIN { print-grid( ); }
01:08 comborico1611 I see.  I learn first on C++, so I think most in that way.
01:09 comborico1611 Let me see if I can find the part in the book that gave me the impression that order of execution wasn't an issue.
01:09 mniip joined #perl6
01:09 cdg joined #perl6
01:10 comborico1611 Here it is, "You don't have to create a subroutine before you can run it; the function definition may come after its call:"  Is this correct?
01:13 huf joined #perl6
01:13 geekosaur strictly true. it says nothing about what's *used by* that subroutine though
01:14 timotimo because the MAIN sub is called for you after the program's body has been run, so all the variables will have their values already
01:14 timotimo you can directly edit the gist on the site and put the link in here again to run it a second time
01:15 jferrero joined #perl6
01:15 comborico1611 Something is going over my head.  MAIN is main( ), right?
01:16 nativecallable6 joined #perl6
01:16 statisfiable6 joined #perl6
01:16 releasable6 joined #perl6
01:16 TimToady in C/C++ main() s the first (user-defined) thing that is called; in P6, it runs the whole program, then calls MAIN
01:16 geekosaur no, it is MAIN
01:16 geekosaur like anbything elkse that is auto-called
01:17 unicodable6 joined #perl6
01:17 committable6 joined #perl6
01:17 quotable6 joined #perl6
01:17 comborico1611 I think because the variables are important to the subroutine, therefore they must be declared first.  The author is speaking strictly of subroutine calls and their definitions.
01:18 comborico1611 So in P6, main( ) is out of the user's defining, and calls MAIN?
01:19 comborico1611 Regardless, of the MAIN issue.  I do believe I understand the main issue.
01:20 TimToady m: constant c = say "constant"; ENTER say "ENTER"; LEAVE say "LEAVE"; say "normal code"; sub MAIN() { say "MAIN" }
01:20 camelia rakudo-moar f8d8481c9: OUTPUT: «constant␤ENTER␤normal code␤MAIN␤LEAVE␤»
01:21 geekosaur in perl 6, main() would be a normal user-defined function
01:21 comborico1611 Oh no, not the codal explanation again.  Hahaha.  These tend to lead to more confusion.
01:21 geekosaur *anything* that is called automatically by perl 6 has an all-uppercase name.
01:21 comborico1611 OH!  I see.
01:22 geekosaur this includes MAIN(), which is modeled after the way C/C++/Java use main()
01:23 comborico1611 m: https://gist.github.com/clint-who/e9ce11b443241446fc57995edf1ea8f2
01:23 camelia rakudo-moar f8d8481c9: OUTPUT: «+ - - - - + - - - - +␤|         |         |␤|         |         |␤|         |         |␤|         |         |␤+ - - - - + - - - - +␤|         |         |␤|         |         |␤|         |         |␤|         |         |␤+ - - - - +…»
01:25 comborico1611 Well, it works in my terminal.
01:25 TimToady your terminal knows what a newline is :)
01:26 comborico1611 I see.   Thank you.
01:26 geekosaur so does mine :)
01:27 geekosaur (IRC text handler that inserts an actual newline after the \U+2422)
01:27 TimToady lucky you
01:27 Actualeyes joined #perl6
01:28 geekosaur and, the actual problem here is that initialization of variables is done at runtime at the script location. so at runtime, it calls print-grid, then *afterward* runs the variable initializations
01:28 geekosaur running through the script in order
01:28 kerframil joined #perl6
01:30 comborico1611 So, why is it printing two window-frames?  And why is the 2nd one slightly longer on the right side?
01:32 comborico1611 I definitely prefer my code against the author's.  lol
01:32 comborico1611 I do see how his is more advanced in capturing and building elements, whereas mine is crap that will only work on simple entries.
01:34 comborico1611 Oh.  My comment's aren't blocking.  #begin #end?  Hmm.
01:38 comborico1611 Alright guys.  I'm off to rest.  Thanks for the help Perl6 community!
01:43 cdg joined #perl6
01:49 cdg joined #perl6
02:02 bdmatatu joined #perl6
02:06 bdmatatu I'm seeing this warning that I don't understand: https://git.io/vNejj
02:07 bdmatatu Is this an issue in my code or would this be something in rakudo?
02:08 buggable New CPAN upload: App-Assixt-0.1.0.tar.gz by TYIL https://cpan.metacpan.org/authors/id/T/TY/TYIL/Perl6/App-Assixt-0.1.0.tar.gz
02:18 Zoffix joined #perl6
02:18 Zoffix bdmatatu: that's a deprecation warning. Looks like it's missing the stuff that it's the ":buffer" argument that's deprecated. You need to use ":out-buffer"
02:19 bdmatatu Thanks zoffix -- I was confused since it references src/core/io_operators.pm
02:22 Zoffix Yeah, I think I tested it printed right location only with the method call and forgot about &open. My bad.
02:23 bdmatatu Okay...so somewhere in my code (or its dependencies) there must be a call to &open that is sending :buffer instead of :out-buffer..?
02:24 tyil isn't zef supposed to show a list of the deps it couldnt find here: https://travis-ci.org/scriptkitties/perl6-app-assixt/builds/324871237#L1317
02:24 Zoffix bdmatatu: yeah
02:24 bdmatatu got it, thanks
02:24 Zoffix Filed an issue to improve our deprecations as R#1362
02:24 synopsebot R#1362 [open]: https://github.com/rakudo/rakudo/issues/1362 Make Deprecations skip core locations by default
02:26 bdmatatu Great
02:26 Zoffix tyil: it should but sometimes it doesn't. When that happened to me, I installed a couple of modules separately and it worked. My wild guess is it's failing to detect deps that are being installed as part of the command or something
02:26 Zoffix Last time it happend it was Cro and IRC::Client that I installed separately and then the rest got installed just fine
02:28 tyil if I install Dist::Helper first, the rest installs with `install --deps-only .`
02:28 tyil the only diff from Dist::Helper and the rest is that Dist::Helper is recently uploaded
02:29 tyil (tested installs locally after removing ~/.perl6)
02:33 Zoffix left #perl6
02:57 ilbot3 joined #perl6
02:57 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:03 cdg joined #perl6
03:06 lookatme joined #perl6
03:07 cdg_ joined #perl6
03:08 cdg joined #perl6
03:36 xcm joined #perl6
03:38 Sgeo joined #perl6
03:49 vichib joined #perl6
03:57 jeromelanteri joined #perl6
04:31 kerframil joined #perl6
04:46 cdg joined #perl6
04:51 Cabanoss- joined #perl6
04:51 piojo joined #perl6
04:55 piojo joined #perl6
05:29 Kaiepi joined #perl6
05:37 cdg joined #perl6
05:41 cdg_ joined #perl6
05:46 cdg joined #perl6
05:55 Actualeyes joined #perl6
05:59 cdg joined #perl6
06:27 cibs joined #perl6
06:35 hylcn joined #perl6
07:02 Kaiepi joined #perl6
07:04 Kaiepi joined #perl6
07:17 darutoko joined #perl6
07:27 lowbro joined #perl6
07:27 lowbro joined #perl6
07:55 xcm joined #perl6
08:01 domidumont joined #perl6
08:02 abraxxa joined #perl6
08:04 someuser_ joined #perl6
08:08 domidumont joined #perl6
08:19 rindolf joined #perl6
08:20 zakharyas joined #perl6
08:25 xcm joined #perl6
08:44 Geth ¦ doc/master: 4 commits pushed by (Luca Ferrari)++
08:44 Geth ¦ doc/master: 00cb1afc7a | Small changes to the NOTE section of the 5-to6-var.
08:44 Geth ¦ doc/master: 6a5005f49c | Put "i.e." in parentheses.
08:44 Geth ¦ doc/master: 6fb710b8a8 | Link to S28 design document.
08:44 Geth ¦ doc/master: 2decb0d2f2 | Place C<> tags around $0 and $1 when referencing them.
08:44 Geth ¦ doc/master: review: https://github.com/perl6/doc/compare/428429a51f...2decb0d2f2
08:57 scimon joined #perl6
08:58 geekosaur joined #perl6
09:03 geekosaur joined #perl6
09:11 rindolf joined #perl6
09:14 sumdoc joined #perl6
09:15 sumdoc https://mybinder.org/ looks exciting project
09:15 sumdoc I have written how we can use it here: https://sumdoc.wordpress.com/2018/01/04/using-perl-6-notebooks-in-binder/
09:15 wamba joined #perl6
09:17 lizmat sumdoc++
09:18 cdg joined #perl6
09:28 cdg joined #perl6
09:52 scovit joined #perl6
09:56 El_Che sumdoc: we have a related talk at FOSDEM this year: https://fosdem.org/2018/schedule/event/perl6_jupyter/
09:59 sumdoc El_Che Aye good to know!!
10:03 fluca1978 joined #perl6
10:04 Geth ¦ doc/master: 5 commits pushed by (Luca Ferrari)++
10:04 Geth ¦ doc/master: c01852ffc3 | Extended the explaination of $*GROUP and $*USER variables.
10:04 Geth ¦ doc/master: 50382c5937 | Add blank line before =item POD directive.
10:04 Geth ¦ doc/master: 0cfc6e57f6 | Little changes to explaination of $*PERL.
10:04 Geth ¦ doc/master: 9c24744b8b | More on $*KERNEL, $*VM, $*DISTRO.
10:04 Geth ¦ doc/master: 6ed3006eb5 | Fix link directive, resolves mistake from 6fb710b8.
10:04 Geth ¦ doc/master: review: https://github.com/perl6/doc/compare/2decb0d2f2...6ed3006eb5
10:16 tyil so I added some dd calls in Zef::Client to figure out why its failing to resolve all deps, but has no unresolved deps
10:17 tyil it seems theres 12 entries in @needed, 11 entries in @prereq-candidates
10:17 tyil which makes it fail the dependency resolve
10:18 tyil but the grep call on @needed (whose output is stored in @not-found) returns an empty list
10:18 tyil and it tries to output the @not-found list with the error
10:20 S007 joined #perl6
10:27 sumdoc If I try to execute this code in Perl 6 notebook `for 1..6 {say "Hello"}` it shows weird output.
10:28 DrForr What "perl6 notebook" is this?
10:28 sumdoc This is what output I get https://imgur.com/XOyJLmH
10:29 sumdoc DrForr: This one https://sumdoc.wordpress.com/2018/01/04/using-perl-6-notebooks-in-binder/
10:32 DrForr Never tried that. Looks though like there might be some wacky side effects from capturing Perl output using Python.
10:35 sumdoc DrForr: OK then I will file an issue with Brian Duggan. May be he will fix it then https://github.com/bduggan/p6-jupyter-kernel
10:36 sumdoc It could be issue with the kernel then
10:38 DrForr That's all I can suggest, not having used it. It's interesting that there appears to be one 'hello' then the first line of output, followed by another 'hello' and 2 lines of output, and so on.
10:43 cpage joined #perl6
10:44 sumdoc DrForr: OK filed an issue https://github.com/bduggan/p6-jupyter-kernel/issues/28 Lets see
10:54 DrForr Good luck. And wow, that site's got a lot of flashy stuff.
11:05 cdg_ joined #perl6
11:15 cdg_ joined #perl6
11:16 wamba joined #perl6
11:20 Kaffe joined #perl6
11:21 domidumont joined #perl6
11:43 wamba joined #perl6
11:46 markong joined #perl6
11:53 cschwenz joined #perl6
11:57 Ulti if you do print "Hello" in the jupyter notebook it gives you more clues
11:57 Ulti its concatenating the output per iteration for some reason
11:58 Ulti and storing it as a list too
11:58 Ulti probably a relatively simple bug in the kernel somewhere
11:58 Ulti oh sumdoc isnt here
11:59 Ulti I'll take a look later since I've been over this code before
12:02 reportable6 joined #perl6
12:03 DrForr Yeah, I pointed that out as wel, looked like it was a good way to track down the problem.
12:05 DrForr In other news I'm the closing act for FOSDEM Perl room. No pressure :)
12:07 Ulti is fosdem the one that has good or really really bad video recording?
12:07 Ulti if its the good one Ill make sure to check out your talk
12:07 DrForr That just described about half the conventions I've been to :) But they've got that rep, yes.
12:08 manchicken joined #perl6
12:09 Ulti I've used audacity to clean up the audio on some P6 talks just so I could listen to them
12:09 Ulti :<
12:11 DrForr Well, having been dragooned into volunteering for FOSDEM audio a few times I'm amazed anything gets out at al, but it's *not* anything to do with the people, it's amazingly hodgepodge equipment.
12:11 DrForr Which isn't a great surprise, given budgets.
12:13 Ulti a cheap bluetooth mic on the speaker and a smartphone would be better than most of what I've seen.... it has to be a hodgepodge of 90s era "pro" equipment thats now far worse than any consumer grade stuff
12:13 DrForr Pretty much.
12:13 Ulti sounds like ambient mic on a dedicated camera at the back of the room
12:14 Ulti with someone fiddling with a coin on the same desk the camera is resting on
12:14 DrForr Yep. I think they miked the speakers last year but the audio went walkabout.
12:14 Ulti :Z
12:15 Ulti maybe we can have a whip around?
12:15 DrForr Better than a reacharound :)
12:16 Ulti hah
12:24 Kaffe_ joined #perl6
12:25 MasterDuke joined #perl6
12:36 manchicken joined #perl6
12:53 cschwenz left #perl6
12:55 cdg_ joined #perl6
13:01 manchicken joined #perl6
13:04 cdg_ joined #perl6
13:15 wamba joined #perl6
13:26 cdg_ joined #perl6
13:34 Actualeyes joined #perl6
13:37 fluca1978 left #perl6
13:40 rindolf joined #perl6
13:44 mniip joined #perl6
13:45 cdg_ joined #perl6
13:50 cdg__ joined #perl6
13:53 cdg_ joined #perl6
13:58 someuser1 joined #perl6
14:02 zakharyas joined #perl6
14:08 cdg_ joined #perl6
14:09 cdg__ joined #perl6
14:14 cdg_ joined #perl6
14:15 cdg__ joined #perl6
14:20 cdg_ joined #perl6
14:23 sumdoc joined #perl6
14:23 sumdoc rakudo: say "hi"; 42;
14:23 camelia rakudo-moar f8d8481c9: OUTPUT: «WARNINGS for <tmp>:␤hi␤Useless use of constant integer 42 in sink context (line 1)␤»
14:25 xinming joined #perl6
14:25 sumdoc 'rakudo: say "hi"; 42;'
14:25 sumdoc rakudo: 'say "hi"; 42;'
14:25 camelia rakudo-moar f8d8481c9: OUTPUT: «WARNINGS for <tmp>:␤Useless use of constant string "say \"hi\"; 42;" in sink context (line 1)␤»
14:25 sumdoc camelia p6: say "hi"; 42;
14:25 camelia sumdoc: rakudo-moar f8d8481c9: OUTPUT: «WARNINGS for <tmp>:␤hi␤Useless use of constant integer 42 in sink context (line 1)␤»
14:26 sumdoc What is this expression supposed to print ?  'say "hi"; 42;'
14:26 sumdoc Isn't it both hi and 42
14:26 DrForr "hi" to stdout, and return 42 to something that's not there, so that's the warning you get.
14:26 cdg_ joined #perl6
14:28 jast if you surround it with '', it's just a string constant, not actual statements
14:28 sumdoc DrForr: Is this expected?
14:28 jast a warning on a useless constant? sure
14:28 sumdoc https://github.com/bduggan/p6-jupyter-kernel/issues/28#issuecomment-355290889
14:28 jast you'll find that the "hi" output goes to STDOUT and the warning to STDERR
14:28 DrForr sub x { say "hi"; 42; } x();
14:28 DrForr m: sub x { say "hi"; 42; } x();
14:28 natrys joined #perl6
14:28 camelia rakudo-moar f8d8481c9: OUTPUT: «WARNINGS for <tmp>:␤Useless use of "x" in expression "sub x { say \"hi\"; 42; } x()" in sink context (line 1)␤Sub object coerced to string (please use .gist or .perl to do that)␤  in block <unit> at <tmp> line 1␤»
14:28 sumdoc See that thread
14:28 DrForr m: sub x { say "hi"; 42; }; x();
14:28 camelia rakudo-moar f8d8481c9: OUTPUT: «hi␤»
14:29 timotimo m: say sub x { say "hi"; } x 10
14:29 camelia rakudo-moar f8d8481c9: OUTPUT: «Sub object coerced to string (please use .gist or .perl to do that)␤xxxxxxxxxx␤  in block <unit> at <tmp> line 1␤»
14:29 timotimo m: say sub noot { say "noot" } x 2
14:29 camelia rakudo-moar f8d8481c9: OUTPUT: «Sub object coerced to string (please use .gist or .perl to do that)␤nootnoot␤  in block <unit> at <tmp> line 1␤»
14:30 DrForr sumdoc: Context here helps. C<perl6 -e'say "hi"; 42;'> will return the useless constant warning, because nothing in the environment has consumed it.
14:32 jast to be honest, I'm not entirely sure how this is related to the issue you linked to. I don't see anything involving warnings going on there.
14:32 DrForr If you're treating the string as something that just goes into a 'perl6 -e' block, then the warning you're getting is perfetly understandable.
14:34 DrForr bduggan's reply makes sense to me. I think what he's saying is $*OUT isn't being captured correctly, it's actually the return from the print() statement, *not* the output text on STDOUT.
14:35 DrForr Does that help?
14:37 domidumont joined #perl6
14:37 DrForr So when it goes to the jupyter console, you get the $*OUT stream of 'hello'..'hello' that you expect *and* the return result from print(), which you *don't*.
14:44 sumdoc DrForr: Thanks
14:46 cdg_ joined #perl6
14:47 DrForr And in any case the PR or whatever is still in progress. I suspect it'll get fixed this weekend, given that FOSDEM is bearing down on us :)
14:48 cdg__ joined #perl6
14:49 sumdoc DrForr: :)
14:51 cdg_ joined #perl6
14:57 cdg_ joined #perl6
15:00 cdg_ joined #perl6
15:03 comborico1611 joined #perl6
15:03 comborico1611 I went to the Docs and still can't get Comments to work, specifically "#begin comment" and "#end comment"
15:11 MasterDuke comborico1611: you mean POD? i think it should be '=begin comment' and '=end comment'
15:12 comborico1611 Heh.  I'm still waking up.  Thank you!
15:17 silug joined #perl6
15:17 comborico1611 I was reading = but keep seeing #, I guess.
15:26 geospeck joined #perl6
15:27 domidumont joined #perl6
15:31 markong joined #perl6
15:32 Kaiepi joined #perl6
15:38 kerframil joined #perl6
15:43 comborico1611 Quick question:  What is wrong with the following:
15:43 comborico1611 m: =begin comment                                            BLAH
15:43 camelia rakudo-moar f8d8481c9: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Preceding context expects a term, but found infix = instead.␤Did you make a mistake in Pod syntax?␤at <tmp>:1␤------> 3=begin 7⏏5comment                                 ␤»
15:45 DrForr =begin needs a corresponding =end. You can use =comment there and whatever afterwards 'til the next blank line or leading = will be treated as a comment.
15:46 committable6 joined #perl6
15:47 comborico1611 m: =begin comment                                    BLAH                     =end comment
15:47 camelia rakudo-moar f8d8481c9: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Preceding context expects a term, but found infix = instead.␤Did you make a mistake in Pod syntax?␤at <tmp>:1␤------> 3=begin 7⏏5comment                                 ␤»
15:48 comborico1611 m: =comment                                                BLAH
15:48 camelia rakudo-moar f8d8481c9: ( no output )
15:48 DrForr Which also needs to be flush-left like =begin comment.
15:49 comborico1611 m: =comment                                  BLAH                                   =
15:49 camelia rakudo-moar f8d8481c9: ( no output )
15:49 comborico1611 I don't quite understand.  But I think I understand enough to use =comment and not =begin.
15:49 comborico1611 Thank you!
15:49 DrForr =begin comment .. =end comment # are just fine, you just need to make sure that both the =begin and =end are flush-left.
15:51 comborico1611 Hmm.  I don't think there was any indentation.
15:52 comborico1611 =comment seems more forgiving, in some way.
15:59 jeromelanteri joined #perl6
16:03 raiph joined #perl6
16:09 comborico1611 I can't figure this simple program out.  Mainly confused by: function( sub {say $value } );         Not a super big deal, but if someone is bored they can check it out:  https://gist.github.com/clint-who/7164241ed71883cb56a9c651eb6b1e96
16:12 comborico1611 Oop!  I see now.  It is related to my comments.
16:13 comborico1611 You won't see it in the code in the link because I didn't put the extra stuff I have THOUGHT to have commented-out.
16:14 moritz \o
16:14 yoleaux 1 Jan 2018 02:28Z <timotimo> moritz: quotable6 can't grab irc data right now because https://irclog.perlgeek.de/p6dev/2017-12-31 gives a 500 internal server error if Accept: application/json is set :(
16:14 yoleaux 1 Jan 2018 06:22Z <Zoffix> moritz: spam bots wrote crap again: https://irclog.perlgeek.de/perl6-dev/2018-01-01#i_15639243
16:14 troys joined #perl6
16:15 comborico1611 lol my favorite error message yet, "Bogus statement"
16:15 comborico1611 moritz!  Fundamentals is on it's way to my house.
16:15 comborico1611 its*
16:16 moritz comborico1611: nice :)
16:17 tyil .tell ugexe Do you want me to close the ticket I created, as its a dupe of #157
16:17 yoleaux tyil: I'll pass your message to ugexe.
16:17 comborico1611 I have much on my plate, as they say.  Learning HTML/CSS and Javascript.
16:17 comborico1611 So I'm not sure how rigoursly I can read it.
16:17 tyil .tell zoffix The issue I ran into with zef has a ticket open, in case you're interested in the cause: https://github.com/ugexe/zef/issues/157
16:17 yoleaux tyil: I'll pass your message to zoffix.
16:20 moritz .tell timotimo I can't reproduce your error; $ curl -H 'Accept: application/json' https://irclog.perlgeek.de/p6dev/2017-12-31; echo $?  gives me {"header":["id","nick","timestamp","line"],"channel":"p6dev","day":"2017-12-31","rows":[]} 0
16:20 yoleaux moritz: I'll pass your message to timotimo.
16:20 moritz ZofBot: I've deleted the spam, but it seems to live on in some caches... :(
16:21 timotimo moritz: could be it was just there for a little while
16:21 yoleaux 16:20Z <moritz> timotimo: I can't reproduce your error; $ curl -H 'Accept: application/json' https://irclog.perlgeek.de/p6dev/2017-12-31; echo $?  gives me {"header":["id","nick","timestamp","line"],"channel":"p6dev","day":"2017-12-31","rows":[]} 0
16:21 * moritz closes that mental ticket
16:23 comborico1611 So to use =begin comment, nothing else can be on that line?  Is that correct?
16:25 moritz everything else on that line will be considered part of the pod block name, I think
16:27 moritz FTR, I'm back from about a week without Internet. If there's anything important that @perl6org on twitter should retweet that it hasn't yet, please let me know
16:28 comborico1611 Thank you.
16:30 comborico1611 I just learned something important.  This is a no-no: do-four-times( &print-bottomless-grid( ) );
16:30 comborico1611 I'm just use to referring to functions with the ( ).
16:30 comborico1611 I prefer the extra reminder of the ( ) to notify me that I'm dealing with functions.
16:31 comborico1611 ( ) bit me on Parrot.  And now () bites me on Rakudo.  Heh.
16:33 moritz in Perl 6, () is (nearly) always an invocation
16:33 moritz (as a postfix, that is)
16:34 Geth ¦ doc: baa653c3a6 | (Luca Ferrari)++ | doc/Language/5to6-perlvar.pod6
16:34 Geth ¦ doc: Reword about ~$/ vs $/.Str.
16:34 Geth ¦ doc:
16:34 Geth ¦ doc: Link to the match object.
16:34 Geth ¦ doc: review: https://github.com/perl6/doc/commit/baa653c3a6
16:34 synopsebot Link: https://doc.perl6.org/language/5to6-perlvar
16:34 Geth ¦ doc: a06f33ab89 | (Luca Ferrari)++ | doc/Language/5to6-perlvar.pod6
16:34 Geth ¦ doc: Improve the $! section.
16:34 Geth ¦ doc:
16:34 Geth ¦ doc: Explain that $! holds the exception, with link to the documentation(s).
16:34 Geth ¦ doc: Provide a simple snippet to introduce the usage of $! as an object.
16:34 Geth ¦ doc: review: https://github.com/perl6/doc/commit/a06f33ab89
16:34 comborico1611 I see.
16:37 comborico1611 If you aren't busy, could you explain what is going on with the sub here:
16:37 comborico1611 sub say-four-times( $value ) { do-four-times( sub {say $value} );
16:37 comborico1611 (2nd sub)
16:38 moritz well, there appears to be a sub do-four-times, to which you can pass another subroutine, and it calls that passed subroutine four times
16:39 moritz so now you declare a subroutine say-four-times with an argument $value
16:39 moritz and it doesn't do the looping itself, it calls the do-four-times function to do the actual looping
16:40 moritz and it creates an anonymous function that prints $value, and passes that to do-four-times
16:40 comborico1611 so "sub" is a declaring a parameter for an argument that is a function?
16:41 moritz no
16:41 moritz "sub" declares a function, and also returns it
16:41 moritz you can use it anywhere that a value is expected
16:41 comborico1611 sub is declaring the anonymous function?
16:41 moritz yes
16:42 comborico1611 Hmm.  I'll meditate on that.  I'll even put your words in a comment of the program for reviewing later.  Thanks!
16:43 moritz you're welcome
16:46 comborico1611 Correction:  You called $value an argument when it is actually a parameter.
16:47 Geth ¦ doc: 8effa8516a | (Luca Ferrari)++ | doc/Language/exceptions.pod6
16:47 Geth ¦ doc: Small changes to exception introduction paragraph.
16:47 Geth ¦ doc:
16:47 Geth ¦ doc: Specify a little better what an exception object is and which kind of
16:47 Geth ¦ doc: information it can handle.
16:47 synopsebot Link: https://doc.perl6.org/language/exceptions
16:47 Geth ¦ doc: review: https://github.com/perl6/doc/commit/8effa8516a
16:48 comborico1611 Moritz, so it is the "sub" part that enables do-four-times to pass another subroutine?
16:50 moritz it's say-four-times that passes a subroutine to another subroutine
16:53 comborico1611 Is "sub" being used to return anything here?  I know you can't see the other function, but just guessing.
16:54 moritz the declaration that starts with "sub" returns the function it declares
16:54 khw joined #perl6
16:54 moritz but that's orthogonal to whether any of the functions involved return anything
16:56 comborico1611 Okay.  Thank you for your time.  Something isn't quite making sense.  But I understand more than when I started.  Lunch time!
16:58 squashable6 joined #perl6
17:02 timotimo maybe they're confused by "returns" in this context, as a "return" statement would usually exit the outer subroutine, too
17:13 BenGoldberg joined #perl6
17:16 lookatme joined #perl6
17:19 abraxxa joined #perl6
17:22 bloatable6 joined #perl6
17:22 coverable6 joined #perl6
17:22 benchable6 joined #perl6
17:28 buggable New CPAN upload: Verge-RPC-Client-0.0.2.tar.gz by BRAKMIC https://cpan.metacpan.org/authors/id/B/BR/BRAKMIC/Perl6/Verge-RPC-Client-0.0.2.tar.gz
17:31 AlexDaniel joined #perl6
17:39 bisectable6 joined #perl6
18:00 pilne joined #perl6
18:08 abraxxa1 joined #perl6
18:14 Kaiepi joined #perl6
18:46 cdg joined #perl6
18:46 wamba joined #perl6
18:53 Aaronepower joined #perl6
18:55 geospeck joined #perl6
19:07 kerframil joined #perl6
19:11 eliasr joined #perl6
19:15 itaylor57 joined #perl6
19:39 greppable6 joined #perl6
19:53 Ven`` joined #perl6
19:59 Kaiepi joined #perl6
20:01 cog__ joined #perl6
20:05 FROGGS joined #perl6
20:14 BenGoldberg m: my &lfsr = BEGIN { my uint $lfsr = 42; sub { my uint $xor = ($lfsr +& 1) ?? 0x800000000000000D !! 0; $lfsr +>= 1; $lfsr ^= $xor; $xor ?? 1 !! 0 } }; print lfsr;
20:14 camelia rakudo-moar f8d8481c9: OUTPUT: «This type cannot unbox to a native integer: P6opaque, Junction␤  in sub  at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
20:15 timotimo ^ is a junction operator, BenGoldberg
20:15 timotimo m: say 1 ^ 2
20:15 camelia rakudo-moar f8d8481c9: OUTPUT: «1␤2␤»
20:15 timotimo m: say (1 ^ 2).perl
20:15 camelia rakudo-moar f8d8481c9: OUTPUT: «one(1, 2)␤»
20:16 timotimo m: say 0xabcdef +^ 0x123456
20:16 camelia rakudo-moar f8d8481c9: OUTPUT: «12188089␤»
20:16 timotimo m: say (0xabcdef +^ 0x123456).base: 16
20:16 camelia rakudo-moar f8d8481c9: OUTPUT: «B9F9B9␤»
20:16 BenGoldberg Ooh, I forgot the _
20:16 BenGoldberg Err, +
20:16 timotimo :)
20:20 BenGoldberg m: my &lfsr = BEGIN { my $lfsr = 42; sub { my $xor = ($lfsr +& 1) ?? 0x800000000000000D !! 0; dd $xor; $lfsr +>= 1; $lfsr +^= $xor; $xor ?? 1 !! 0 } }; say lfsr for ^4;
20:20 camelia rakudo-moar f8d8481c9: OUTPUT: «Int $xor = 0␤0␤1␤1␤0␤Int $xor = 9223372036854775821␤Int $xor = 9223372036854775821␤Int $xor = 0␤»
20:20 BenGoldberg Now this is just strange, why does the output of dd come before and after like that?
20:23 timotimo dd uses stderr, while say goes to stdout
20:23 timotimo i believe the bot doesn't synchronize that properly
20:23 jnthn dd outputs to stderr, there's output buffering when the output isn't a tty, and the thing that collects the output isn't a tty, so it sees the effects of the buffering
20:26 comborico1611 joined #perl6
20:27 * BenGoldberg wonders if it would be worth someone's time to set up a pty, or alternatively have the eval-ing subprocess deliberately turn buffering off.
20:28 comborico1611 I'm confused by Rakudo tarball instruction.  I believe I need --prefix in "perl Configure" command, but I'm confused by the value for --prefix.
20:28 moritz where do you want rakudo to be installed?
20:29 comborico1611 i guess /opt/perl6
20:29 moritz then you need to run perl Configure.pl --prefix=/opt/perl6
20:29 comborico1611 Whenever i can get system-wide PATH
20:30 moritz and of course, you need to make /opt/perl6 writable for the current user
20:30 comborico1611 Sudo
20:30 comborico1611 And this will give me PATH?
20:31 comborico1611 The guys in the instructions used --prefix=$INSTDIR.  Super confusing.
20:33 moritz this will install rakudo in /opt/perl6, so /opt/perl6/bin/perl6
20:33 comborico1611 That is what
20:33 BenGoldberg m: my &lfsr = BEGIN { my uint $state = 1; sub { my uint  $xor = ($state +& 1) ?? 0x800000000000000D !! 0; $state +>= 1; $state +^= $xor; $xor ?? 1 !! 0 } }; my &goldbb = BEGIN { my uint ($zeros, $ones); sub { my uint ($b, $mask); repeat { $b = lfsr; $b ?? ++$ones !! ++$zeros; $mask = $ones +& $zeros; } until $mask; $ones -= $mask; $zeros -= $mask; $b } }; print goldbb for ^100;
20:33 camelia rakudo-moar f8d8481c9: OUTPUT: «Cannot invoke this object (REPR: Uninstantiable; Callable)␤  in sub  at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
20:34 moritz so you need to add PATH=$PATH:/opt/perl6/bin or so to /etc/profile or something else that is read at startup
20:34 comborico1611 The address i use to assign into PATH?
20:34 moritz comborico1611: I don't understand your question
20:35 comborico1611 Okay. I'll try it!
20:35 comborico1611 You answered it.
20:35 comborico1611 Thank you!
20:36 comborico1611 That command will look /perl6/bin to etc/profile ?
20:36 comborico1611 Look = link
20:38 moritz no
20:38 comborico1611 Is there another step after PATH= ?
20:40 moritz you might need to login again for the new PATH to take hold
20:40 moritz or start a new login shell, with "bash -n"
20:41 comborico1611 Thanks, dude!
20:45 cdg joined #perl6
20:59 evalable6 joined #perl6
21:01 xcm joined #perl6
21:02 setty1 joined #perl6
21:03 comborico1611 Ha! I can't believe it! It installed! First ever tar.gz.
21:04 comborico1611 Last time i got stuck because i was putting PATH= in prompt, not a file.
21:04 moritz so... you didn't even have a rakudo installed before?
21:04 moritz or installed via some other method?
21:04 comborico1611 Other method.
21:04 comborico1611 The easiest method apt-get install rakudo
21:05 comborico1611 Which should be on the website, but it's not.
21:05 comborico1611 At least i didn't find it.
21:05 dct joined #perl6
21:13 comborico1611 joined #perl6
21:17 comborico joined #perl6
21:20 xi- joined #perl6
21:22 Kaiepi joined #perl6
21:25 cdg joined #perl6
21:44 comborico What is going on with this: my ( $days,  $hours ) . . .
21:44 cdg joined #perl6
21:45 geekosaur you can declare more than one variable at once. beyond that, we'd need to see what you were ellipical about
21:54 cdg_ joined #perl6
22:03 Aceeri_ joined #perl6
22:15 comborico geekosaur, Thanks!
22:16 geekosaur (note that "my $days, $hours" parses as "((my $days), $hours) =
22:17 geekosaur which is actually sensible in a number of cases, and lets you deconstruct e.g. a list while declaring on the fly any variables that weren't already. this is not all that unusual in perl 5 code, for example
22:17 geekosaur therefore probably also in existing perl 6 code
22:18 comborico Thanks!
22:24 geospeck joined #perl6
22:28 lizmat joined #perl6
22:29 xcm joined #perl6
22:37 abraxxa joined #perl6
22:37 comborico Getting a unit-scoped error.  Please advise: https://gist.github.com/clint-who/7b6edd396955b01a1b68d48438a27ec9
22:38 comborico Oops!
22:38 comborico I need to declare variables.  Let me try that first.
22:41 comborico I must go do some things.
22:41 geospeck joined #perl6
23:11 Geth ¦ perl6-examples: f799b0f0ab | (Shlomi Fish)++ | categories/best-of-rosettacode/ackermann-function.pl
23:11 Geth ¦ perl6-examples: Correct some typos.
23:11 Geth ¦ perl6-examples: review: https://github.com/perl6/perl6-examples/commit/f799b0f0ab
23:23 comborico1611 joined #perl6
23:24 grumble joined #perl6
23:26 comborico joined #perl6
23:27 comborico I'm back.
23:31 espadrine joined #perl6
23:34 comborico Requesting help: A unit-scoped sub definition is not allowed except on a MAIN sub: https://gist.github.com/clint-who/7b6edd396955b01a1b68d48438a27ec9
23:36 geekosaur the semicolon at the end of line 3
23:36 geekosaur and that error is a bit LTA
23:36 comborico LTA?
23:36 comborico Thanks, by the way!
23:36 geekosaur "less than awesome"
23:36 geekosaur or, in this case, nearly incomprehensible until you spot the actual problem and work backwards to what the compiler thought it meant
23:37 comborico Heh, yeah.
23:40 geekosaur I would file that as a rakudobug, btw. include the [LTA] tag in the subject.
23:41 comborico I don't know how.
23:41 geekosaur if nothing else, it should not be talking about unit scope without an explicit "unit" declaration. (that's a holdover from before it was decided to add "unit", because of conflicts between unit scope and forward references)
23:41 geekosaur huggable: rakudobug
23:41 huggable geekosaur, Report bugs on https://github.com/rakudo/rakudo/issues/new    If you don't have access to GitHub, you can email your report to rakudobug@perl.org . See also: https://github.com/rakudo/rakudo/wiki/rt-introduction
23:41 comborico huggable: rakudobug
23:41 huggable comborico, Report bugs on https://github.com/rakudo/rakudo/issues/new    If you don't have access to GitHub, you can email your report to rakudobug@perl.org . See also: https://github.com/rakudo/rakudo/wiki/rt-introduction
23:42 comborico Okay.
23:49 comborico This a good title: [LTA] Semi-colon at end of header in a subroutine definition
23:49 comborico ?
23:50 geekosaur I'd include some idea of what the problem with it is
23:50 geekosaur [LTA] Semi-colon at end of header in a subroutine definition provokes unit-scoped definition error
23:50 geekosaur or some such
23:51 comborico [LTA] Vague error message: Semi-colon at end of header in a subroutine definition
23:51 comborico I guess LTA handles the vagueness part.
23:54 geekosaur it's not vague, it's just meaningless if you don't know both the current implementation of rakudo sub declarations and the history behind them

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

Perl 6 | Reference Documentation | Rakudo