Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-11-06

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:25 bjz joined #perl6
00:28 pierre_ joined #perl6
00:40 tushar joined #perl6
00:54 pierre_ joined #perl6
01:19 protium Any idea why I'd be getting this while trying to build moarvm?
01:19 protium linking libmoar.so
01:19 protium linking moar
01:19 protium ./libmoar.so: undefined reference to `mp_set_long'
01:21 bjz joined #perl6
01:29 MasterDuke what os are you using?
01:31 protium Linux
01:32 protium Gentoo, specifically
01:32 protium For the most part, on stable branch
01:38 MasterDuke hmm, and how did you get moar?
01:40 protium Portage
01:40 protium The default build environment (like ports for BSD)
01:40 protium 2016.10
01:43 MasterDuke hmm, not sure. i don't use gentoo, but i'm pretty sure others have successfully built moar on it
01:43 cdg joined #perl6
01:44 bjz joined #perl6
01:44 MasterDuke have you tried just cloning it and building manually?
01:44 protium Well, no, but I guess I could do that
01:45 protium In general, I prefer staying within the package management system for obvious reasons (easier to maintain, keep sane env)
01:45 protium You mean clone it hot off the main branch on github?
01:45 MasterDuke yeah
01:46 MasterDuke if you don't specify a prefix it'll keep everything in its directory, you don't need to worry about polluting your filesystem
01:47 MasterDuke can at least figure out if it's your system in general or the portage script
01:48 protium Yeah, good point
01:48 cdg joined #perl6
01:48 protium Alright, will give it a shot
01:52 bjz joined #perl6
02:55 pierre_ joined #perl6
02:59 tushar joined #perl6
03:20 Ifdog joined #perl6
03:28 mayathecat joined #perl6
03:31 djbkd joined #perl6
03:31 djbkd joined #perl6
03:33 kent\n joined #perl6
03:35 shin_ joined #perl6
03:43 pierre_ joined #perl6
03:50 mayathecat joined #perl6
03:52 noganex joined #perl6
04:02 bjz_ joined #perl6
04:09 aborazmeh joined #perl6
04:09 aborazmeh joined #perl6
04:15 mayathecat joined #perl6
04:32 mayathecat joined #perl6
04:42 seatek if I override a method in a child class... is there a way to call the original (non-overridden) method from the child?
04:54 seatek PARENT.method-name doesn't error or warn about anything... but it doesn't call the method either
04:56 MasterDuke m: class A { method a() { say "parent" } }; class B is A { method a() { say "child"; callsame }}; B.a
04:56 camelia rakudo-moar c963ef: OUTPUT«child␤parent␤»
05:01 seatek ha! just "callsame"! wow. nice. :) thanks MasterDuke++ !
05:02 seatek i never would have thought to look for that in the docs under functional programming'
05:03 pierre_ joined #perl6
05:04 MasterDuke depends what you want to do though. that only works if you want to call the parent's method from the overridden child's method
05:05 seatek perfect for me! but yeah, i see what you mean. i just wanted to keep the parent method as the "default" and for special cases, override it, but still not have to redefine all the "defaults".. so callsame as the first thing worked perfectly
05:06 seatek (i never can remember if i have to update things in more than 1 place later on)
05:06 seatek never trust yourself is my motto
05:06 MasterDuke m: class A { method a() { say "parent a" } }; class B is A { method a() { say "child a" }; method b() { say "child b"; self.^mro[1].a }}; B.b
05:06 camelia rakudo-moar c963ef: OUTPUT«child b␤parent a␤»
05:07 mayathecat joined #perl6
05:07 seatek i knkew there had to be something with the mro
05:07 seatek though why element 1 i have no idea
05:08 MasterDuke i would think there's a way with PARENT somehow, but i don't remember what it is
05:08 MasterDuke m: class A { method a() { say "parent a" } }; class B is A { method a() { say "child a" }; method b() { say "child b"; self.^mro }}; B.b
05:08 camelia rakudo-moar c963ef: OUTPUT«child b␤»
05:08 MasterDuke m: class A { method a() { say "parent a" } }; class B is A { method a() { say "child a" }; method b() { say "child b"; say self.^mro }}; B.b
05:08 camelia rakudo-moar c963ef: OUTPUT«child b␤((B) (A) (Any) (Mu))␤»
05:08 seatek I tried PARENT::method method() and PARENT. the same
05:09 seatek i even tried SUPER ;)
05:09 MasterDuke [1] because it's the parent, [0] would be self, [2] grandparent, etc
05:09 seatek hey, that's tidy and makes sense
05:12 seatek would your parent at ^mro[1] have a ^mro[1] to their parent, and just no sense of the child?
05:13 MasterDuke m: class A { method a() { say "parent" } }; class B is A { method a() { say "child" }; method b() { say "b"; say self.^mro } }; class C is B { method c() { say self.^mro } }; B.b; C.c
05:13 camelia rakudo-moar c963ef: OUTPUT«b␤((B) (A) (Any) (Mu))␤((C) (B) (A) (Any) (Mu))␤»
05:14 djbkd joined #perl6
05:20 seatek that's a lot to stuff into places. is C's stuff refencing B's stuff? It must keep its own scope in each... but compiling the code... this gets complex. i suppose it's ok it took so long
05:34 Cabanossi joined #perl6
05:34 seatek I started to add documentation for callsame to the secion on overriding methods... but i'm not sure i should. what if people wanted to call with parameters... then they'd have to go the mro route, and that's a little funny
05:41 perlawhirl joined #perl6
05:48 seatek well, i'm going to put mention of it in there, anyway. i spent a lot of time looking for how to do it and i think it's probably not that uncommon. but mabye people won't want it there because it's a little funny
05:49 dalek doc: 9ccd0f2 | seatek++ | doc/Language/classtut.pod6:
05:49 synopsebot6 Link: http://doc.perl6.org/language/classtut
05:49 dalek doc: How to access overridden parent methods
05:49 dalek doc:
05:49 dalek doc: Maybe should not have this here because it's a little freaky.
05:49 dalek doc: review: https://github.com/perl6/doc/commit/9ccd0f272a
06:17 wamba joined #perl6
06:45 canopus joined #perl6
06:48 mayathecat joined #perl6
06:56 pierre_ joined #perl6
06:57 darutoko joined #perl6
07:38 CIAvash joined #perl6
07:40 zacts joined #perl6
07:50 pierre_ joined #perl6
07:59 Tonik joined #perl6
08:09 CIAvash joined #perl6
08:30 dalek doc: a15ca0b | gfldex++ | doc/Language/classtut.pod6:
08:30 synopsebot6 Link: http://doc.perl6.org/language/classtut
08:30 dalek doc: link rather then duplicate content
08:30 dalek doc: review: https://github.com/perl6/doc/commit/a15ca0b3b3
08:42 Actualeyes joined #perl6
08:49 Ifdog joined #perl6
08:51 Ifdog Excuse me but why "prompt" wont response to when in repl in windows?
08:52 seatek gfldex: although an esoteric answer, since it will lead people there from the section on inheritance, that's a much better answer if people can chew for a bit on it. thanks! :)
08:52 Ifdog Wont response to keys .
08:56 maybekoo2 joined #perl6
08:57 RabidGravy joined #perl6
08:57 samcv i love perl6 so much ♥
08:58 samcv promises are amazing, channels supplies. it makes me so happy
08:58 samcv just came here to say this :P
08:59 seatek samcv: i can't wait to start playing with some of that :)
09:00 samcv Proc::Async is great too. though i need to figure out how to get proc::async to capture stderr from rakudo
09:00 samcv i'm running perl6 on moarvm from proc async, i can capture stderr if i do like: note "message"; to print to stderr, but if there's an error in the code i don't see it
09:02 samcv but the perl6 bin is a shell file, so maybe i will have different result if i just don't go through that
09:05 samcv nope that didn't fix it hm
09:07 firstdayonthejob joined #perl6
09:12 samcv if i run it using the shell and proc async i capture the stderr of what i think is the rakudo compilier and moarvm
09:12 samcv so i guess i'll do that for now
09:19 RabidGravy I've got at least one module that has a test that runs a Perl 6 program
09:20 RabidGravy Audio::StreamThing does it to have the icecast client in a different process
09:21 samcv does it use a shell when it runs it?
09:21 RabidGravy let me look
09:23 RabidGravy no
09:24 RabidGravy https://github.com/jonathanstowe/Audio-StreamThing/blob/master/t/030-run.t
09:26 espadrine joined #perl6
09:35 rindolf joined #perl6
09:51 brrt joined #perl6
09:52 gfldex samcv: see https://irclog.perlgeek.de/perl6/2016-07-20#i_12870811
09:54 samcv thanks :)
10:14 FROGGS joined #perl6
10:14 FROGGS masak: JavaScript really has won :o) - https://turbo.github.io/
10:15 FROGGS we could perhaps do the same with OpenGL or so...
10:18 domidumont joined #perl6
10:23 domidumont joined #perl6
10:33 timotimo OpenCL or cuda, yes
10:34 timotimo it even has a bit of OpenCL(?) code in the middle with the "run" function
10:34 pierre_ joined #perl6
10:37 perlawhirl joined #perl6
10:56 RabidGravy on a related note I keep meaning to get an fpga board for a similar purpose
11:01 domidumont joined #perl6
11:02 grondilu joined #perl6
11:03 domidumont joined #perl6
11:03 domidumont joined #perl6
11:04 dalek doc: 7093f32 | gfldex++ | doc/Type/Proc/Async.pod6:
11:04 synopsebot6 Link: http://doc.perl6.org/type/Proc/Async
11:04 dalek doc: fix markup
11:04 dalek doc: review: https://github.com/perl6/doc/commit/7093f3256b
11:07 girafe joined #perl6
11:08 ale1ster joined #perl6
11:18 grondilu how would you deal with anonymous unions with NativeCall?
11:19 grondilu e.g.  struct Foo { int type; union { char name; int code; }; }
11:25 timotimo grondilu: i'd probably build two versions of Foo and nativecast between them ...
11:26 * grondilu completly forgot what nativecast does
11:27 timotimo https://github.com/timo/SDL2_raw-p6/blob/master/lib/SDL2/Raw.pm#L419
11:28 bart joined #perl6
11:34 setty1 joined #perl6
11:41 cibs joined #perl6
11:43 FROGGS grondilu: you can also stick a union in there...
11:45 FROGGS m: use NativeCall; class u is repr<CUnion> { has uint8 $.name; has int32 $.code }; class Foo is repr<CStruct> { has int32 $.type; HAS u $.u };
11:45 camelia rakudo-moar c963ef: ( no output )
11:46 FROGGS using nativecast like in the SDL2 example might also be nice, because you'd have a specialized Foo "subclass" then, instead of accessing the union members as $foo.u.name
11:50 maybekoo2 joined #perl6
12:03 gfldex brrt++ # http://brrt-to-the-future.blogspot.de/2016/11/a-guide-through-register-allocation.html
12:08 cdg joined #perl6
12:14 tbrowder .tell viki last chance to object to my module breakup/naming scheme at github.com/tbrowder/Misc-Utils-Perl6
12:14 yoleaux tbrowder: I'll pass your message to viki.
12:14 tbrowder .tell ilmari last chance to object to my module breakup/naming scheme at github.com/tbrowder/Misc-Utils-Perl6
12:14 yoleaux tbrowder: I'll pass your message to ilmari.
12:25 rindolf joined #perl6
12:53 pierre_ joined #perl6
12:56 kurahaupo__ joined #perl6
12:59 RabidGravy okay this windows laptop has been "checking for updates" for over an hour now
13:00 timotimo i've been told windows update has an algorithm in it that's extremely bad when many needed updates pile up
13:00 timotimo perhaps like "exponential" bad even
13:00 timotimo http://www.wsusoffline.net/ - i'm not sure if this helps
13:07 masak top o' the Sunday to you, #perl6
13:10 DrForr Afternoon.
13:11 lizmat masak  DrForr timotimo RabidGravy o/
13:12 RabidGravy Rarr!
13:12 masak .u dinosaur
13:13 yoleaux No characters found
13:13 masak (...yet...)
13:15 tyil joined #perl6
13:16 tyil does anyone know how I can add a header to a GET request made with HTTP::UserAgent? I currently have the following snippet http://termbin.com/bqa9
13:17 tyil but if I simply pass the %headers as the 2nd arg, it cannot resolve the caller
13:19 lizmat RabidGravy might know
13:19 RabidGravy you can do it
13:20 RabidGravy though I don't know what "pass the %headers as the 2nd arg, it cannot resolve the caller" means
13:22 RabidGravy an example of it failing would be good
13:22 tyil Use netcat.
13:23 tyil woops
13:23 tyil wrong copy/paste
13:24 tyil http://termbin.com/657y
13:24 timotimo it seems like it wants the header fields as named arguments
13:25 timotimo so it expects you to flatten your headers hash
13:25 RabidGravy er
13:25 RabidGravy you are passing a Hash
13:25 RabidGravy you just pass them items as normal named arguments
13:27 RabidGravy so something like "$ua.get('http://foo.com/', Gorilla => 'bananas')"
13:27 RabidGravy that's what the slurpy *%headers does
13:27 tyil ah
13:27 tyil it doesnt fail to run if I pass it like that
13:27 RabidGravy I know
13:28 tyil getting a 400 reply now, so I seem to have something to fix still, but now I can continue on that
13:28 tyil thanks
13:28 RabidGravy :)
13:29 RabidGravy I don't like that AUTOGEN malarkey though, methinks some prototypes in there might be called for
13:30 RabidGravy tyil, if you want finer grained control of the request, it;s make an HTTP::Request object and then pass that to $ua.request
13:30 RabidGravy .get is just a helper for the simple case really
13:32 RabidGravy there are also a bunch of helper subs in HTTP::Request::Common for the most usual types of requests
13:38 inokenty joined #perl6
13:39 * RabidGravy adds an issue to HUA to remind him to do the prototypes
13:42 tyil with the HTTP::Request and HTTP::UserAgent.request() it works
13:42 tyil thanks a ton :>
13:48 tbrowder hi, #perl6
13:52 tbrowder question of the day ref arrays: is returning a generated container from a sub expensive as compared to filling an input container with the generated data?
13:53 timotimo should be about the same cost
13:53 timotimo though if you can re-use the input container a lot, you can get a bit more performance out of the whole thing
13:53 timotimo but it shouldn't be much
14:05 raiph joined #perl6
14:07 stmuk_ I wonder how many hours of my life are spent waiting for gcc
14:08 FROGGS I guess less than waiting for clang and msvc
14:11 raiph joined #perl6
14:13 raiph joined #perl6
14:15 raiph joined #perl6
14:19 Rawriful joined #perl6
14:32 raiph joined #perl6
14:32 Rawriful joined #perl6
14:40 Rawriful joined #perl6
14:46 wamba joined #perl6
14:59 tushar joined #perl6
15:19 cdg joined #perl6
15:20 cdg_ joined #perl6
15:32 maybekoo2 joined #perl6
15:39 djbkd joined #perl6
15:39 djbkd joined #perl6
15:44 skids joined #perl6
15:54 domidumont joined #perl6
16:01 mayathecat joined #perl6
16:01 meteorologytoday joined #perl6
16:05 cdg joined #perl6
16:07 meteorologytoday joined #perl6
16:09 xinming_ joined #perl6
16:18 xinming joined #perl6
16:20 TakinOver joined #perl6
16:22 ajr_ joined #perl6
16:24 dalek ecosystem: 3a4ca29 | titsuki++ | META.list:
16:24 dalek ecosystem: Add MeCab to ecosystem
16:24 dalek ecosystem:
16:24 dalek ecosystem: See https://github.com/titsuki/p6-MeCab
16:24 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/3a4ca29442
16:24 dalek ecosystem: 69b5094 | titsuki++ | META.list:
16:24 dalek ecosystem: Merge pull request #264 from titsuki/add-mecab
16:24 dalek ecosystem:
16:24 dalek ecosystem: Add MeCab to ecosystem
16:24 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/69b5094314
16:26 ajr_ Is anyone around who saw my comments about Rakudo* on Raspberry Pi?
16:26 ajr_ (Yesterday)
16:29 CIAvash joined #perl6
16:29 ggoebel joined #perl6
16:34 ajr_ Has anyone successfully installed Rakudo* 2016.10 on a Pi?
16:35 ajr_ (Or given up after failing to do so?)
16:35 DrForr I believe it's been done; I haven't tried however. (I do have an RPi, been meaning to do it.)
16:36 ajr_ Dr. Forr - I've just started trying, and I'm getting errors in the "make" stage. Hoping to learn from others.
16:37 DrForr Well, that would not be me at the moment :/
16:39 ajr_ At the moment, my suspicion is that the process is getting killed because it runs out of available memory.
16:41 DrForr Well, that can be solved with ulimit, I do believe. Or at least the OOM killer can be staved off. How much RAM is it taking?
16:51 zakharyas joined #perl6
16:53 japhb .tell tadzik Ping re: my Terminal-ANSIColor PR: https://github.com/tadzik/Terminal-ANSIColor/pull/6
16:53 yoleaux japhb: I'll pass your message to tadzik.
16:54 RabidGravy ajr_, I may have done but let me try
16:54 RabidGravy is it by any chance complaining about the compiler?
16:55 RabidGravy I seem to recall that the default version of gcc is no good, and you have to install the newest version
16:55 RabidGravy I have unplugged one of the Pis from the network temporarily 'ang on
16:56 tadzik japanoise u
16:56 yoleaux 16:53Z <japhb> tadzik: Ping re: my Terminal-ANSIColor PR: https://github.com/tadzik/Terminal-ANSIColor/pull/6
16:56 tadzik arr, keyboard stupid
16:56 tadzik japhb: thanks, didn't have a moment to test it yet, will doo soon :)
16:57 RabidGravy ajr_, yeah I have "gcc (Raspbian 4.8.2-21~rpi3rpi1) 4.8.2" I believe the default is something 3ish
16:57 DrForr m: class Foo::Bar is Foo { }; class Foo { };
16:57 camelia rakudo-moar 736ab1: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤'Foo::Bar' cannot inherit from 'Foo' because it is unknown.␤at <tmp>:1␤»
16:58 RabidGravy but just building to check that nothing gone broken in the meantime anyway
16:58 DrForr Interesting, my error must be to do with roles then.
17:01 RabidGravy ajr_, so if you haven't done so already, it's install the gcc-4.8 package and then update the 'gcc' alternative to make that one the default gcc
17:02 japhb tadzik: Ah, thanks.  You mentioned checking it after a movie, and I was thinking "Wow, heck of a long movie!"  ;-)
17:02 ajr_ DrForr - The process manager showed around 700 of the available 735MB at the highest point I saw. My attention was probably distracted by some exciting paint drying.
17:03 ajr_ RabidGravy - I just updated to what I believe is the latest iteration of the OS, but I'll check for the gcc version.
17:04 RabidGravy I think the gcc version is crucial here
17:05 RabidGravy I'm just updating a windows machine that hasn't been updated for a year and a half
17:05 japhb tadzik: I am actually starting to use it in my Terminal-Print example: https://github.com/japhb/Terminal-Print/blob/ui_test/examples/rpg-ui.p6  (That's not PR'ed back to the upstream yet, because I'm using development of the example to drive API and performance improvements to Terminal-Print itself.)
17:05 RabidGravy it's rather tedious
17:05 DrForr You're in better hands than mine, as I said I haven't tried yet. I got a new RPi from OSCON swag so I'll probably try later this week.
17:08 ajr_ RabidGravy: What are the symptoms of the gcc problem? What error messages at what stage?
17:08 RabidGravy I can't remember to be honest
17:08 RabidGravy it was like a year and a half ago :)
17:09 ajr_ Never mind, I was just hoping to whittle down the possibilities. I'm lucky to remember stuff a week and half ago. :-)*
17:09 stmuk_ ISTR the rPI gcc was quite dramatically broken
17:09 qub joined #perl6
17:09 RabidGravy but with the gcc version above and an otherwise stock Raspbian it builds fine
17:11 stmuk_ I think it was either signal 11 or an internal gcc error
17:12 RabidGravy yeah I think it was some internal gcc error regarding some strange asm macro
17:13 RabidGravy actually yeah, it was a code generation error of some kind whereby it got confused while trying to make the asm stage
17:17 Rawriful joined #perl6
17:18 telex joined #perl6
17:19 stmuk_ this windows 10 ubuntu subsystem thing is quite good
17:20 stmuk_ although rakudo doesn't build under it
17:23 DrForr They don't like competition :)
17:26 xinming joined #perl6
17:32 RabidGravy is it somewhat like coLinux was a few years back, with a Linux kernel running as a Windows service?
17:33 mst I believe it's more like the way e.g. netbsd's linux ABI emulation modules work
17:45 labster joined #perl6
17:49 * geekosaur understands it as running *alongside* the windows "kernel", since it's a microkernel arch
17:50 Lucas_One joined #perl6
17:51 geekosaur which is why it gets to do things windows can't, like true fork()
17:51 qub hello! how to reset eof "flag" on $*IN? (in case of recieving multiple EOFs) - i tried binary "read", but it didn't help - http://pastebin.com/K1kUk4aq
17:52 lichtkind joined #perl6
17:52 geekosaur eof is not a character, you can't "eat" it
17:54 moritz can can reopen STDIN though
17:54 moritz s/can/you/
17:55 mst geekosaur: oh, hmm, possibly
17:55 moritz used to work with $*IN = open('-') but that doesn't seem to work anymore; dunno how it's done today
17:55 geekosaur that may not b what they are seeing, I don't know. stdio often does remember eof on terminal because people get confused when eof isn't really eof
17:55 geekosaur maybe libuv does too
17:56 Lucas_One joined #perl6
17:57 geekosaur joined #perl6
17:59 ajr_ BTW, what's the justification for the "put" command? It's not obvious what makes it different from the other output commands.
17:59 BenGoldberg joined #perl6
17:59 DrForr The inverse of 'get'.
18:01 tadzik japhb; hah, yeah, now I remember! Sorry, I totally forgot then
18:02 mst tadzik: did you play with timotimo's POSTBUILD yet?
18:02 tadzik japhb: I was mostly concerned if it didn't accidentally break some existing functionality, since the module has no tests
18:02 tadzik mst: no, but the patch looks a lot like my AFTERPARTY from years ago :) Can't find that one anywhere though
18:05 qub moritz: tried to reopen http://pastebin.com/8vsgpdDh, but got error "read string requires an object with REPR MVMOSHandle"
18:06 setty1 joined #perl6
18:06 geekosaur no, that would not work, stdin does not have a determinable path
18:08 qub but https://docs.perl6.org/type/IO$COLON$COLONSpecial
18:08 geekosaur the process inherits a file descriptor, it has no idea where that fd came from. and it may not *have* a path if it's e.g. a pipe or a socket
18:10 geekosaur also after $*IN.close there is not going to be a way to get it back
18:11 geekosaur (ok, I can see IO::Special but I suspect you need $*IN.path.Str. and you *do* need to not .close, or nothing will save you)
18:11 geekosaur "let me just go back in time and not have closed it, so I can reopen it even if it stopped existing like a pipe or socket does"
18:14 Rawriful joined #perl6
18:14 qub in case of .path.Str "open" tries to open file in working dir, but still no luck with open without close: http://pastebin.com/xC1dsMei
18:18 CIAvash joined #perl6
18:21 TakinOver joined #perl6
18:21 geekosaur if I understand IO::Special correctly that would seem buggy
18:23 geekosaur what exactly are you trying to reopen / read past eof on, anyway?
18:24 qub next "file"
18:24 geekosaur ...
18:24 geekosaur what next "file"
18:25 geekosaur is this a socket, is this a pipe, is this a terminal, is this a magtape, is this a ???
18:26 qub i have endless stream on stdin in which files are separated with eof char (ASCII 04)
18:27 geekosaur uh
18:27 geekosaur you still have nto answered my question. and ASCII 04 is not actually EOF. it is a command *to the terminal driver* that causes it to produce a short read to the program
18:28 Hotkeys m: say grep * < 1000, map * ** 2, (1, 3 ... *)
18:28 camelia rakudo-moar 9a6379: OUTPUT«(...)␤»
18:28 Hotkeys m: say eager grep * < 1000, map * ** 2, (1, 3 ... *)
18:28 Hotkeys why doesn't this work?
18:28 camelia rakudo-moar 9a6379: OUTPUT«(timeout)»
18:29 jast because it applies the test against an infinite series
18:29 jast that's my guess, anyway. grep doesn't know that it can abort after the first test that returns false...
18:29 TakinOver joined #perl6
18:30 Hotkeys fair
18:30 Hotkeys Is there a convenient way to do squares up to X with a sequence alone?
18:30 lizmat how many do you need?
18:31 Hotkeys (1 ** 2, 2 ** 2 ... $x) essentially
18:32 lizmat Hotkeys: slice it
18:32 lizmat m say (1,2,4...*)[^10]
18:32 lizmat m: say (1,2,4...*)[^10]
18:32 camelia rakudo-moar e42b68: OUTPUT«(1 2 4 8 16 32 64 128 256 512)␤»
18:33 lizmat m: my $x = 20; say (1,2,4...*)[^$x]
18:33 camelia rakudo-moar e42b68: OUTPUT«(1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288)␤»
18:34 jast that works if the number of elements is known; in this case it would happen to work because you can determine the correct limit using a logarithm
18:35 Hotkeys specifically the sequence I'm doing is squares of odd numbers actually so
18:35 jast ...[^log(1000)/log(2)]
18:35 Hotkeys 1², 3², 5² ... 1000
18:35 jast no wait, that doesn't make sense :)
18:35 jast sqrt(1000) actually
18:36 qub geekosaur: i need to enter arbitrary text line by line in terminal and send it to program by pressing ctrl+d
18:36 jast I'm too tired to think about this
18:38 jast qub: so just keep reading and whenever you get a short read, you know that the next read will start another file. unfortunately there will be no way to signal "this is the last file" but if your stream truly is infinite that shouldn't matter
18:39 vendethiel joined #perl6
18:40 Hotkeys does p6 have a function equivalent to takewhile?
18:40 timotimo Hotkeys: map with "last"
18:41 geekosaur jast, I think the point is that it stops after the first eof, which is a common thing that levels above the system call (such as libuv) do on terminals so that xxx^D works as expected by naïve programs)
18:42 geekosaur but I suspect this is one of those things where we need to do something to libuv, and can't
18:42 jast I just tried with a tiny P5 program, I can keep reading beyond the first ^D
18:42 jast oh yeah, libuv, didn't think about the internals :)
18:42 FROGGS joined #perl6
18:44 qub yes, i tried to port p5 script
18:46 dalek ecosystem/MARTIMM-patch-1: 1d00beb | (Marcel Timmerman)++ | META.list:
18:46 dalek ecosystem/MARTIMM-patch-1: Pod::Render module
18:46 dalek ecosystem/MARTIMM-patch-1:
18:46 dalek ecosystem/MARTIMM-patch-1: Pod::Render module and pod-render program to render pod to html using Pod::To:HTML and markdown using Pod::To::Markdown. First can also be converted to pdf using wkhtmltopdf when installed. The module is a sort of wrapper to add better css support.
18:46 dalek ecosystem/MARTIMM-patch-1: review: https://github.com/perl6/ecosystem/commit/1d00bebb9f
18:46 seatek joined #perl6
18:47 FROGGS m: say map { .² }, (1, 3, 5 ... sqrt(1000)) # would be nice if *² worked too
18:47 camelia rakudo-moar e42b68: OUTPUT«(1 9 25 49 81 121 169 225 289 361 441 529 625 729 841 961)␤»
18:49 Hotkeys oh that is nice
18:51 canopus joined #perl6
18:51 pmurias joined #perl6
18:51 pmurias hi
18:57 nightfrog joined #perl6
18:57 dalek ecosystem: 1d00beb | (Marcel Timmerman)++ | META.list:
18:57 dalek ecosystem: Pod::Render module
18:57 dalek ecosystem:
18:57 dalek ecosystem: Pod::Render module and pod-render program to render pod to html using Pod::To:HTML and markdown using Pod::To::Markdown. First can also be converted to pdf using wkhtmltopdf when installed. The module is a sort of wrapper to add better css support.
18:57 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/1d00bebb9f
18:57 dalek ecosystem: a49baa0 | Altai-man++ | META.list:
18:57 dalek ecosystem: Merge pull request #265 from perl6/MARTIMM-patch-1
18:57 dalek ecosystem:
18:57 dalek ecosystem: Pod::Render module
18:57 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/a49baa0a3a
19:06 TakinOver joined #perl6
19:11 pmurias joined #perl6
19:11 FROGGS joined #perl6
19:13 Tonik joined #perl6
19:14 bart joined #perl6
19:15 mayathecat joined #perl6
19:18 tushar joined #perl6
19:18 japhb .tell tadzik I ran a few ad-hoc tests of both the new and old functionality, and fixed a couple bugs because of that ... did you want me to create a test file as part of the PR?
19:18 yoleaux japhb: I'll pass your message to tadzik.
19:18 tadzik japhb: nah, no need :) looking at the PR right now
19:18 yoleaux 19:18Z <japhb> tadzik: I ran a few ad-hoc tests of both the new and old functionality, and fixed a couple bugs because of that ... did you want me to create a test file as part of the PR?
19:19 japhb Oh, cool beans
19:20 mayathecat joined #perl6
19:22 tadzik hm, maybe a line for example.pl though?
19:26 El_Che joined #perl6
19:27 japhb tadzik: Yeah, can do.
19:27 tadzik ossum
19:38 mayathecat joined #perl6
19:46 bjz joined #perl6
19:46 labster joined #perl6
19:51 BenGoldberg joined #perl6
19:52 girafe joined #perl6
19:56 japhb tadzik: Looks like you merged the first one, so I made the example.pl extension a new PR
20:04 shlomif joined #perl6
20:19 mayathecat joined #perl6
20:22 bjz_ joined #perl6
20:39 TEttinger joined #perl6
20:45 bjz joined #perl6
20:48 iH2O joined #perl6
20:53 iH2O left #perl6
20:57 kurahaupo__ joined #perl6
21:21 zrr joined #perl6
21:23 qub joined #perl6
21:25 lolo78 joined #perl6
21:25 kurahaupo_ joined #perl6
21:25 cdg joined #perl6
21:26 cdg joined #perl6
21:28 kurahaupo__ joined #perl6
21:29 lolo78 Hi everyone.
21:29 lolo78 A person that I know wants to rewrite his Perl 5 application in Perl 6. Part of it is a GUI written with Web technologies and using  HTML5+ Canvas + Jquery, etc.  I have no experience with Web development, especially not in P6. Is there any module or framework that you would recommend?
21:32 moritz lolo78: the state of P6 web frameworks is not very advanced right now; I guess my advice would be to use Inline::Perl5 (or Inline::Perl6 from p5) to gradually migrate business logic to p6, but keep using whatever p5 webframework the app i susing now
21:32 moritz *using
21:33 zostay what does this mean? "Cannot invoke this object (REPR: Null; VMNull)"
21:34 moritz zostay: it means that you're trying to invoke something, but that somthing is a NULL on a very low level
21:35 geekosaur something internal leaked out into perl6 level
21:37 lolo78 Moritz: Thanks Moritz. Right now, I think the P5 application is using CGI, so it might be a good idea to upgrade to more modern technologies. If there is no framework, maybe there are still a few modules that can be used. It's not a full web application, but an application using a Web browser and HTTP for its graphical interface. Maybe a couple of good modules might be sufficient. I was...
21:37 lolo78 ...thinking about things like https://github.com/gfldex/http-server-simple or similar things.
21:38 zostay that's kind of what i figured, any suggestion on how i can track it down?
21:39 RabidGravy lolo78, I've been using HTTP::Server::Tiny + Crust for a few things, works well for me
21:39 moritz zostay: do you have a backtrace? if not, try with --ll-exception
21:40 zostay nope and nope then either
21:40 RabidGravy zostay, the pre-eminent cause of that is something like a .wrap or other low level operation on a callable that would cause it to get saved as an attribute during compilation
21:40 RabidGravy and the resulting closure "disappearing" during the pre-compilation
21:41 lizmat m: use nqp; (nqp::null)()   # zostay
21:41 camelia rakudo-moar c5c600: OUTPUT«Cannot invoke this object (REPR: Null; VMNull)␤  in block <unit> at <tmp> line 1␤␤»
21:41 RabidGravy there are tickets for it in RT
21:41 qub joined #perl6
21:43 zostay RabidGravy++ i am doing something like that and commenting out bits of that code at least change what's happening in a way that might help me find, thx
21:44 qub regarding non-working multiple eof-s in $*IN: where should i send the bug report: rakudo/nqp/moarvm/libuv?
21:44 moritz qub: rakudo
21:44 zostay Perl 6 is such a joy to play with when it's a joy. When it isn't, it's like being nibbled to death by cats.
21:45 moritz that's where bug reports go unless you're quite sure what layer it's in
21:45 moritz qub: that said, what exactly is the desired behavior?
21:48 RabidGravy regarding that, I think it was BMC Remedy that stored custom comment fields in a large BLOB in the database separated by FF characters
21:49 bjz joined #perl6
21:49 RabidGravy there's no end of crack addled behaviour in software that originated in the pre-modern era
21:53 RabidGravy I've just done a test on Linux and it will happily "$*IN.slurp-rest' something with an embedded 004 in it
21:53 geekosaur yes, because that is not actually EOF
21:53 geekosaur this is a tty driver-specific behavior, the stty-d eof char causes a short read
21:54 geekosaur the tty eof char is not passed on
21:54 RabidGravy right, but then I'm not sure what we are talking about
21:54 geekosaur stdio, and probably libuv, make eof "sticky" on terminal filehandles, because the common idiom of looking only for an 0-length read will fail if you type xxx^Dyyy
21:55 geekosaur (that is, programs will handle the initial short read as a normal read that returned less than usual, and expect the next read to return 0. with ttys the next read returns more data, so libs like stdio and probably libuv remember they saw the short read and return EOF from then on unless "reset"
21:56 RabidGravy right, so how is it in the data that qub is talking about then?
21:56 bjz joined #perl6
21:56 geekosaur qub's complaint is they are sending data via terminal, control-d, then the next set of data, control-d, ...
21:57 geekosaur the short-read workaround prevents this because after the first short read, the handle is considered to always be at EOF
21:57 RabidGravy well, it's just stick the terminal in "raw" mode with stty then
21:57 geekosaur but then you can't detect end at all unless you watch for some magic sequence at the beginning. also you will need some way to pass through a control-D that is *not* an eof
21:57 geekosaur basically, replacing one can of worms with a smellier one
21:59 lizmat perhaps an IO::Handle.split( FF ) could work ?
21:59 RabidGravy I'm feeling the hate growing, despite having maintained a large proportion of the P5 Term::* modules into the 21st centurt
21:59 RabidGravy y
21:59 * geekosaur thinks the thing being done here could be done better some way...
21:59 geekosaur tar|uuencode and uudecode/split on the remote, or something
22:01 RabidGravy or, y'know providing a sane modern interface or something
22:04 VVbrJVldCqK joined #perl6
22:04 VVbrJVldCqK https://www.youtube.com/watch?v=3EsJLNGVJ7E & https://wikileaks.org/podesta-emails/emailid/15893, http://www.reuters.com/article/us-usa-election-foundation-idUSKBN12Z2SL & https://wikileaks.org/podesta-emails/emailid/3774 (ctrl+f qatar) - please don't let these be buried
22:04 VVbrJVldCqK left #perl6
22:05 RabidGravy wikileaks being an agent of the russian state now and all
22:05 RabidGravy twats
22:06 RabidGravy right, that's me done for the day, have fun
22:06 lizmat good night, RabidGravy
22:13 * lizmat wonders whether we should auto-purge any drive-by messages like the one from VVbrJVldCqK just now
22:14 lizmat basically the ones with /join /msg / quit   and nothing inbetween
22:15 lizmat (from the clogs, I mean)
22:19 TEttinger but that would bury the spam! and it asked not to bury the spam with a "please"
22:25 setty1 joined #perl6
22:37 AlexDaniel joined #perl6
22:45 grondilu if the message also contains only URLs, then yes.
22:46 grondilu oh there was an additional request not to burry the thing indeed
22:46 grondilu (my bad)
22:58 bjz joined #perl6
23:14 seatek joined #perl6
23:51 xinming joined #perl6

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

Perl 6 | Reference Documentation | Rakudo