Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-11-02

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:03 skids joined #perl6
00:16 Sgeo__ joined #perl6
00:19 Sgeo joined #perl6
00:30 BenGoldberg joined #perl6
00:41 pierre_ joined #perl6
00:44 mohae joined #perl6
00:48 committable6 joined #perl6
00:48 evalable6 joined #perl6
00:48 benchable6 joined #perl6
00:49 bisectable6 joined #perl6
00:55 pierre_ joined #perl6
00:58 aborazmeh joined #perl6
00:58 aborazmeh joined #perl6
01:03 pierre_ joined #perl6
01:09 stanley joined #perl6
01:10 sftp joined #perl6
01:12 Sgeo joined #perl6
01:15 Sgeo_ joined #perl6
01:16 mephinet joined #perl6
01:22 BenGoldberg m: say Inf;
01:22 camelia rakudo-moar a1347c: OUTPUT«Inf␤»
01:22 BenGoldberg m: say [max];
01:22 camelia rakudo-moar a1347c: OUTPUT«-Inf␤»
01:33 pierre_ joined #perl6
01:36 aborazmeh joined #perl6
01:36 aborazmeh joined #perl6
01:40 pierre_ joined #perl6
01:43 Xliff joined #perl6
01:44 AlexDaniel BenGoldberg: http://irclog.perlgeek.de/perl6/2016-02-10#i_12017010
01:46 AlexDaniel and if you read that long enough, you'll see a mention of #127506
01:46 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=127506
01:47 AlexDaniel m: sub min(*@a) { return ‘Oh no, NaNs!’ if NaN === any(@a); max @a }; say min NaN, 5
01:47 camelia rakudo-moar a1347c: OUTPUT«Oh no, NaNs!␤»
01:47 AlexDaniel m: sub min(*@a) { return ‘Oh no, NaNs!’ if NaN === any(@a); max @a }; say min Inf, 5
01:47 camelia rakudo-moar a1347c: OUTPUT«Inf␤»
01:50 BenGoldberg m: say [max] NaN;
01:50 camelia rakudo-moar a1347c: OUTPUT«NaN␤»
01:51 BenGoldberg m: dd (NaN <=> NaN);
01:51 camelia rakudo-moar a1347c: OUTPUT«Nil␤»
01:51 BenGoldberg m: so (NaN <=> NaN);
01:51 camelia rakudo-moar a1347c: OUTPUT«WARNINGS for <tmp>:␤Useless use of "so " in expression "so (NaN <=> NaN)" in sink context (line 1)␤»
01:51 BenGoldberg m: say so (NaN <=> NaN);
01:51 camelia rakudo-moar a1347c: OUTPUT«False␤»
01:53 * BenGoldberg thinks comparisons on NaNs should return failures.
01:55 Xliff joined #perl6
01:55 Xliff \o
01:58 Xliff Hey there, can you use Perl6 subs as C handlers via NativeCall?
01:59 rodrigok joined #perl6
01:59 Xliff I don't think that's covered in the docs, anywhere. But I will admit it has been a while since I've looked.
02:02 Xliff Also, here's a thought... is there any possibility that libxslt would be used without libxml2?
02:03 Actualeyes1 joined #perl6
02:08 BenGoldberg m: say 4 == 1E12.log10 div 3
02:08 camelia rakudo-moar a1347c: OUTPUT«Cannot resolve caller infix:<div>(Num, Int); none of these signatures match:␤    (Int:D \a, Int:D \b)␤    (int $a, int $b --> int)␤  in block <unit> at <tmp> line 1␤␤»
02:09 pierre_ joined #perl6
02:15 Xliff joined #perl6
02:25 FROGGS_ joined #perl6
02:39 canopus joined #perl6
02:46 Xliff m: say 4 == 1E12.log10.Int div 3
02:46 camelia rakudo-moar a1347c: OUTPUT«False␤»
02:46 Xliff m: 1E12.log10.say
02:46 camelia rakudo-moar a1347c: OUTPUT«12␤»
02:46 Xliff m: (1E12.log10 div 3).say
02:46 camelia rakudo-moar a1347c: OUTPUT«Cannot resolve caller infix:<div>(Num, Int); none of these signatures match:␤    (Int:D \a, Int:D \b)␤    (int $a, int $b --> int)␤  in block <unit> at <tmp> line 1␤␤»
02:46 Xliff m: (1E12.log10.Int div 3).say
02:46 camelia rakudo-moar a1347c: OUTPUT«3␤»
02:46 timotimo m: (1E12.log10.round div 3).say
02:46 camelia rakudo-moar a1347c: OUTPUT«4␤»
02:46 Xliff Figures.
02:46 timotimo m: (1E12.log10 - 12).say
02:46 Xliff timotimo: Do you know if perl6 subs can be passed as handlers to C code via NativeCall?
02:46 camelia rakudo-moar a1347c: OUTPUT«-1.77635683940025e-15␤»
02:46 timotimo they can
02:46 timotimo though i don't know what you mean by "handlers"s
02:46 Xliff kk
02:46 Xliff timotimo: Basically -- function pointers
02:47 timotimo ah, yes
02:47 timotimo that's what you get when you pass a sub as a &foo param
02:47 Xliff Now I feel dirty for saying "pointers" in this channel. Thanks for that.
02:48 Xliff So if I have a sub f(int, int, int) that returns a class A, how would I set that up?
02:48 timotimo it returns a class? :)
02:48 Xliff I'm being complex for a reason. ;)
02:48 Xliff so...
02:48 timotimo you can put --> A inside the parenthesis
02:49 timotimo though C doesn't care what the function looks like
02:49 Xliff sub myNativeCode(&foo(int, int, int) --> A)
02:49 timotimo as long as the code that's compiled to work with the argument uses it correctly
02:49 timotimo no, not like that
02:49 Xliff (although generally handlers are void)
02:49 Xliff (not always, though)
02:49 timotimo first off, you don't have to give any signature for that at all
02:50 timotimo there's no signaling or difference, really, for the C side which will be receiving that "function"
02:50 Xliff Maybe look into nativecall examples in roast again... ;P
02:51 timotimo the only difference is what perl6 will allow you to put in there
02:51 Xliff Also, can you see any possibility of libxslt being used without libxml2?
02:51 timotimo i have no clue about either of these libraries
02:51 Xliff Oh, so it's the "these are not the droids you are looking for" excuse? ;)
02:53 timotimo don't forget that the "signature" you declare in C only changes how the compiled code grabs its arguments from registers and the stack
02:54 Xliff OK. Confirms what I suspected. Thanks.
02:54 timotimo when you receive a function pointer from C, that's when you'll have to give it the right signature in perl6-land
02:54 timotimo so that perl6 knows what registers and stack positions to fill how
02:58 Xliff Yes, yes.
02:59 Xliff I've done the getting-functs-from-C-to-p6 dance, already. It was the other way that I hadn't done.
03:00 Xliff It's one thing to be able to run C-code in perl. It's another for C to accept P6 code. Although I guess that would just be a pointer to MoarVM byte-code?
03:00 timotimo nope
03:00 timotimo that would be insane
03:00 Xliff i'll shut up now, then.
03:00 Xliff "It's magic!"
03:00 timotimo we don't have a cpu that runs moarvm byte code yet
03:00 Xliff Nope. Now I'll shut up.
03:00 timotimo we just create a tiny piece of runnable code that grabs the arguments it's configured to take and invokes a sub-interpreter
03:01 gfldex leave him be, he is scared! :->
03:01 Xliff Well. I meant a function pointer to a piece of moar VM that does the actual execution.
03:01 timotimo right
03:01 timotimo sadly, having a piece of C stack in the middle makes us really inflexible to what we can do
03:01 Xliff ((gfldex++)--) ^^ 0.314159
03:02 timotimo for example, we can't route exceptions through from the sub-interpreter to the main interpreter :(
03:02 timotimo that's what "unwound entire stack and missed the exception handler" means
03:02 Xliff Aha!
03:02 timotimo because who the F knows what was going on inside that moarvm sandwich
03:02 timotimo for all we know, it could have spawned a thread that constantly writes new values into the stack region that belongs to that piece of C code
03:03 baest joined #perl6
03:03 timotimo and when we just say "well, we're done with this stack, now that we've got an exception through"
03:03 timotimo we're screwed bigtime :)
03:04 timotimo sadly, i know nothing about how C++ exceptions work. we could potentially cooperate with those
03:04 Xliff Ah! The joys (and hair-pulling-complexity) of language internals.
03:04 timotimo :)
03:04 Xliff (gfldex was right...)
03:07 timotimo this first article that showed up when searching for "c++ exception internals" suggests how exceptions are compiled/run depends on the compiler
03:07 timotimo fun!
03:08 timotimo but that can't be right
03:08 kurahaupo__ joined #perl6
03:11 timotimo huh. so maybe it puts a symbol named "cxxabisomethingsomething" into the object file
03:11 timotimo maybe that's how they manage interoperability
03:23 pierre_ joined #perl6
03:27 rodrigok joined #perl6
03:32 kst` joined #perl6
03:33 pierre_ joined #perl6
03:33 timotimo how hard can it be to register a catch handler that just catches everything and uses some kind of introspection to figure out what the thrown exception class is called and build an X::Cpp::AdHoc with the name in it? :D
03:35 perlawhirl joined #perl6
03:37 wtwt5237 joined #perl6
03:39 geekosaur "some kind of introspection" may not be a thing
03:39 geekosaur (or rather, possibly exists but different for every c++ compiler or even version thereof)
03:41 kurahaupo_ joined #perl6
03:43 wtwt5237 hi guys, I am an enthusiastic perl5 user. But I have to admit not many people are using perl now. Do you guys think perl6 will revive the glory of perl one day? Just curious what other people think
03:44 kurahaupo__ joined #perl6
03:45 timotimo geekosaur: we're already crazy enough to support name mangling of a few different c++ compilers
03:46 timotimo wtwt5237: i've seen people say "perl usage is declining" and other people say "perl usage is staying strong"; i have no way to figure out which is accurate :(
03:46 seatek wtwt5237: ha! personally doesn't matter to me what other people are getting glorified on. this is working great for me.
03:46 timotimo but we're pretty certain that perl6 is a fantastic programming language and i'm certain its charm reaches more than just perl5 programmers
03:46 gfldex wtwt5237: so far all folk who spend time with Perl 6 and spoke up here where all very happy with Perl 6 and didn't want to look back.
03:48 gfldex wtwt5237: my personal view is, that given good performance will be had, Perl 6 will replace all dynamic languages. (this is a hopeful exaggeration)
03:48 seatek i'm one of those recent "crossovers" and it's been hard adjusting to something things, but every little struggle has been well worth it in unexpected payoffs so far
03:48 MasterDuke timotimo: did you happen to see my question in -dev? do you know anything about Perl6::World?
03:49 wtwt5237 good to meet all perl6 supporters here!
03:49 timotimo let me see
03:49 timotimo what is "the settings"?
03:49 timotimo well, i shall answer in -dev
03:49 MasterDuke m-CORE.setting
03:51 gfldex wtwt5237: making it easy to use of those cores will become more important and Perl 6 is shining in that area. There are a few bugs left tho. Given the current rate they should be gone in halve a year or so.
03:52 timotimo hopefully a bit earlier :)
03:57 noganex_ joined #perl6
04:00 kurahaupo_ joined #perl6
04:01 synopsebot6 joined #perl6
04:01 synopsebot6 joined #perl6
04:01 synopsebot6 joined #perl6
04:16 seatek I've noticed that most of the documentation is reference-y. Some that go into more depth with examples. But I don't notice much in the way of tutorial-ish stuff. Is that not meant to be there, or has it just not been done much? I ask because I'm finding myself going overboard a bit on this grammars introduction, which honestly is seeming more like a tutorial now.
04:18 timotimo doc.perl6.org is indeed a reference. there's other documents for other purposes
04:18 timotimo https://perl6.org/resources/ - links to a bunch of them
04:18 seatek gotcha
04:19 timotimo though the language/ pages of the doc are supposed to be a bit less referency and a bit more tutorialy
04:20 seatek yeah that's the "advanced" intro to grammars in there.
04:21 timotimo are you refering to the regexes page or actually the grammars page?
04:21 seatek the grammars
04:22 seatek it doesn't even say what they are, and drops people straight into protoregexes
04:22 timotimo yeah, that document is pretty short
04:23 timotimo "Grammar is the superclass that classes automatically get when they are declared with the grammar keyword instead of class."
04:23 seatek yeah so far i've got a bout 1500 words worth of intro to grammars and i'm probably half way through
04:23 seatek yes that's very helpful
04:23 timotimo the sentence should probably be made less dense
04:23 timotimo but it contains everything that needs to be known: if you use "grammar", you're defining a class. it gets the default superclass Grammar.
04:23 seatek no because it's still not telling you want grammars are. anything could be a superclass
04:24 timotimo a grammar is really just a class. it's almost that simple.
04:24 seatek you guys can't see it because you're too used to it
04:24 timotimo probably
04:24 seatek yeah it was a 2 day struggle for me to get the lightbulb to go off fully including actions
04:25 seatek and the docs are circular. make makes as ast. ast is a tree. made returns what you make
04:25 timotimo mh, yes
04:25 timotimo a little picture should be put in to clarify
04:25 seatek it's all dependent upon having specialized knowledge or insight
04:26 timotimo (plus a good description for people who don't have vision)
04:26 mohae_ joined #perl6
04:26 seatek yeah that's what i've been working on -- one little step at a time so it just makes sense the whole way
04:26 seatek and then they can go to the advanced gammar page :)
04:26 seatek grammar
04:27 timotimo it doesn't seem like the grammars page mentions that regexes, rules, tokens are extremely method-like
04:27 seatek yes, but i do ;)
04:27 timotimo that's good
04:27 timotimo in case that wasn't obvious, i appreciate that you're improving this part of the docs
04:27 seatek and i'm explaining about TOP and bubbling up
04:27 timotimo i haven't looked at this part much in the past, but i now see it's clearly deficient
04:28 timotimo do you already mention that the name "TOP" is only a convention?
04:28 seatek yes i said "by default"
04:28 timotimo good
04:29 timotimo i wonder if there should be a section for "under the hood" people: how to build a grammar without mentioning "grammar", "regex", "rule", or "token" in your code
04:29 seatek and i keep using method interchangeably with regex token and rule, keeping them all together in people's heads
04:29 seatek i think in the advanced stuff maybe
04:30 seatek but grammars are weird at first. i'd let them get used to the conventional way first. that's the path i'm taking at least
04:30 timotimo sounds good
04:30 seatek but i want to write this while the wounds and suffering are still fresh in my mind
04:30 timotimo when you realize a grammar is "just" a class, it helps to get a little nudge in the "derive a grammar from another" and "mix in a role into a grammar"
04:30 timotimo good idea
04:31 seatek yes they're quite weird conceptually still to me.. and with their automated/hidden piping going on too ;)
04:32 timotimo piping?
04:33 seatek metaphoric piping. yes, like in actions especially -- how the token names can popage from the class into the TOP you make there, or optionally the method names in your actions
04:33 seatek propagate
04:33 timotimo ah
04:33 seatek you guys don't think about that  stuff
04:34 seatek but it's a confusing mess to anyone new to it
04:34 timotimo hm
04:34 labster joined #perl6
04:34 seatek it's beautiful -- and it's so helpful
04:35 timotimo <foo> is "just" an invocation to regex foo, which also (because it captures) puts the result of regex foo into $/<foo>, and when some rule or regex finishes matching with success, it'll look if there's a foo method in the current action object
04:35 timotimo that's what you mean?
04:36 seatek after that even -- when you're making the TOP for the action to return with your .made in the match
04:36 labster m: say Inf.new == 0;
04:36 camelia rakudo-moar a1347c: OUTPUT«True␤»
04:36 timotimo i couldn't parse that sentence, seatek
04:36 timotimo m: say "Hello!".new eq ""
04:36 camelia rakudo-moar a1347c: OUTPUT«True␤»
04:36 seatek TOP is built in the action as well, with make
04:37 labster yeah, I know, Inf is a Num.
04:37 timotimo um, i don't understand
04:37 seatek $m = GRAM.parse('stingy thing'); $m.made returns what your TOP in the action had
04:38 timotimo ah, i see what you mean
04:38 seatek even that is not made clear
04:38 timotimo because you never explicitly invoked TOP anywhere
04:38 timotimo but it still gets called, and its action method also gets called
04:38 labster m: say "Hello world".new.chars == Inf.new; # and we can combine them!
04:38 camelia rakudo-moar a1347c: OUTPUT«True␤»
04:39 seatek and how to you put your "make" 'stuff in there? what does it even mean to "make" something? ;)
04:39 seatek look that up in the docs ;)
04:39 seatek Sets the AST to $ast, and returns it.
04:40 seatek so i'm trying to fill in all the gaping holes that exist for someone coming in fresh and new to these grammar beasties
04:40 timotimo right
04:40 timotimo well, the return value of Grammar.parse is just the $/ that's in your TOP
04:42 seatek yeah... to my mind, if you're bothering to use actions, and you're making stuff in your actions, you might as well make your own tidy TOP
04:42 seatek so that when you call $m.made it's exactly the structure you expect
04:43 timotimo right
04:44 bitmap joined #perl6
04:45 seatek i swear this gave me flashbacks to the feeling i had when i first realized what recursion was
04:46 timotimo :D
04:56 pierre_ joined #perl6
05:11 pierre_ joined #perl6
05:11 wamba joined #perl6
05:16 CIAvash joined #perl6
05:16 dalek doc: 4f7b5a5 | timotimo++ | doc/Type/IO/Handle.pod6:
05:16 dalek doc: long explanation about getc and keyboard input
05:16 dalek doc:
05:16 dalek doc: warn of buffering terminals and potential combining characters
05:16 dalek doc: review: https://github.com/perl6/doc/commit/4f7b5a53e0
05:16 timotimo ^- how do you feel about this?
05:19 pierre_ joined #perl6
05:30 Sgeo joined #perl6
05:34 sftp joined #perl6
05:36 seatek timotimo: i really like it, at least. those are the kinds of details that can make all the difference
05:37 seatek it could save someone hours of frustration
05:38 timotimo mhm
05:38 Cabanossi joined #perl6
05:43 sftp joined #perl6
05:54 pierre_ joined #perl6
06:00 pierre_ joined #perl6
06:03 samcv timotimo, sounds good. maybe make `a` in quotes like "a" it reads weird. maybe could change a to be a letter that isn't an actual work?
06:03 samcv like z or x?
06:04 timotimo ah
06:04 samcv a probably the worst letter to you :P 'i' coming in second
06:04 samcv *use
06:05 samcv but i think it's great having info like that. those are the kinds of things that make me happy to read
06:05 timotimo so what quotes should i be using?
06:05 cognominal joined #perl6
06:05 samcv well you use "a" later on, and i think that's fine
06:06 samcv just change it to another letter preferably not a vowel
06:06 dalek doc: d2da116 | timotimo++ | doc/Type/IO/Handle.pod6:
06:06 dalek doc: use e instead of a for less confusion
06:06 dalek doc: review: https://github.com/perl6/doc/commit/d2da1168f0
06:06 timotimo there we go
06:06 timotimo i think i used =item wrong here
06:07 samcv e is fine as well
06:07 dalek doc: ae7ab1a | timotimo++ | doc/Type/IO/Handle.pod6:
06:07 dalek doc: indent prose text for items
06:07 dalek doc: review: https://github.com/perl6/doc/commit/ae7ab1a68f
06:07 samcv also
06:07 samcv <3 for everyone working on the perl 6 docs
06:08 timotimo that's mostly not me :)
06:08 samcv you count though!
06:09 samcv also curious. how useful are the perl 6 design docs for things that docs.perl6.org don't cover?
06:09 samcv at least for object orientation is concerned
06:09 timotimo they haven't been updated to cover the latest changes for half a year or a whole year now
06:09 samcv docs or design docs?
06:09 timotimo design docs
06:10 timotimo they have been changed from being called "the specification" to "the design docs"
06:10 samcv hah
06:10 seatek timotimo: are protoregexes basically roles with arguments?
06:11 timotimo no, they are basically proto methods
06:11 timotimo all regexes may take arguments
06:11 timotimo proto is about multiness
06:12 seatek ok .. oh yes. that makes much more sense
06:15 seatek ok i'm filing that away for later study. it's enough to be able to start the car and drive at this point, rather than disassembing the transmission
06:15 timotimo :)
06:18 silug joined #perl6
06:18 dataf3l joined #perl6
06:18 dataf3l hey guys
06:18 dataf3l I have a small CGI problem
06:18 timotimo greetings dataf3l
06:18 labster joined #perl6
06:18 timotimo CGI is already a problem in itself, but let's hear what's wrong in your specific case
06:19 dataf3l Yeah I know CGI sucks but I want to use it temporarily until HTTP::Simple starts supporting concurrent requests
06:19 timotimo mhm
06:20 dataf3l this is my script:
06:20 dataf3l #!/usr/local/bin/perl6
06:20 dataf3l print("Content-Type: text/html\r\n\r\n");
06:20 dataf3l print("nice\n");
06:20 dataf3l I did chmod 755
06:20 dataf3l when I run it I get a 500
06:20 timotimo what does your error.log say?
06:20 dataf3l Error message:
06:20 dataf3l End of script output before headers: mine3.cgi
06:21 dataf3l [Wed Nov 02 00:24:43.809494 2016] [cgi:error] [pid 70545] [client ::1:55190] AH01215: (8)Exec format error: exec of '/Applications/XAMPP/xamp
06:21 dataf3l pfiles/htdocs/mine3.cgi' failed: /Applications/XAMPP/xamppfiles/htdocs/mine3.cgi
06:21 timotimo what does it look like when you /usr/local/bin/perl6 yourscript.p6?
06:21 dataf3l [Wed Nov 02 00:24:43.809788 2016] [cgi:error] [pid 70545] [client ::1:55190] End of script output before headers: mine3.cgi
06:21 timotimo looks like the path may be wrong
06:21 dataf3l Felipes-MacBook-Pro:htdocs a$ /usr/local/bin/perl6 mine3.cgi
06:21 dataf3l Content-Type: text/html
06:21 dataf3l nice
06:21 dataf3l Felipes-MacBook-Pro:htdocs a$
06:21 timotimo and just ./mine3.cgi gives the same thing probably?
06:22 timotimo did you make sure cgi is allowed outside your cgi-bin folder?
06:24 dataf3l I have a bash file with a simple cgi script on the same folder with the same permissions
06:24 dataf3l it works
06:24 dataf3l Felipes-MacBook-Pro:htdocs a$ cat mine.cgi
06:24 dataf3l #!/bin/bash
06:24 dataf3l echo "Content-Type: text/html"
06:24 dataf3l echo ""
06:24 dataf3l echo ""
06:24 dataf3l echo "HelloWorld"
06:25 timotimo ah, i think i know what's happening
06:25 timotimo your \r\n may be getting translated to something else
06:26 timotimo try running your script through xxd to see what exactly it outputs
06:27 dataf3l good idea!
06:27 timotimo on mac, newlines are actually \r, aren't they?
06:28 dataf3l you were right!
06:29 dataf3l I’m on a mac
06:29 dataf3l Felipes-MacBook-Pro:htdocs a$ perl6 mine3.cgi|xxd
06:29 dataf3l 0000000: 436f 6e74 656e 742d 5479 7065 3a20 7465  Content-Type: te
06:29 dataf3l 0000010: 7874 2f68 746d 6c0d 0a0d 0a0a 6e69 6365  xt/html.....nice
06:29 dataf3l 0000020: 0a0a                                     ..
06:29 dataf3l I can see it shoud be 0a0d 0a0d but it reads 0a0a instead.
06:29 timotimo it seems like it's actually 0d0a0d0a0a
06:29 dataf3l why did \r\n\r\n get interpreted as such?
06:29 dataf3l utf8?
06:30 timotimo it tries to get your platform's newlines right when you write \n
06:30 timotimo we translate on the way out of the program
06:30 seatek both a thank you and a grrr ;)
06:31 timotimo it looks like it can be configured on a per-stream basis
06:31 dataf3l wait
06:31 dataf3l so the solution is?
06:32 dataf3l how do I tell perl6 to just output the bytes I wrote in the source code verbatim instead of trying to do weird stuff?
06:32 dataf3l also, you guys have been helpful
06:33 timotimo you're not telling it bytes to output
06:33 timotimo you're giving it a unicode string
06:33 timotimo you can output bytes with .write and a Buf
06:33 timotimo well, write in this case
06:33 timotimo since you want it to be a sub instead of a method
06:34 timotimo m: say $*OUT.perl
06:34 camelia rakudo-moar a1347c: OUTPUT«IO::Handle.new(:path(IO::Special.new(what => "<STDOUT>")),:chomp)␤»
06:35 timotimo you can change the .out-nl in any case
06:35 timotimo m: say $*OUT.out-nl
06:35 camelia rakudo-moar a1347c: OUTPUT«No such method 'out-nl' for invocant of type 'IO::Handle'␤  in block <unit> at <tmp> line 1␤␤»
06:35 timotimo m: say $*OUT.nl
06:35 camelia rakudo-moar a1347c: OUTPUT«No such method 'nl' for invocant of type 'IO::Handle'␤  in block <unit> at <tmp> line 1␤␤»
06:35 timotimo ho-hum?
06:35 timotimo m: $*OUT.print-nl
06:35 camelia rakudo-moar a1347c: OUTPUT«␤»
06:36 timotimo m: $*OUT.nl-out
06:36 camelia rakudo-moar a1347c: ( no output )
06:36 timotimo m: $*OUT.nl-out.perl.say
06:36 camelia rakudo-moar a1347c: OUTPUT«"\n"␤»
06:36 timotimo that's how.
06:36 dataf3l m: say $*OUT.^methods
06:36 camelia rakudo-moar a1347c: OUTPUT«(open nl-in close eof get getc comb words lines read readchars Supply seek tell write opened t lock unlock print put print-nl slurp-rest chmod IO path flush encoding DESTROY e d f s l r w x modified accessed changed mode watch native-descriptor umask split…»
06:36 dataf3l > say $*OUT.nl-out.perl
06:36 dataf3l "\n"
06:36 timotimo that's the thing you get when you use things that'll put a newline at the end
06:36 timotimo like "say"
06:36 dataf3l ah
06:37 dataf3l does print add an nl?
06:37 timotimo still not sure how to influence the automatic translation
06:37 timotimo it does not
06:39 dataf3l this works on the command line but the CGI doesn’t like it stll
06:39 dataf3l $*OUT.write("Content-Type: text/html\r\n\r\ntest".encode);
06:40 dataf3l xxd looks good
06:40 dataf3l testFelipes-MacBook-Pro:htdocs a$ perl6 ./mine3.cgi|xxd
06:40 dataf3l 0000000: 436f 6e74 656e 742d 5479 7065 3a20 7465  Content-Type: te
06:40 dataf3l 0000010: 7874 2f68 746d 6c0d 0a0d 0a74 6573 74    xt/html....test
06:40 dataf3l but still no workie on apache
06:40 timotimo that's strange. same error as before?
06:41 dataf3l pretty much
06:41 dataf3l End of script output before headers: mine3.cgi
06:42 timotimo can you try outputting the same thing you're writing to $*ERR, too?
06:42 timotimo i think that ought to output it into the errors.log
06:42 timotimo oh, i mean: output .encode.perl
06:42 timotimo m: "Content-Type: text/html\r\n\r\ntest".encode.perl.say
06:42 camelia rakudo-moar a1347c: OUTPUT«utf8.new(67,111,110,116,101,110,116,45,84,121,112,101,58,32,116,101,120,116,47,104,116,109,108,13,10,13,10,116,101,115,116)␤»
06:43 dataf3l ok
06:43 dataf3l utf8.new(67,111,110,116,101,110,116,45,84,121,112,101,58,32,116,101,120,116,47,104,116,109,108,13,10,13,10,116,101,115,116)
06:44 timotimo 13 10 13 10, that looks correct
06:44 timotimo hm. is it having trouble with not having a newline at the very end? shouldn't, though.
06:45 dataf3l End of script output before headers: mine4.cgi
06:45 dataf3l how could I see what apache is seeing
06:45 timotimo good question
06:46 dataf3l maybe apache sees an error isntead of the output
06:46 dataf3l and the error has no new lines or anything, jsut error lines
06:46 dataf3l maybe this daemon user doesn’t have a good-looking perl6 install
06:47 seatek i have had trouble with some programs being able to kick off perl6 programs
06:47 timotimo perhaps, but you were able to get the error output from $*ERR.write
06:47 wamba joined #perl6
06:51 RabidGravy joined #perl6
06:51 dataf3l what do you mean by het the error output
06:51 synopsebot6 joined #perl6
06:51 dataf3l how can I get said output
06:51 timotimo well, you put something in $*ERR and it landed in errors.log
06:51 timotimo so the script was clearly being run
06:52 dataf3l AH I see what you mean
06:52 seatek yeah
06:52 dataf3l let me try
06:53 dataf3l ok now I have a new error :)
06:53 dataf3l [Wed Nov 02 01:52:51.676830 2016] [cgi:error] [pid 91925] [client ::1:58640] AH01215: (13)Permission denied: exec of '/Applications/XAMPP    /xamppfiles/htdocs/mine4.cgi' failed: /Applications/XAMPP/xamppfiles/htdocs/mine4.cgi
06:53 dataf3l but this is my fault
06:53 timotimo fantastic
06:54 timotimo so ... forgot to +x? :)
06:54 darutoko joined #perl6
06:55 timotimo i just gave synopsebot6 a little piece of code that'll hopefully build doc.perl6.org links from doc commits
06:55 timotimo but i'm not sure if it'll work :P
06:56 seatek is there some kind of special tagging you have to use to link elsewhere?
06:57 timotimo hm?
06:57 seatek i'm to 2000 words on this so far and haven't even got to actions yet
06:57 timotimo something with L<...>, but i'm not sure about the specifics
06:57 seatek oh is it podish?
06:57 timotimo yeah, pod6
06:57 seatek k
06:58 dataf3l ERR write does not write to err or apache logs
06:58 dataf3l which means script never ran
07:00 timotimo oh?
07:02 dataf3l [Wed Nov 02 02:01:03.032448 2016] [cgi:error] [pid 94121] [client ::1:58777] AH01215: (13)Permission denied: exec of '/Applications/XAMPP/xam
07:02 dataf3l ppfiles/htdocs/mine4.cgi' failed: /Applications/XAMPP/xamppfiles/htdocs/mine4.cgi
07:02 dataf3l [Wed Nov 02 02:01:03.032646 2016] [cgi:error] [pid 94121] [client ::1:58777] End of script output before headers: mine4.cgi
07:02 timotimo well, "permission denied" is kind of obvious?
07:02 timotimo about what's going wrong?
07:03 dataf3l ok bad permissions was I needed to do chmod 755 to the file
07:03 dataf3l the file now indicates: [Wed Nov 02 02:02:53.756409 2016] [cgi:error] [pid 94119] [client ::1:58812] AH01215: (8)Exec format error: exec of '/Applications/XAMPP/xamp
07:03 dataf3l pfiles/htdocs/mine4.cgi' failed: /Applications/XAMPP/xamppfiles/htdocs/mine4.cgi
07:03 dataf3l which is the error I’ve always had
07:03 dataf3l no wait
07:03 dataf3l that’s a different one!!!
07:03 dataf3l YES! :)
07:07 brillenfux joined #perl6
07:09 dataf3l this is just too frustrating
07:12 dataf3l problem appears to be with my apache installation, since test-cgi doesn’t work
07:12 dataf3l even though the other, simple cgi script I wrote in bash DID work...
07:13 neuraload joined #perl6
07:13 seatek do you have any space at the top of the file?
07:13 seatek before the #!/usr/bin/perl6 stuff?
07:14 dataf3l 1st line: #!/usr/local/bin/perl6
07:14 dataf3l verbatim
07:14 dataf3l I wish I had that space mr.
07:14 dataf3l incidentaly, the perl5 cgi example worked without issue
07:15 dataf3l I can’t believe I’ll say this: perl5 is somehow looking attractive?!?
07:15 seatek do you have sudo access?
07:15 dataf3l is that possible?
07:15 dataf3l yeah it’s my mac
07:15 dataf3l but the script run as “daemon"
07:15 seatek try running that script as the user apache runs under
07:15 dataf3l some user created by the XAMPP installation
07:15 dataf3l ok I’ll try
07:17 seatek i'll bet the apache user doesn't have a proper environment to run perl6... but then again, i don't know how you installed perl6... i do know that /usr/local/bin for anything to run from a web server would make me nervous
07:17 synopsebot6 joined #perl6
07:18 domidumont joined #perl6
07:18 seatek synopsebot6 is agitated this evening
07:18 timotimo i fixed that doc link detection stuff and when the next doc commit lands it should give some output
07:18 timotimo i restarted it a bunch
07:18 timotimo manually, that is
07:19 seatek ah! so you're responsible for its agitation!
07:19 dataf3l brew install perl6
07:19 dataf3l you are probably  correct, seatek
07:20 seatek brew sets up specific environment variables for you to be able to run perl6
07:20 seatek you will need to give those to the user apache runs under
07:20 seatek and make sure they have permission to execute that file hierarchy in which it's installed
07:21 seatek or just install again after sudo'ing to the apache user :)
07:21 timotimo that's the great thing about running web apps via mod_proxy
07:22 timotimo you can much more easily step in the middle and inspect what's up
07:22 seatek i've gotten spoilt by the psgi stuff, and mst's stuff
07:23 domidumont joined #perl6
07:23 seatek psgi is here if i'm remembering right, in perl6... cracker it's called, or something.
07:23 seatek crispy crust
07:23 seatek crust
07:24 seatek i think that's it
07:24 timotimo crust is definitely a thing
07:24 seatek yeah that's on my near horizon
07:25 seatek wait. didin't you do a json thing?
07:26 firstdayonthejob joined #perl6
07:26 timotimo i'm responsible for JSON::Fast
07:26 seatek i love that module. i hate json. that module lets me love and hate json
07:26 timotimo only the parsing portion, though
07:26 seatek ah ok. i can't remember if i went with that one or the other one.. tiny or something
07:27 timotimo yeah
07:27 timotimo they are functionally equivalent except in corner cases
07:27 dataf3l this feels like too much work, I’m trying to use perl6 so much, but for some reason, it doens’t like any of my ideas
07:27 seatek i probably went with fast instead of tiny. i'm a sucker like that
07:28 seatek dataf3l: yeah it can be awkward getting it to install globally on a system.
07:28 dataf3l I wanted a simple cgi thingie, nope. tried the http::simple, nope (single thread), tried http tiny: too complicated, tried importing modules, couldn’t figure out how to import modules.
07:29 dataf3l I wanted to avoid golang, since it’s syntax makes it too verbose, but at this point, golang looks more atractive than perl6, I’m sad to say
07:29 seatek i've run into that too. i can't wait until distributions start picking it up with the latest.
07:29 kurahaupo__ joined #perl6
07:29 timotimo how do you feel about HTTP::Server::Threaded?
07:30 kurahaupo__ joined #perl6
07:31 * timotimo BBL
07:31 dataf3l downloading...
07:31 seatek i always, even with perl5, do a brew install for the user that the http process will be running under
07:32 stmuk_ I like both go and perl 6. There is a place for both
07:32 dataf3l that makes sense
07:32 stmuk_ they do have virtually opposite philosophies
07:32 dataf3l tried the example:
07:32 dataf3l https://github.com/tony-o/perl6-http-server-threaded
07:32 dataf3l the example failed
07:33 dataf3l Cannot directly create a Supply. You might want:
07:33 dataf3l - To use a Supplier in order to get a live supply
07:33 dataf3l - To use Supply.on-demand to create an on-demand supply
07:33 dataf3l - To create a Supply using a supply block
07:33 dataf3l in method  at /usr/local/Cellar/rakudo-star/2016.07/share/perl6/site/sources/3CA3A94E8EC6BDFE95FC1E93CCDF60DD679B9836 (HTTP::Server::Threaded) line 9
07:33 dataf3l in block <unit> at threaded.p6 line 3
07:33 dataf3l since the example failed, then I guess I feel “unsure” about HTTP::Server::Threaded, given it was the “simple example” from the readme, timotimo
07:34 seatek is that the latest version? there was a commit 5 days ago
07:34 dataf3l what does panda install?
07:35 tbrowder joined #perl6
07:35 seatek the latest at the time
07:35 seatek you can just a panda install <modulename> again to get the latest
07:37 dataf3l I fear any mistake I do in the code will bring down the server
07:37 dataf3l if the server is all perl6
07:37 dataf3l which is why I was thinking of cgi, old school, but no server down, just user 500
07:38 seatek Ah. yeah. I haven't gotten into the server stuff yet here in p6... slowly working my way there.
07:39 seatek i glanced a couple times though -- there were even a couple frameworks
07:39 auerland joined #perl6
07:39 auerland left #perl6
07:40 dataf3l ok
07:40 dataf3l I stumbled into this
07:40 dataf3l https://github.com/tony-o/perl6-http-server-async
07:40 dataf3l downloads OK from panda
07:40 dataf3l builds ok and passes all unit tests
07:40 dataf3l hello world works, although I had to read the source in order to determine the default port
07:40 dataf3l which was 1666
07:41 seatek we're all gonna die
07:41 dataf3l for now, this might be what I’m looking for, let’s hope it’s multi-threaded.
07:41 dataf3l valar morgulis
07:41 [ptc] valar doaheris
07:42 dataf3l guys, you all have been super helpful, I f-ing love this community
07:42 seatek :)
07:42 seatek async is nothing to sneeze at, even if it is single-threaded ;)
07:51 domidumont joined #perl6
08:04 Shin_ joined #perl6
08:12 rindolf joined #perl6
08:12 pierre_ joined #perl6
08:31 pierre_ joined #perl6
08:33 zakharyas joined #perl6
08:36 neuraload joined #perl6
08:40 pierre_ joined #perl6
08:40 cognominal joined #perl6
08:43 andrzejku joined #perl6
08:46 itaipu joined #perl6
08:49 e1 joined #perl6
08:55 cognominal joined #perl6
08:56 masak guten morning, #perl6
08:56 arnsholt o/
09:02 jonas1 joined #perl6
09:03 eiro o/
09:24 ocbtec joined #perl6
09:24 ocbtec joined #perl6
09:32 ufobat joined #perl6
09:33 ufobat_ joined #perl6
09:44 tbrowder \o
09:45 tbrowder ref file handles: i'm trying to do some sig type constraints on an open file handle
09:47 tbrowder according to the docs, i should be able to test for single letter methods (of which only t seems to be explicitly mentioned in the class)
09:48 tbrowder e.g., my $f = open 'f'; say $f.r; => True, fine
09:50 skids joined #perl6
09:52 eliasr joined #perl6
09:53 wamba joined #perl6
09:54 bjz joined #perl6
09:54 tbrowder and these all say False: t, d;  That checks
09:55 tbrowder but this should say False but shows True: w
09:57 tbrowder note also that if the file is open as writable, then it still shows r as true
09:58 tbrowder now i'm looking at the smart match to see if anything changes...
09:58 Actualeyes joined #perl6
10:07 kurahaupo_ joined #perl6
10:08 tbrowder same results
10:09 tbrowder (note there are doc issues for most of the single-letter methods)
10:11 araujo joined #perl6
10:12 araujo joined #perl6
10:12 araujo joined #perl6
10:18 cdg joined #perl6
10:22 grondilu joined #perl6
10:24 bjz joined #perl6
10:33 imcsk8 joined #perl6
10:36 cognominal joined #perl6
10:41 kurahaupo__ joined #perl6
10:50 bjz_ joined #perl6
10:57 cognominal joined #perl6
11:00 imcsk8 joined #perl6
11:08 imcsk8 joined #perl6
11:12 itaipu joined #perl6
11:26 bjz joined #perl6
11:32 domidumont joined #perl6
11:35 avar mst: Status of your not-so-shitty packaging for p6 moar/nqp/rakudo/modules?
11:35 tbrowder .tell viki Your solution was almost perfect (except you used my inefficient code that created the sting), i tweaked a bit and have working code that does what i want. see it at gist https://gist.github.com/tbrowder/60914f63ce2b98cd58f40006078ffb41
11:35 yoleaux tbrowder: I'll pass your message to viki.
11:36 avar Building rakudo* 2016.10 with my shitty hacky build..
11:40 pierre_ joined #perl6
11:43 cognominal joined #perl6
11:45 pmurias joined #perl6
11:54 wamba joined #perl6
12:12 MasterDuke joined #perl6
12:17 wamba joined #perl6
12:21 stmuk joined #perl6
12:25 ab6tract joined #perl6
12:26 ab6tract avar: i believe they are somewhere on shadow.cat, but it's been a  while since his presentation
12:27 DrForr And he's probably en route here.
12:28 ab6tract DrForr: so mst is kind of like bloody mary? "mst... mst... mst..."
12:29 [Coke] moritz++ I had sending out the request on my todo list for a month! :(
12:29 DrForr I... suppose so.
12:30 [Coke] (for advent)
12:33 moritz so far no new signups in response :(
12:38 cdg joined #perl6
12:39 DrForr In response to what? (I've been offline for a few days, but not long enough to feel the effects...)
12:40 user100500 joined #perl6
12:40 user100500 hello all! (testing)
12:41 DrForr Your client seems to work :)
12:41 [Coke] timotimo: why did you indent the text in IO::Handle?
12:42 [Coke] (it turns it into a block quote)
12:42 dalek doc: 5ad05a7 | coke++ | xt/words.pws:
12:42 dalek doc: learn new words
12:42 dalek doc: review: https://github.com/perl6/doc/commit/5ad05a7054
12:43 timotimo i was hoping it'd indent it to become part of the =item
12:44 [Coke] https://docs.perl6.org/routine/getc
12:44 [Coke] it renders it as code.
12:48 timotimo i see it. i don't know how to fix it properly
12:48 timotimo =begin item title text blah maybe?
12:50 [Coke] just follow the style from elsewhere?
12:51 [Coke] not sure we have that style elsewhere. Maybe make them the next smaller head.
12:55 timotimo i could do that, actually
13:06 pullphinger joined #perl6
13:09 user100500 Question (bad English): how to draw a conclusion binary data as in python? Example: perl6 -e "my $bdata = Buf.new('qwerty'.encode('utf-8')); say $bdata;" # Buf:0x<71 77 65 72 74 79>   python -c "bdata = b'qwerty'; print(bdata)" # b'qwerty'
13:09 timotimo you can just .decode('latin1') it, for example
13:30 cognominal joined #perl6
13:32 user100500 Thanks. Next example (binary key in hash): python -c "bdata = {'Вася Уткин'.encode(): b'test'}; print(bdata)" # {b'\xd0\xb2\xd0\xb0\xd1\x81\xd1\x8f \xd1\x83\xd1\x82\xd0\xba\xd0\xb8\xd0\xbd': b'test'}                  perl6 -e "my $v = Buf.new('test'.encode('utf-8')); my %bdata = $v => $v; say %bdata;" # error :(
13:33 timotimo the problem is that Buf is read-write, whereas bytestrings in python are read-only
13:33 timotimo maybe use .Blob on the result of .encode to make it read-only
13:37 ilmari m: 'test'.encode().Blob.say
13:37 camelia rakudo-moar 8c3e57: OUTPUT«No such method 'Blob' for invocant of type 'utf8'␤  in block <unit> at <tmp> line 1␤␤»
13:37 ilmari m: Blob.new('test'.encode()).say
13:37 camelia rakudo-moar 8c3e57: OUTPUT«Blob:0x<74 65 73 74>␤»
13:38 ilmari m: my $v = Blob.new('test'.encode()); my %bdata = $v => $v; dd %bdata;
13:38 camelia rakudo-moar 8c3e57: OUTPUT«Cannot use a Buf as a string, but you called the Str method on it␤  in block <unit> at <tmp> line 1␤␤»
13:38 ilmari m: my $v = Blob.new('test'.encode()); my %bdata = $v => $v; say %bdata
13:38 camelia rakudo-moar 8c3e57: OUTPUT«Cannot use a Buf as a string, but you called the Str method on it␤  in block <unit> at <tmp> line 1␤␤»
13:39 cdg_ joined #perl6
13:39 cognominal joined #perl6
13:44 aborazmeh joined #perl6
13:44 aborazmeh joined #perl6
13:54 timotimo user100500: were you able to do it?
13:55 timotimo m: my $v = Blob.new('test'.encode('utf8')); my %bdata = $v => $v; say %bdata.perl
13:55 camelia rakudo-moar 8c3e57: OUTPUT«Cannot use a Buf as a string, but you called the Str method on it␤  in block <unit> at <tmp> line 1␤␤»
13:55 timotimo ah, that's the error. of course!
13:55 timotimo m: my $v = Blob.new('test'.encode('utf8')); my %bdata{Any} = $v => $v; say %bdata.perl
13:55 camelia rakudo-moar 8c3e57: OUTPUT«(my Any %{Any} = (Blob.new(116,101,115,116)) => Blob.new(116,101,115,116))␤»
13:55 timotimo user100500: ^ this is the solution. you need an object hash. the regular hash will stringify all of the keys
13:59 user100500 I was trying to make a library to parse torrent files and I can't. To parse the string easily, but a binary string is a lot harder.
13:59 timotimo it's true
14:03 nicq20 joined #perl6
14:04 nicq20 Hello o/
14:04 timotimo greetings nicq20
14:05 viki tbrowder: FWIW, this whole thing can be written as just $f.say: $str x 2 + $triple; This way you don't duplicate $str all over the place in code and don't need to create a separate variable just to store a temporary result: https://gist.github.com/tbrowder/60914f63ce2b98cd58f40006078ffb41#file-multi-output-sigs-txt-L7-L9
14:05 yoleaux 11:35Z <tbrowder> viki: Your solution was almost perfect (except you used my inefficient code that created the sting), i tweaked a bit and have working code that does what i want. see it at gist https://gist.github.com/tbrowder/60914f63ce2b98cd58f40006078ffb41
14:06 khw joined #perl6
14:07 cognominal joined #perl6
14:14 user100500 timotimo: Thank you :)
14:20 viki BenGoldberg, RE comparisons with NaNs: we didn't come up with that willy-nilly. We follow the IEEE 2008-754. Table 5.3 confirms the results you got.
14:24 pyrimidine joined #perl6
14:25 pierre_ joined #perl6
14:38 cognominal joined #perl6
14:41 canopus joined #perl6
14:42 tbrowder viki: for the simple case that's true, but i believe my cookbook template method is required when more complicated text mods are being made. thus avoiding string dup becomes more important.
14:44 viki or do we...
14:44 * viki reads more
14:47 Rawriful joined #perl6
14:50 tbrowder you'll see what i mean when i release my next module (or see the multi sub write-paragraph at https://github.com/tbrowder/Misc-Utils-Perl6
14:50 viki I hope to FSM you won't name that module Misc::Utils :)
14:51 tbrowder what do you suggest?
14:52 viki Yeah, we're good with NaN's. The Nil basically signals the comparison is unordered.
14:52 viki m: say (4 <=> NaN) ~~ Same|Less|More
14:52 camelia rakudo-moar 8c3e57: OUTPUT«False␤»
14:52 viki And 5.11 says "Every NaN shall compare unordered with everything, including itself."
14:53 viki tbrowder: ANYTHING else. Misc::Utils is like inventing a product and calling it "Generic Widget"
14:53 tbrowder well, it is a generic widget
14:53 viki No, it isn't.
14:54 tbrowder well put out a suggested name then
14:54 viki I don't know what it does.
14:54 viki Misc::Utils conveys exactly zero information about what the module is about.
14:56 viki FWIW token decimal is forgetting to match the sign
14:57 viki m: my $hexchar = "F"; say :16($hexchar)
14:57 camelia rakudo-moar 8c3e57: OUTPUT«15␤»
14:59 viki m: my $time-in-seconds = 3671; say $time-in-seconds.polymod: <60 60 24>
14:59 camelia rakudo-moar 8c3e57: OUTPUT«(11 1 1 0)␤»
15:01 cibs joined #perl6
15:02 viki m: my $un-normalazed-string = "    fo   bar ber    "; dd $un-normalazed-string.words.join: " "
15:02 camelia rakudo-moar 8c3e57: OUTPUT«"fo bar ber"␤»
15:02 cognominal joined #perl6
15:03 viki tbrowder: well, now that I've read the source, I can give a better analogy: it's like writing four novels of different genre, gluing them together, then putting the result in "General" section in the library.
15:06 viki tbrowder: you go from timing a run of a command, to stripping comments (of which language?), to performing date operations, to doing string operations, to doing some sort of numeric base conversion operations. A module's name is a mnemonic for its function. I'm unsure what you're hoping to create with this module: a go-to library? If I want any hex operation or date operation, I just pull out Misc::Utils or
15:06 viki something?
15:06 viki Your strip-comment sub is entirely broken, BTW. { say "Hello # World!"; } <-- the '#' is not a comment in this code, but it'll assume it is.
15:08 viki I don't mean to sound like I'm intentionally poo-pooing your idea, but I can guarantee the current tragectory will leave you with you being the sole user of your module.
15:08 * viki & lunch
15:09 tbrowder well it is called "Misc"Utils" after all.  And I can later try to organize into categories if that would help.  And I don't pretend it's perfect yet (thanks for the bug report), either, that's why I haven't released it.
15:11 ilmari TBrowder's::Random::Stuff
15:11 viki Right, but if I want a module to strip comments, I won't be looking for Misc::Utils. I'll be looking for String::Strip, String::Comment, Str::Utils or something like that. Even if I notice Misc::Utils in my search results, it'd likely be a waste of my time trying to read its documentation to see whether it actually does perform this particular string operation.
15:11 viki It's trying to do too much.
15:12 viki Release 4 modules instead of 1
15:12 DrForr Does ' still work for a namespace separator?
15:13 ilmari m: package Foo'Bar { sub baz { say "yay" } }; Foo'Bar::baz()
15:13 camelia rakudo-moar 8c3e57: OUTPUT«Could not find symbol '&baz'␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
15:14 ilmari m: my $foo'bar = 42; say $foo'bar
15:14 camelia rakudo-moar 8c3e57: OUTPUT«42␤»
15:14 ilmari works in variable names, at least
15:14 viki DrForr: no
15:15 viki m: package Foo'Bar { our sub baz { say "yay" } }; Foo'Bar::baz()
15:15 camelia rakudo-moar 8c3e57: OUTPUT«yay␤»
15:15 viki Works in package names too, but it's not a replacement for ::. It's just a char
15:15 skids joined #perl6
15:16 viki s/replacement/synonym/;
15:16 DrForr I expect I'll have more questions, though I'm probably better off RTFS.
15:24 tbrowder viki: have you read the short desciptions?  I know they need improvenent
15:26 pierre_ joined #perl6
15:26 tbrowder viki: another thing to be done is to organize more export tag groups (such as the "4" you mentioned).  also more info in the META6 would help
15:33 cognominal joined #perl6
15:39 cognominal joined #perl6
15:42 viki You'll end up with a giant document describing the functionality of the module with the most non-descript name in the universe.
15:42 viki Don't let me stop you, tho.
15:44 tbrowder viki: i appreciate yr comments, and will see what i can do...
15:47 tbrowder viki: another subject. did you see my comments earlier about tests on an IO::Handle?  i get true values where i don't expect them, e.g., on a handle for a file opened read only i get true on  "say $fh ~~ :w;"
15:51 salva0 joined #perl6
15:57 dalek doc: b982e3d | gfldex++ | doc/Language/functions.pod6:
15:57 synopsebot6 Link: http://doc.perl6.org/language/functions.pod6:
15:57 dalek doc: doc nextcallee
15:57 dalek doc: review: https://github.com/perl6/doc/commit/b982e3d232
15:58 [Coke] m: my $a = say "HI"; say $a;
15:58 camelia rakudo-moar 8c3e57: OUTPUT«HI␤True␤»
15:58 [Coke] tbrowder: ^^ that?
15:59 MilkmanDan joined #perl6
15:59 viki tbrowder: no, haven't seen them. Weird.
15:59 viki s: &infix:<~~>, open("/tmp/foo", :w), \(:r)
15:59 SourceBaby viki, Something's wrong: ␤ERR: Cannot resolve caller sourcery(Sub+{Precedence}, IO::Handle, Capture); none of these signatures match:␤    ($thing, Str:D $method, Capture $c)␤    ($thing, Str:D $method)␤    (&code)␤    (&code, Capture $c)␤  in block <unit> at -e line 6␤␤
15:59 viki s: &infix:<~~>, \(open("/tmp/foo", :w), :r)
15:59 SourceBaby viki, Something's wrong: ␤ERR: Could not find candidate that can do \(IO::Handle.new(:path("/tmp/foo".IO(:SPEC(IO::Spec::Unix),:CWD("/home/zoffix/services/sourceable/perl6"))),:chomp), :r)␤  in sub sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 37␤  in block <unit> at -e line 6␤␤
15:59 viki hmm
16:00 viki s: &infix:<~~>, \(Pair.new("r", True), open("/tmp/foo", :w))
16:00 SourceBaby viki, Sauce is at https://github.com/rakudo/rakudo/blob/8c3e57d/src/core/Mu.pm#L807
16:01 viki s: open("/tmp/foo", :w), 'w', \()
16:01 SourceBaby viki, Sauce is at https://github.com/rakudo/rakudo/blob/8c3e57d/src/core/IO/Handle.pm#L752
16:04 viki tbrowder: yeah, I can reproduce it on 2016.10-15-g43dbc96. { my $fh = open "foo", :r; say $fh.path.w } gives True
16:04 viki and opening in :w, gives True for .e
16:04 viki I mean for .r
16:05 viki m: say "foo".IO.w
16:05 camelia rakudo-moar 8c3e57: OUTPUT«True␤»
16:05 viki star: say "foo".IO.w
16:05 camelia star-m 2016.04: OUTPUT«Failed to find 'foo' while trying to do '.w'␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
16:06 viki bisectable6: \say "foo".IO.w
16:06 bisectable6 viki, On both starting points (old=2015.12 new=abf6caf) the exit code is 1 and the output is identical as well
16:06 bisectable6 viki, Output on both points: Failed to find 'foo' while trying to do '.w'␤  in block <unit> at /tmp/o6bKR1Pahw line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/o6bKR1Pahw line 1␤
16:06 viki dafuq
16:06 viki bisectable6: say "foo".IO.w
16:06 bisectable6 viki, On both starting points (old=2015.12 new=abf6caf) the exit code is 1 and the output is identical as well
16:06 bisectable6 viki, Output on both points: Failed to find 'foo' while trying to do '.w'␤  in block <unit> at /tmp/mUSQ6zoXba line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/mUSQ6zoXba line 1␤
16:07 viki Oh, I *did* have foo locally :} (and camelia is restricted, I'm guessing)
16:08 viki or too has foo in there
16:08 cognominal joined #perl6
16:10 tbrowder viki: My test code is in gist: https://gist.github.com/tbrowder/90c50fff31beb1ee03da1f8b1a7552d0
16:10 viki tbrowder: I think I get it. The :r, :w test the readness/writeness of the *file* the open opened. Not whether it was open in read/write mode
16:11 cdg joined #perl6
16:12 wamba joined #perl6
16:12 tbrowder ah, only a stat test, then--bummer.  well then maybe that's a nice new feature for IO::Handle!
16:12 viki Well, it *is* a part of IO::Handle.
16:12 tbrowder with it as a type constrain it could be useful
16:13 acrussell joined #perl6
16:13 viki It basically boils down to this test: https://github.com/rakudo/rakudo/blob/8c3e57d/src/core/Rakudo/Internals.pm#L1708  Note the `abspath` featured there.
16:13 viki Oh wait. I'm confusing things.
16:13 * viki stops doing two things at once
16:13 viki brb
16:14 tbrowder i mean add or fix it so it truly applies to the handle, NOT the file (i.e., a meta characteristic i guess)
16:14 tbrowder I meant to try the introspection on IO::Handle but haven't yet
16:15 tbrowder gotta leave for a while...
16:26 mohae joined #perl6
16:33 cognominal joined #perl6
16:37 dalek doc: 80ab9ff | timotimo++ | doc/Type/IO/Handle.pod6:
16:37 synopsebot6 Link: http://doc.perl6.org/type/IO/Handle.pod6:
16:37 dalek doc: use head3 instead of item for getc extra text
16:37 dalek doc: review: https://github.com/perl6/doc/commit/80ab9ff724
16:37 timotimo damn, it kept the :  %)
16:38 synopsebot6 joined #perl6
16:39 ggoebel joined #perl6
16:41 maybekoo2 joined #perl6
16:43 cognominal joined #perl6
16:52 pmurias joined #perl6
16:56 timotimo (the reason was that it had .pod6, but i expected only .pod)
16:57 tbrowder viki: disregard all I've complained about IO::Handle for now.  If a parameter file handle is expected to be writable and it's not, we get an exception, so that should take care of it for now. I've just started experimenting with introspection with IO::Handle so I may have some more questions later.
16:58 telex joined #perl6
17:04 * TimToady just realized that "put" can mean "print using terminator" :)
17:05 sufrostico joined #perl6
17:06 cyphase joined #perl6
17:07 * jnthn hands backronym of the day award to TimToady :)
17:08 TimToady I knew that I already liked 'put' a little because it started with the same letter as 'print'; now I know why :)
17:22 tbrowder viki: i tried all the documented metamethods and  the lost interesting is .VAR, it gave:
17:23 tbrowder s/lost/most/
17:23 tbrowder IO::Handle.new(:path("test-file.txt".IO(:SPEC(IO::Spec::Unix),:CWD("/usr/local/people/tbrowde/mydata/tbrowde-home-bzr/perl6/p6-repo-scripts-and-tests/signatures"))),:chomp)
17:23 tbrowder looks like the open mode should be there if it were anywhere
17:25 viki OK. I'm done with the other thing.
17:25 viki tbrowder: well, the .w test on the handle is just a .w test on the path: https://github.com/rakudo/rakudo/blob/8c3e57d/src/core/IO/Handle.pm#L752
17:26 viki So it's not a test of the open mode, it's the test of the file the handle points to.
17:27 tbrowder exactly, that's why we need to find the file open mode on the handle if it's available, the single letter methods as you say point back to the stat call on the file itself which should be rw unless changed with a stat call after closing the handle.
17:28 tbrowder sorry, chmod
17:28 tbrowder at least on *nix
17:31 viki It's not stored in IO::Handle
17:31 tbrowder viki: leaving again..i'll do some more work on Misc::Utils later. BTW, remember it's a WIP and the feedback is VERY helpful (see issues i entered raised by you)
17:32 FROGGS joined #perl6
17:32 tbrowder i know, but that (.VAR) would be the place to find it, no?
17:33 viki No.
17:33 viki tbrowder: $llmode contains that information and as you can see, it's just passed to nqp ops. The $!PIO may contain that info, I dunno: https://github.com/rakudo/rakudo/blob/8c3e57d/src/core/IO/Handle.pm#L94-L96
17:35 FROGGS o/
17:35 viki \o
17:41 tbrowder viki: i think i see the logic, and i'm beating a dead horse again:  the system throws if we try to write to a file open read only, that's the the way system open works and i don't see any way to add any useful info--case closed, Watson!
17:42 tbrowder bye again for a while...
17:42 viki Well, nothing's impossible :)
17:43 viki We can always add open-mode
17:43 viki And stick $llmode into it on .open
17:44 seatek joined #perl6
17:45 viki tbrowder: so we'd add $.open-mode attribute. Default it to Nil and set it to $llmode here: https://github.com/rakudo/rakudo/blob/8c3e57d/src/core/IO/Handle.pm#L99 and set it back to Nil on .close and on .slurp-rest when :close is set. Maybe you could try submitting a PR with that.
17:46 viki (maybe with an enum for open mode rather than 'r'/'-'/'+' strings)
17:56 cognominal joined #perl6
18:05 viki m: sub infix:<∅>(**@p) is pure { dd @p.elems }; say ∅⊖∅⊖∅⊖∅⊖∅⊖∅⊖∅⊖∅⊖∅
18:05 camelia rakudo-moar abf6ca: OUTPUT«Too many positionals passed; expected 2 arguments but got 9␤  in block <unit> at <tmp> line 1␤␤»
18:05 viki ?
18:06 viki Oh, wrong symbol in the op
18:06 viki Curse you, Unicode!
18:06 viki m: sub infix:<⊖>(**@p) is pure { dd @p.elems }; sink ∅⊖∅⊖∅⊖∅⊖∅⊖∅⊖∅⊖∅⊖∅
18:06 camelia rakudo-moar abf6ca: OUTPUT«9␤»
18:06 viki Cool. I didn't realize infixes behaved like that.
18:07 viki m: sub infix:<⊖>(**@p) is pure { dd @p }; sink 2⊖3⊖5⊖10⊖11⊖44⊖55⊖82⊖101
18:07 camelia rakudo-moar abf6ca: OUTPUT«[2, 3, 5, 10, 11, 44, 55, 82, 101]␤»
18:08 viki m: sub infix:<😻>(**@p) is pure { dd @p }; sink 2 😻 3 😻 5 😻 10 😻 11 😻 44 😻 55 😻 82 😻 101
18:08 camelia rakudo-moar abf6ca: OUTPUT«[2, 3]␤[Any, 5]␤[Any, 10]␤[Any, 11]␤[Any, 44]␤[Any, 55]␤[Any, 82]␤[Any, 101]␤»
18:09 viki Awww. Apparently that only works for ops that are marked as changed in grammar?
18:10 TimToady token infix:sym«⊖»    { <sym> <O(|%junctive_or)> }
18:10 firstdayonthejob joined #perl6
18:10 TimToady and junctive_or is list associative
18:10 vendethiel m: sub infix:<😻>(**@p) is assoc("list") is pure { dd @p }; sink 2 😻 3 😻 5 😻 10 😻 11 😻 44 😻 55 😻 82 😻 101
18:10 camelia rakudo-moar abf6ca: OUTPUT«[2, 3, 5, 10, 11, 44, 55, 82, 101]␤»
18:10 vendethiel @viki ^
18:11 vendethiel oh. Typing esc on a docs.perl6.org page will scroll up because it's caught by the field. mmh...
18:11 TimToady and we haven't thought about whether (^) can have a list associative meaning that is, er, meaningful...
18:11 vendethiel viki: see https://docs.perl6.org/language/operators#Operator_Precedence (scroll to the 2nd table, associativities)
18:12 TimToady it's rather similar to ^^ though, which is defined as as a one() listop, not as the parity-based binary +^
18:12 viki vendethiel: neat
18:14 viki m: sub infix:<😻>(**@p) is assoc("chain") { dd @p; '😻' }; sink 2 😻 3 😻 5 😻 10 😻 11 😻 44 😻 55 😻 82 😻 101
18:14 camelia rakudo-moar abf6ca: OUTPUT«[82, 101]␤[55, "😻"]␤[44, "😻"]␤[11, "😻"]␤[10, "😻"]␤[5, "😻"]␤[3, "😻"]␤[2, "😻"]␤»
18:14 viki cool
18:16 rgrinberg joined #perl6
18:17 sftp joined #perl6
18:20 setty1 joined #perl6
18:38 Tonik joined #perl6
18:43 dataf3l joined #perl6
18:55 eyck joined #perl6
18:57 labster joined #perl6
19:09 raiph joined #perl6
19:24 dalek doc: f4fd7fa | coke++ | xt/code.pws:
19:24 dalek doc: Track new code varnames
19:24 dalek doc: review: https://github.com/perl6/doc/commit/f4fd7faa17
19:24 RabidGravy joined #perl6
19:36 kurahaupo left #perl6
19:38 harmil_wk Examples above inspired me:
19:38 harmil_wk m: sub infix:<%%%>(**@p) is assoc("list") is pure { ([%] @p) == 0 }; say 8 %%% 6 %%% 2
19:38 camelia rakudo-moar 5d1b2c: OUTPUT«True␤»
19:38 harmil_wk Equivalent to a % b % ... %% n
19:42 tbrowder viki: i'll put that on my todo list, but low priority--in the meantime i'm working on breaking up my misc::utils module
19:45 masak I've been experiencing test failures in the `prove` harness (but not outside) on recent Rakudos
19:45 masak `prove` just reports "Non-zero wait status: 11" and "Parse errors: No plan found in TAP output" for some test files
19:45 masak (same ones every time)
19:45 masak but when I run them in any other way, they come out fine
19:46 viki masak: that's a segfault
19:47 moritz masak: have you tried strace or similar on prove, to see if there's actuall an exit code 11 involved?
19:47 viki masak: which test in particular btw?
19:47 viki test file
19:49 viki and when they "come out fine" do they actually include the TAP plan? :)
19:50 AlexDaniel joined #perl6
19:50 FROGGS masak: do these test files involve testing io? like subprocesses, captures, or similar?
19:51 viki Hum, "Now part of the Proc::Async class, but looks to work as in Perl 5" https://docs.perl6.org/language/5to6-perlfunc#kill
19:51 viki Except it ain't. Perl 5's kill can kill any pid, but P::A's kill kill's the P::A instance :/
19:53 masak FROGGS: yes. uncanny. it does a qqx[grep]
19:53 jnthn masak: Maybe try running them under prove with passing --exec="perl6-gdb" or so
19:53 masak hmm
19:53 masak ...does that actually work? :)
19:54 masak I mean, does prove end up giving gdb control in case of a segfault?
19:54 FROGGS masak: the harness combines stdout and stderr or so, and this used to break tests in the past that deal with the stuff mentioned
19:54 FROGGS I never understood why this happens
19:54 jnthn masak: Um...well, gdb may not end up giving you control actually :)
19:54 jnthn *prove
19:55 jnthn So yeah, may not work quite as well as hoped
19:55 FROGGS you can invoke perl6-gdb-m there, did that already
19:55 jnthn ah, cool
19:55 FROGGS though, that does not mean that the error will still be present
19:55 jnthn *nod*
19:56 jnthn Yeah, hanging ones under prove are easier in that you just attach gdb to them using the PID
19:56 bjz joined #perl6
19:57 jnthn Guess you can get a core dump
20:01 masak what's a recommended way to say "I know this value will trigger a 'useless use' warning, but just sink it uselessly anyway" ?
20:02 * masak has found `$ = ...` so far, but doesn't feel that's so clear
20:02 moritz m: sink 1
20:02 camelia rakudo-moar 5d1b2c: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant integer 1 in sink context (line 1)␤»
20:02 moritz :(
20:03 moritz masak: I'm curious, where does the need arise?
20:03 * moritz has no better ideas right now
20:03 [Coke] m: quiet 1
20:03 camelia rakudo-moar 5d1b2c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    quiet used at line 1␤␤»
20:03 [Coke] m: quietly 1
20:03 camelia rakudo-moar 5d1b2c: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant integer 1 in sink context (line 1)␤»
20:04 [Coke] m: INI 1
20:04 camelia rakudo-moar 5d1b2c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared name:␤    INI used at line 1␤␤»
20:04 [Coke] maybe we should add phasers to the lookup list.
20:04 moritz m: start 1
20:04 camelia rakudo-moar 5d1b2c: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant integer 1 in sink context (line 1)␤»
20:05 masak moritz: I'm golfing a tough one
20:06 masak usually you can bisect and identify which bits contribute to the error
20:06 masak with this one it feels like a dozen or so things conspire to bring it about; remove any one of them, and the error geos away
20:06 masak goes*
20:13 labster m: my $year = 2006; my @firstdayofmonth = (1..12).map: Date.new( :$year, :month( * )).day-of-year
20:13 camelia rakudo-moar 5d1b2c: OUTPUT«Cannot call Date.new with these named parameters: month year␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in any  at gen/moar/m-Metamodel.nqp line 3096␤  in block <unit> at <tmp> line 1␤␤»
20:14 labster m: Date.new( :2006year, :12month);
20:14 camelia rakudo-moar 5d1b2c: ( no output )
20:15 moritz argument lists generally don't *-curry
20:17 labster but doesn't infix:<+> work with an argument list too?
20:17 labster Treated differently by the grammar, I guess.   But that error is still LTA, because it's actually a false statement.
20:18 moritz m: say Date.new(year => 2016, month => 1)
20:18 camelia rakudo-moar 5d1b2c: OUTPUT«2016-01-01␤»
20:23 * masak gives up this golf and just replaces a `gather` block with pushing to an array, making the bug go away
20:24 masak boring, reliable code wins the day.
20:31 masak yeah. I'm definitely seeing more segfaults since I built latest rakudo. now I got one in a test file that doesn't do any subprocesses.
20:32 masak I was able to run perl6-gdb-m just now, but the error did not happen since it was outside of `prove`
20:37 kurahaupo__ joined #perl6
20:39 TEttinger joined #perl6
20:39 cdg joined #perl6
20:40 [Coke] a/me wonders if we'll ever have a day when someone is trying to debug a "why doesn't my all inclusive perl6 IDE using this 3rd party plugin fail in this weird way" like I am having today with eclipse. :|
20:43 kurahaupo left #perl6
20:47 leont joined #perl6
20:48 cdg joined #perl6
20:53 bjz joined #perl6
20:56 avar When I'm building rakudo star, ./perl6 <what> allows me to load with -m one of the modules I build in modules/?
21:08 dolmen joined #perl6
21:12 raiph avar: do you mean -M rather than -m?
21:15 avar yes
21:16 viki Yeah
21:17 viki Well, -M just adds paths to module search path, just like in P5. Not sure what's in modules/ :)
21:17 viki *M adds module to load
21:17 viki gah
21:17 viki -I adds paths to lib :) /me needs sleeps
21:17 FROGGS -I is what you said first
21:17 FROGGS star has a folder called "modules"
21:18 FROGGS and when you installed star, all modules will be accessible via -FThe::Module and via perl6 -e 'use The::Module;'
21:19 viki hm hm... yeah. After you install them. I'm looking now and just ./perl6 after building won't work, because they're in repo folders and proper paths that would work with -Imodules -MWhatever
21:19 avar Yeah, what I'm doing is debugging the build of rakudo* itself, with 2016.07 monkeypatching modules/MODULES.txt and dropping in a new modules/* module worked to make it build Inline-Perl5
21:19 avar But now it doesn't work, poking at "make install" now to see if I can somehow get it to tell me what it actually built
21:21 viki Interestingly, I don't see Inline-Perl5 in MODULES.txt in 2016.10.
21:22 avar It's not there, I'm manually adding it
21:22 viki I guess it's not part of it ¯\_(ツ)_/¯
21:22 avar tar zxf %{_sourcedir}/Inline-Perl5-2016-11-02-65ceb50.tar.gz -C modules
21:22 avar echo "Inline-Perl5" >> modules/MODULES.txt
21:23 viki I see
21:25 DrForr Does the trailing colon in an expression like 'try parse: $x;' have a special name?
21:26 moritz uhm, is that indirect object notation?
21:26 moritz or is the 'parse:' a label there?
21:26 timotimo i don't think a label is allowed in that location
21:26 timotimo so yeah, indirect object notation
21:27 geekosaur neither, foo: bar is an alternative to foo(bar)
21:27 timotimo um, no.
21:27 * geekosaur does not think of that as indirect since bar is not an object there...
21:27 geekosaur necessarily
21:27 timotimo foo: bar is just bar()
21:27 DrForr Well, it's 'try Exp24.parse: $x;' # I assumed it was the equivaent of 'try Exp24.parse( $x );'
21:28 timotimo yes, that is correct
21:28 timotimo what you see there is a statementlist prefix form
21:28 timotimo the try just goes in front for funsies, like a sub would
21:29 timotimo but try Exp24.parse: $blah is very different from try parse: $blah
21:29 avar If I find issues with rakudo* in particular, what's a good point of contact? I.e. is there a bug tracker, or do I just harass this channel?:)
21:29 timotimo rakudo star in particular has rakudo/star on github
21:29 timotimo that has an issue tracker
21:30 avar will poke that, thanks
21:30 DrForr I'll treat it as an argument list with a single prefix colon. Tomorrow night :)
21:35 harmil_wk In current rakudo, what would be the equivalent if any of the S05-specced /^ <before $prefix> <* $full> $/ where $prefix is a left-anchored subset of $full?
21:37 timotimo i don't know what that means. at all.
21:38 harmil_wk <* ...> was supposed to be a partial match, so <* $foo> should match zero-or-more characters of $foo.
21:39 harmil_wk To quote S05, "A leading * indicates that the following pattern allows a partial match. It always succeeds after matching as many characters as possible."
21:39 moritz harmil_wk: I don't think there's any equivalence
21:39 harmil_wk Hmm, okay.
21:39 harmil_wk thanks
21:39 bjz joined #perl6
21:40 * avar files https://github.com/rakudo/star/issues/77
21:44 kurahaupo__ joined #perl6
21:44 harmil_wk m: my $_ = "apple"; my $prefix = "ap"; my $full = "applesauce"; say (/^ $prefix (.*) $/ and $full ~~ /^$0/);
21:44 camelia rakudo-moar ebcc33: OUTPUT«Potential difficulties:␤    Redeclaration of symbol '$_'␤    at <tmp>:1␤    ------> 3my $_7⏏5 = "apple"; my $prefix = "ap"; my $full ␤Nil␤»
21:45 harmil_wk m: $_ = "apple"; my $prefix = "ap"; my $full = "applesauce"; say (/^ $prefix (.*) $/ and $full ~~ /^$0/);
21:45 camelia rakudo-moar ebcc33: OUTPUT«Nil␤»
21:45 harmil_wk Bah
21:46 timotimo i didn't know of that feature yet. cool.
21:46 timotimo i think you could have something like / $prefix & [ .* $suffix  ] /
21:46 timotimo oh, but that doesn't do the partial match part that you apparently want
21:47 timotimo never mind.
21:47 harmil_wk I think today it needs to be two matches, just trying to figure out how
21:50 harmil_wk Ugly but working:
21:50 harmil_wk m: $_ = "apple"; my $prefix = "ap"; my $full = "applesauce"; say (/^ $prefix (.*) $/ and (my $m = $0) and $full ~~ /^$prefix$m/)
21:50 camelia rakudo-moar ebcc33: OUTPUT«「apple」␤»
21:52 moritz m: my $full = 'applesauce'; my $re = $full.flip.comb.reduce: { "$^b\[$^a]?"}; say 'apple' ~~ /<$re>/
21:52 camelia rakudo-moar ebcc33: OUTPUT«「apple」␤»
21:53 harmil_wk Ha! Nice
21:53 harmil_wk I think I've actually done that in Perl 5... years ago.
21:53 moritz if you think in terms of automatons, <*...> is very easy: every state is an accepting state. Over.
21:54 avar I get the uncanny feeling with some p6 stuff that I'm really the first person ever to use some trivial feature: https://github.com/rakudo/star/issues/78 :(
21:55 harmil_wk It's sort of the regex equivalent of a try block. "whatever gets done is great".
22:09 timotimo avar: the star makefile and stuff is basically a big pile of crap :)
22:15 harmil_wk m: say "abc" ~~ /^<{?True}>/
22:15 camelia rakudo-moar ebcc33: OUTPUT«Nil␤»
22:16 harmil_wk Shouldn't that match?
22:16 rindolf joined #perl6
22:30 timotimo you put the ? after the {
22:30 timotimo it should go before the {
22:31 timotimo right now you're trying to match "abc" against / "True" /
22:31 harmil_wk Ah, thanks
22:31 girafe joined #perl6
22:32 harmil_wk m: $_ = "app"; my $prefix = "ap"; my $full = "applesauce"; say $_ ~~ /^ <before $prefix> (.*) $ <?{$full.starts-with(~$0)}>/
22:32 camelia rakudo-moar 40429f: OUTPUT«「app」␤ before => 「」␤ 0 => 「app」␤»
22:33 harmil_wk At least that's only one regex, and doesn't require building it on the fly.
22:38 timotimo right, interpolating code into regex is extremely costly
22:51 setty1 joined #perl6
22:59 cdg joined #perl6
23:13 naptastic joined #perl6
23:13 naptastic How does Perl 6 represent strings? I've learned about the complexities of unicode, but not how to handle them, and everything I've heard is that Perl 6 is really the only language that gets it right natively, and that it does so in a smart way.
23:13 naptastic Where can I read more? :)
23:15 timotimo we have something called "NFG"
23:15 timotimo where we pretend the unicode consortium has assigned combined codepoints for every combination you can come up with
23:15 timotimo we call these "synthetic codepoints" and we build them whenever they are needed
23:15 timotimo the user never gets to see them
23:16 timotimo but you get O(1) access from "index of grapheme" to "the grapheme in the string"
23:16 timotimo which you don't when you have anything else
23:17 naptastic How big are synthetic codepoints?
23:18 naptastic And what happens if I create a character with a large number of combining diacritics?
23:18 rodrigok joined #perl6
23:20 timotimo then you get just one grapheme
23:20 timotimo we store graphemes as 32bit signed integers, we use the negative values for synthetics
23:21 naptastic I'm ok with that. But how does Perl 6 keep from running out of synthetic code points?
23:22 timotimo you'll have to have a very long-running program with an attacker to exhaust it
23:23 timotimo in the future we'll have a stage in the GC that can free up synthetics
23:23 naptastic I would have to create more than 2^31 unique graphemes.
23:23 naptastic And a string to contain them. Ok, attacking that is not practical. I approve of your approach. :)
23:23 timotimo for now i'd just say restart your moarvm instance when it gets problematic
23:23 seatek hehe
23:23 timotimo like, regularly restart it
23:24 timotimo the cleanup thing will be implemented, but it is not yet a priority
23:25 rodrigok hello there
23:26 rodrigok novice here, trying to understand a simple thing about p6 class "static fileds"
23:26 rodrigok like described in here https://docs.perl6.org/language/classtut#Static_fields?
23:27 timotimo that piece of description is ... hardly helpful
23:28 rodrigok the last paragrah of that title, states "Class attributes may also be declared with a secondary sigil"
23:28 timotimo the rest of the docs call that "twigil"
23:28 rodrigok yes
23:28 rodrigok but the thing is
23:29 rodrigok I can not use the static field
23:29 rodrigok inside the class
23:29 rodrigok when I put a twigil in it
23:29 timotimo can you show a short piece of code that shows the problem?
23:29 rodrigok I can show an example
23:30 timotimo cool
23:30 timotimo i'm distracted by being knee-deep in C code :)
23:30 rodrigok class Test1 { has $x = 1; has $.y = $x; }
23:30 rodrigok class Test6 { my $x = 6; has $.y = $x; }
23:31 rodrigok in the Test1, I can write "has $.x"
23:31 rodrigok and make $y = $.x
23:31 rodrigok In the second example, I cant
23:31 rodrigok I know the '$.x' is really using an acessor
23:32 rodrigok I could also use $!x
23:32 timotimo with "my $.x" it shouldn't be possible to do $!x
23:32 rodrigok yes
23:33 rodrigok what about "my $.x; has $y= <the value of x>?"
23:34 rodrigok the dot also does not seems to work
23:35 timotimo it could just be that the docs are wrong :S
23:36 rodrigok It gives a compiler error
23:36 rodrigok "Virtual method call $.x may not be used on partially constructed object (maybe you mean $!x for direct attribute access here?)"
23:37 skids joined #perl6
23:37 gfldex m: class Test6 { my $x = 6; has $.y = $x; }
23:37 camelia rakudo-moar 88cb05: ( no output )
23:38 rodrigok that works
23:38 gfldex m: class Test6 { my $x = 6; has $.y = $x; }; say Test6.new.y;
23:38 camelia rakudo-moar 88cb05: OUTPUT«6␤»
23:38 rodrigok If I put a twigil in $.x
23:38 rodrigok I can even create a Test6 object
23:38 rodrigok and call the 'x' method
23:39 rodrigok but not from _inside_ the class, it seems
23:39 rodrigok class Test6 { my $.x = 6; has $.y = 7; }
23:39 rodrigok my $t6 = Test6.new();
23:39 rodrigok say $t6.x;
23:39 rodrigok (sorry, I don't know how to use the bot)
23:39 skids m: class Test6 { has $.x = 6; has $.y = $!x; }; say Test6.new.y;
23:39 camelia rakudo-moar 88cb05: OUTPUT«6␤»
23:40 gfldex prefix code with "m:"
23:40 gfldex prefix code with "m: " actually
23:40 rodrigok thanks
23:40 skids Initializers happen before the object is complete, so you have to use direct attribute access.
23:41 rodrigok ok, but, I was trying it in a _class_ attribute
23:41 rodrigok called "static filed" in that link
23:41 rodrigok m: class Test6 { my $.x = 6; has $.y = $!x; }; say Test6.new.y;
23:41 camelia rakudo-moar 88cb05: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Attribute $!x not declared in class Test6␤at <tmp>:1␤------> 3ass Test6 { my $.x = 6; has $.y = $!x; }7⏏5; say Test6.new.y;␤    expecting any of:␤        horizontal whitespace␤»
23:42 rodrigok I replaced the "has $.x" by "my $.x"
23:42 skids Ah.  Yeah, I would guess that should probably be made to work.
23:42 skids Not that but...
23:43 skids m: class Test6 { my $.x = 6; has $.y = $.x; }; say Test6.new.y; # this
23:43 camelia rakudo-moar 88cb05: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Virtual method call $.x may not be used on partially constructed object (maybe you mean $!x for direct attribute access here?)␤at <tmp>:1␤------> 3class Test6 { my $.x = 6; has $.y = $.x7⏏5; }; say …»
23:43 rodrigok I understand that the "!" would not work
23:43 rodrigok and the "." will try to access a method before the object is ready
23:44 rodrigok which is not allowed, ok
23:44 timotimo you can try to Type.x instead
23:44 rodrigok I could not figure out what syntax I should use
23:44 rodrigok whats that?
23:44 skids of course you can workaroud with:
23:45 skids m: class Test6 { my $.x = 6; has $.y = self.x; }; say Test6.new.y;
23:45 camelia rakudo-moar 88cb05: OUTPUT«6␤»
23:45 rodrigok ohh, I tried that
23:45 skids self would be the type object.
23:45 rodrigok I sear!! haha
23:45 seatek ++skids for self -- that's what i always do
23:45 rodrigok let me see here
23:45 John[Lisbeth] joined #perl6
23:45 skids or wait...
23:45 rodrigok (you may have noted, I have examples from 1 to 7)
23:46 skids m: class Test6 { my $.x = 6; has $.y = self.say; };
23:46 camelia rakudo-moar 88cb05: ( no output )
23:46 skids m: class Test6 { my $.x = 6; has $.y = self.say; }; Test6.new;
23:46 camelia rakudo-moar 88cb05: OUTPUT«Test6.new(y => Any)␤»
23:46 skids I guess self is somehow not just the type object.
23:47 seatek timotimo: are the doc links made always by L<JSON::Tiny module|URL> ?
23:47 timotimo i have no idea
23:47 rodrigok I had not tried the "self" for the static attributes
23:47 seatek k
23:48 timotimo i haven't written docs in ages *cough cough*
23:49 seatek but you were doing something with the links in them just last night! so i thought you'd be the guy to ask about links in docs. ;)
23:49 naptastic (Assuming a host with infinite memory) How many objects can I create in Perl 6?
23:49 rodrigok well, I dont understand very well what you said about the self and tpye object
23:50 rodrigok but that example worked, so, thanks
23:50 timotimo seatek: no, exclusively links shared to the irc by dalek
23:50 mscha joined #perl6
23:50 seatek aha! :)
23:50 John[Lisbeth] joined #perl6
23:51 mscha m: (1,2 * * + 1 ...^ * > 2**100).grep: *.is-prime;
23:51 camelia rakudo-moar 88cb05: ( no output )
23:51 mscha m: (1,2 * * + 1 ...^ * > 2**100).grep(*.is-prime)».say;
23:51 camelia rakudo-moar 88cb05: OUTPUT«3␤7␤31␤127␤8191␤131071␤524287␤2147483647␤2305843009213693951␤618970019642690137449562111␤»
23:51 mscha Perl6 slow?  I don't think so...
23:53 mscha m: (1,2 * * + 1 ...^ * > 2**10000).grep(*.is-prime)».say;
23:53 camelia rakudo-moar 88cb05: OUTPUT«(timeout)3␤7␤31␤127␤8191␤131071␤524287␤2147483647␤2305843009213693951␤618970019642690137449562111␤162259276829213363391578010288127␤170141183460469231731687303715884105727␤686479766013060971498190079908139321726943530014330540939446…»
23:56 seatek i dont' suppose there is any HTML -> pod6 converter yet
23:57 skids HTML *to* pod6?
23:57 seatek yes, i wrote up my long-winded doc in and html editor. now i need it to be in pod6
23:58 seatek i'm going through line by line right now by hand, dreaming of icecream

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

Perl 6 | Reference Documentation | Rakudo