Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2014-12-30

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:11 Ven joined #perl6
00:44 raydiak back
00:44 Ven joined #perl6
00:49 davido_ joined #perl6
00:54 telex joined #perl6
01:04 PZt joined #perl6
01:05 dayangkun joined #perl6
01:08 yeahnoob joined #perl6
01:16 tadzik not sure how complicated would that be
01:35 raydiak still investigating, looking at p5's git::pureperl (which is only 1600 lines of p5 for a complete implementation, less 1 dependency I'm not sure about)
01:35 raydiak but gotta run again...busy day, I guess
01:38 adu tadzik: I wonder how much better everyone's life would be if the zip part of tarball was a Content-Encoding header so that the file you downloaded was technically a .tar
01:39 tadzik adu: harder for our Perl 6 HTTP client :)
01:44 japhb So this afternoon I hit for about the sixth time the type discontinuity between < foo bar > and < foo >, which comes up often when I am inspecting or iterating over some configuration and finding that suddenly it no longer binds to Positional.
01:45 japhb Is this something that will be addressed in the GLR, or is there an idiom I can use to ensure that the list always stays a list, even as elements are added and removed?
01:45 japhb (I use 'list' in lowercase to mean any list-like thing, not necessarily a List or Array or whatever.)
01:46 japhb For now, I'm using [< foo >], but that's kinda ugly and feels redundant.
01:46 japhb TimToady, pmichaud: ^^
01:47 TimToady I doubt that's gonna change, since we specifically call out <1/2> as a Rat literal, for instance
01:48 TimToady and (1) is not a list either
01:48 TimToady and @foo<bar> is not a slice
01:48 TimToady er, %foo
01:49 TimToady in general we make up for it by treating Any as a list of 1 element
01:49 TimToady so I think you're stuck with [< >] for composition
01:50 TimToady if you want it mutable
01:51 TimToady it's not like <foo bar> should really be considered mutable either...
01:51 TimToady m: my @a := <foo bar>; push @a, 'baz'; say @a
01:51 camelia rakudo-moar 80b912: OUTPUT«Cannot call 'push'; none of these signatures match:␤:(Any:U \SELF: *@values, *%_)␤  in sub push at src/gen/m-CORE.setting:9364␤  in block <unit> at /tmp/gU7YwumWPG:1␤␤»
02:05 Ven I agree I always get surprised when <foo> doesn't return a list
02:06 Ven japhb: you can <foo>.flat, though
02:07 japhb TimToady: I wasn't really looking for mutability, just for things like: my %config := { monster_filter => < large green > }; my @filter_keys := %config<monster_filter>;  # works, but remove 'green' and it doesn't.
02:18 mickcy_ca joined #perl6
02:20 rmgk_ joined #perl6
02:36 TimToady japhb: otoh it'd work if you used = instead of :=
02:36 TimToady people who use := are expected to think harder :)
02:37 TimToady (2nd := I mean)
02:39 TimToady and anyway, you probably want monster_filter => < large green >.any
02:39 TimToady and that would work too
02:39 TimToady or .all
02:41 TimToady anyway, you don't have to work very hard to make an item behave as a list
02:41 yeahnoob joined #perl6
02:42 TimToady and I suspect the opposite behavior would produce even more WATs
02:50 ugexe raydiak: there will be soon
02:50 tinyblak joined #perl6
02:53 ugexe we are addressing all of those problems
02:54 mickcy_ca Hello Perl6
02:59 raydiak ugexe: nice, good to know
02:59 raydiak hi mickcy_ca
03:03 mickcy_ca Alas ... I am getting frustrated with this grammar I have been hacking at for the last couple of days.
03:04 mickcy_ca I keeps hanging when I attempt to add + to a term ... even though it matches when I duplicate the line manually.  Very frustrating.
03:04 dayangkun joined #perl6
03:05 mickcy_ca Will post a gist if anyone wants to look at it.
03:07 Ven mickcy_ca: have you tried running the debugger?
03:08 mickcy_ca Noob here ... there is a debugger?
03:09 Mso150 joined #perl6
03:10 raydiak Grammar::Debugger
03:11 mickcy_ca Thanks ... just picked it up through panda.
03:15 mickcy_ca OK, looking at the debugger and I am wondering why any line that starts line #include ends up on two lines, first one '#' and the second one 'include'
03:15 mickcy_ca <err> ... starts like $include ...
03:16 mickcy_ca Not a big deal for me, even though I would like to be able to find #include directly.
03:17 mickcy_ca Actulally, '/' and '*' also do the same thing.
03:35 hagirikan joined #perl6
03:36 raydiak might have more luck by just pasting a (short) gist than waiting for someone to ask for it :)
03:38 mickcy_ca Found part of my problem ... working through it now.
03:38 xinming_ joined #perl6
03:39 raydiak nice...debugger helps
03:45 tinyblak_ joined #perl6
03:45 noganex joined #perl6
03:52 mickcy_ca It does ... very much so.
04:04 raiph joined #perl6
04:07 kaare_ joined #perl6
04:12 mickcy_ca OK ... it turns out I don't know how to figure this issue out ... see http://pastebin.com/JqepMjQ9 and check out the offender at line 11 ... do [<sp><enumerated>]+.*? and the whole thing fails.  Help would be appreciated.
04:18 mickcy_ca aargh ... shortened to the actual routines that I am testing and it is blowing up on me.
04:21 raydiak try changing .*? on that line to <-[}]>*
04:21 raydiak afk
04:35 raydiak back...and no that's not what you're trying to do I see now
04:36 mickcy_ca YAY ... got it to work!
04:37 mickcy_ca It was my definition of <define> that mucked me up for the evening.
04:39 raydiak congrats
04:41 mickcy_ca Now, would someone be able to elucidate me on why the apparently grammar chops non word characters off the beginning of a line.  See http://pastebin.com/JE2SNfZy for an example ... this one does match what I want, but still strips the leading '#' off of all lines.
04:57 TimToady mickcy_ca: what are you expecting <-[\n\s]> to do?  It seems wrong to me several ways
04:58 TimToady in the first place, \n is a subset of \s, so is meaningless
04:59 TimToady secondly, you're always matching it first, so it's always going to match unless there's whitespace
04:59 TimToady and it will eat that first character
04:59 TimToady and exclude all the other possibilities because of the ||, even if they were a longer token match
05:01 TimToady generally you should let your rules soak up whitespace, and otherwise not be trying to match it negatively
05:02 TimToady otoh, if you're doing line-oriented parsing, it's usually a mistake to use rules at all
05:03 TimToady unless you redefine ws to just mean \h*
05:03 TimToady because any implicit call to <.ws> is going to chew through your line delimiter
05:04 TimToady and any leading whitespace on the next line
05:05 TimToady I can see why you're trying to mix them, though, since C preprocessor is line-oriented and C isn't
05:06 TimToady if you're going to try to do this, you have to be very picky about what can or cannot match newline though
05:07 * TimToady would probably try to handle all line-oriented stuff inside a custom ws rule, whenever it sees a n
05:09 TimToady then again, if I were doing this, I'd write a full parser, and not try to second-guess the formatting conventions, because there are always violations of conventions
05:10 TimToady (you can really only get away with the convention approach if you define the conventions in advance, as we did with the test fudger)
05:14 mickcy_ca TimToady: I do not know the difference between the convention approach and what a full parser would be.
05:14 yeahnoob joined #perl6
05:17 mickcy_ca Basically, I thought that I was writing a parser ... :-/
05:24 mickcy_ca The <-[\n\s]> to shortcut out blank lines ... if it eats char 1 ... then out it goes.
05:26 mickcy_ca As far as the || goes ... I am not looking for the "longest" match, but the best match.  That said, if you look closely, in rule lines, I am looking for <definition> and in rule enumerated I am also looking for <definition>.  If I didn't use the exclusive or it would always match the longest ... not what I intended.
05:36 kaare_ joined #perl6
05:39 TimToady if you want to shortcut a blank line, that's just $$, or maybe \h*$$
05:40 mickcy_ca That does the trick!
05:46 mickcy_ca TimToady: So, if I were to give up on this approach, and go ahead to just write a parser for C-header files ... I can see some other ways of going about it ... but I can only see grammars as the most efficient way.  I there an alternative to this that you could point me towards?
05:50 TimToady grammars is also how you write a full parser, so just keep developing this, and eventually you'll get one :)
05:53 mickcy_ca I have found that the beauty of the line by line approach in this case,  is that each rule / token / regex can automagially eat up subsequent lines if needed.
05:57 raydiak pretty sure more than one c grammar has been toyed with, you might find a link to a gist or something in the irclog with some searching, if you wanted to build on existing work or use ideas from it
05:58 mickcy_ca Why didn't I think of that ... P5 solution ... Parse-RecDescent-1.967_010 on C-Pan.
06:04 adu joined #perl6
06:04 mickcy_ca GCC socket.h -fdump-translation-unit will produce a socket.h.pth file ... Does anybody know what that is?  Perhaps and how to peruse it in P6?
06:05 raydiak should I be using EXPR and/or other stuff from the P6 grammar in my own expression grammars?  if so, is there anything helpful/related to read about how to go about that?
06:06 raydiak I'm sure Math::Symbolic contains a very suboptimal reimplementation of these things :)
06:07 raiph joined #perl6
06:09 mickcy_ca OK ... giving up on c header parsing ... close to 800 lines of parser at https://gist.github.com/andydude/5268163
06:13 raydiak nice, maybe that one will suit your purposes?
06:13 mickcy_ca Looking at it ...
06:14 mickcy_ca It is much more than I need ... but if I am correct, everything that is in a header file is valid in a C program, is it not?
06:14 sunnavy joined #perl6
06:15 mickcy_ca If I use that code ... "all" I have to do is write the action class to pull out the matches.
06:23 dalek roast: 64c0122 | TimToady++ | / (3 files):
06:23 dalek roast: remove inadvertent shape declarations from tests
06:23 dalek roast:
06:23 dalek roast: Postcircumfixes on parameter variables are reserved for shape declarations.
06:23 dalek roast: Generally whitespace or a colon is needed to disambiguate.
06:23 dalek roast: review: https://github.com/perl6/roast/commit/64c01227e1
06:24 raydiak what is the problem you're trying to solve? are you trying to parse one specific file, or any c header?
06:25 raydiak b/c if you're trying to solve the general case, then yeah it's a fairly extensive undertaking, though I certainly don't mean to dissuade you
06:26 dalek rakudo/nom: dd5687c | TimToady++ | src/Perl6/Grammar.nqp:
06:26 dalek rakudo/nom: Give meaningful redirects on NYI shape declartions
06:26 dalek rakudo/nom:
06:26 dalek rakudo/nom: Sloppy subsigs or functions with sigs are no longer allowed, since declaring
06:26 dalek rakudo/nom: a variable with an immediately following postcircumfix is construed as a shape.
06:26 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/dd5687cc9f
06:26 raydiak if you're just trying to one-off something, then it's not unreasonable to expect to be able to hack something together that could accomplish the specific task at hand, as long as your input is fairly clean
06:28 mickcy_ca The end result I am going for is the general case ... although I can see that my original tact would have been very insufficient to the task.
06:29 mickcy_ca And re-inventing the wheel is not my idea of fun.
06:30 mickcy_ca Does anyone know how to get that those files included in my project?
06:31 raydiak ah...if you're not wanting to write a c parser from scratch, then I'd just use what you found, personally...don't know that the action class would be all that bad to write, for the subset you need
06:31 mickcy_ca That was my thought indeed.
06:32 raydiak maybe send him a message on github or something?
06:32 raydiak don't know who that is, myself
06:32 mickcy_ca Planning to do that.
06:33 TimToady or get someone to translate it to P6 for you :)
06:33 mickcy_ca ??
06:33 raydiak it is p6
06:34 TimToady oh, that is a P6 parser already
06:35 mickcy_ca Exactly ... now back to getting that into my project without adding all those lines to my part of the project.
06:35 TimToady yeah, we should get that into the ecosystem somehow
06:37 mickcy_ca Without a github sign in ... is there a way to send anyone a message on github?
06:38 xiaomiao mickcy_ca: unlikely
06:38 mickcy_ca That is what I thought ...
06:42 mickcy_ca With a github account ... how to send message to a specific user?
06:42 skids joined #perl6
06:42 raydiak dug up an e-mail: andjrob [at] gmail.com
06:43 mickcy_ca Thanks.
06:44 raydiak you're welcome
06:44 adu what
06:44 adu that's me
06:44 raydiak oh we love your C parser and want it in the ecosystem :)
06:44 adu raydiak: sweet
06:45 adu can I help?
06:45 raydiak adu: interested in maintaining it as a module?
06:45 adu I just wish it was better/faster/stronger
06:45 dayangkun joined #perl6
06:45 adu raydiak: yes, what do I do?
06:46 raydiak I think http://doc.perl6.org/language/modules is most of what you need to know
06:47 adu I haven't spent much time on it lately, but I would imagine to make it a module I would have to separate out the parser from the DROXActions
06:48 adu raydiak: just to be sure, are you talking about https://github.com/andydude/droxtools/tree/master/c2drox-perl6/lib/C
06:49 raydiak we were looking at https://gist.github.com/andydude/5268163 that we dug up from the irclogs somewhere :)
06:49 adu oh
06:49 adu that's super old
06:51 raydiak well, we don't have a C parser in the ecosystem, so in whatever form, if you'd like to package your work up into a module, it'd be cool to have
06:51 adu raydiak: yeah, I can separate it out from the drox stuff, what should it be called?
06:52 raydiak hmmm
06:53 raydiak most of the ones I see are Something::Parse/Parser/Parsing
06:53 adu Language::C::Parser?
06:54 * raydiak is not really all that familiar with the conventions tbh
06:55 raydiak not sure if we have any really settled yet anyway, so sure why not?
06:57 adu nah, C::Parser is good
07:08 pmichaud m: $_ = 'xyz';  say 'abc' ~~ m/.../;
07:08 camelia rakudo-moar 80b912: OUTPUT«「abc」␤␤»
07:08 pmichaud m: $_ = 'xyz';  say  m/.../;
07:08 camelia rakudo-moar 80b912: OUTPUT«「xyz」␤␤»
07:08 adu raydiak: like this? https://github.com/andydude/p6-c-parser
07:09 pmichaud m: $_ = 'xyz';  say 'abc' !~~ m/.../;
07:09 camelia rakudo-moar 80b912: OUTPUT«False␤»
07:09 raydiak adu: looks good, lemme try it out
07:10 adu raydiak: it's slow and incomplete, just a warning
07:12 pmichaud m: $_ = 'wxyz';  say 'abc' !~~ m/..../;
07:12 camelia rakudo-moar 80b912: OUTPUT«True␤»
07:12 raydiak adu: nice, builds and installs fine here
07:14 mickcy_ca raydiak: how do you do that?
07:15 mickcy_ca Got the source package, how do I compile and install?
07:15 raydiak mickcy_ca: 'panda install .' iirc
07:15 mickcy_ca OK.
07:17 mickcy_ca Worked here to.
07:17 adu raydiak: best not to throw the linux kernel at it, it's still having trouble with "int main() { return 0; }"
07:18 raydiak adu: yeah I don't have a specific use for it atm, was originally just answering questions :)  though I did earlier this year want to use p6 to autogen ffi bindings for luajit
07:18 adu that sounds fun
07:19 jluis joined #perl6
07:19 mickcy_ca adu:  Was looking at implement a parser for header files ... turns out I was re-inventing the wheel.
07:20 mickcy_ca I get "undeclared routine" when I do use "C::Parser"
07:21 raydiak yeah I had one problem or another with every binding I tried...think it was for 0mq, ended up one-offing a script w/a bunch of regex to do it iirc, but would much rather have a reuasable solution obviously
07:21 pmichaud m: $_ = 'wxyz';  say abc !~~ m/{ .say } ./
07:21 camelia rakudo-moar 80b912: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/Dxp9Qf0EW1â�¤Undeclared routine:â�¤    abc used at line 1. Did you mean 'abs'?â�¤â�¤Â»
07:21 yeahnoob joined #perl6
07:21 pmichaud m: $_ = 'wxyz';  say 'abc' !~~ m/{ .say } ./
07:21 camelia rakudo-moar 80b912: OUTPUT«abc␤False␤»
07:21 mickcy_ca Ah.
07:22 mickcy_ca Anyway, it has been a hoot.  Good Night Perl 6
07:22 mickcy_ca left #perl6
07:25 darutoko joined #perl6
07:25 adu https://github.com/andydude/p6-c-parser/blob/master/bin/cdump.pl6
07:25 adu that's the tool I usually test with
07:26 raydiak ah nice
07:27 raydiak be aware that things in bin get installed by panda, theoretically into the user's $PATH
07:28 adu is cdump a common name?
07:28 raydiak *shrug*
07:30 adu or are you saying that it shouldn't have an extension?
07:31 raydiak not really saying anything specific, just letting you know...I'm not completely sure the place they all get installed to is automatically added to the PATH yet anyway
07:32 raydiak I am not an expert, if this wasn't already apparent :)
07:32 adu raydiak: well, that's for the nudge :)
07:32 adu s/that's/thanks/
07:33 raydiak you're welcome, thanks for the awesome work, it's kinda intimidating-looking when I came across it
07:33 adu I hope to make it less intimidating with ASTs and PODs, assuming I learn how they work
07:34 raydiak adu: a little bit in the README goes a long way too
07:34 adu I should put an experimental warning
07:35 raydiak oh and when you have time, a basic front end in C/Parser.pm6, even if it's just a passthrough to .parse like you have in that script, would be cool so people can just "use C::Parser;"
07:36 adu raydiak: I'm not sure I understand
07:37 sven_123 joined #perl6
07:37 adu oh, so you can call C::Parse(...) instead of that long thing?
07:38 raydiak much of the time people will expect to be able to load your module simply by passing the namde of your module to 'use'...so making "use C::Parser" do something useful w/out the additional ::StdWhatever part might be worthwhile
07:39 adu oh
07:39 raydiak just prettyness of the API for your users, basically...potentially less to have to remember to type or look up
07:41 bjz joined #perl6
07:42 raydiak adu: oh anyway, to make this actually part of the ecosystem, you can either ask around when more people are active (next few hours usually) to get added to the perl6 github org, then you'll be abel to commit to the ecosystem list
07:42 adu I'm actually already a member
07:42 raydiak oh nice
07:43 adu I just haven't done much
07:43 raydiak you can commit to the ecosystem list then
07:43 adu where is it?
07:43 raydiak https://github.com/perl6/ecosystem/blob/master/META.list
07:44 dalek nqp: ccb0ef3 | TimToady++ | Configure.pl:
07:44 dalek nqp: slightly saner default build order
07:44 dalek nqp: review: https://github.com/perl6/nqp/commit/ccb0ef3fd6
07:44 dalek rakudo/nom: 66309df | TimToady++ | Configure.pl:
07:44 dalek rakudo/nom: tweak default build order a bit
07:44 dalek rakudo/nom:
07:44 dalek rakudo/nom: I got tired of building the jvm version by accident when I left out the m- bit. :)
07:44 dalek rakudo/nom: This way the fast one builds first, and then you can ^C if you don't want the slower platforms.
07:44 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/66309df510
07:46 skids joined #perl6
07:47 sirdancealot joined #perl6
07:47 raydiak adu: once you've added your module to the ecosystem, in roughly the next hour or two it will appear in the list that panda uses at http://ecosystem-api.p6c.org/projects.json
07:48 raydiak then you can "panda update" followed by "panda install C::Parser", and the rest of us can too
07:49 pmichaud TimToady++ # another island of sanity
07:50 raydiak ( I'd suggest a test or two if you feel like it, too...even just one that 'use's your module and makes sure it loads successfully )
07:50 kaleem joined #perl6
07:53 adu raydiak: I'm on team nqp, I can't make changes to ecosystem
07:56 raydiak someone get this man a commit bit! (andydude on github)  if nobody does by the time I'm back from afk in a few minutes I can add it for you if you like
07:57 moritz commit bit for whom?
07:57 moritz \o #perl6
07:57 adu moritz: I'm already a member of nqp, but I'm trying to add my project to the ecosystem
07:57 moritz adu: what's your github ID?
07:57 adu and apparently you need to be an owner for that
07:57 adu "andydude"
07:58 moritz adu: no, it's a separate team; invitation sent
07:59 moritz or added; it seems invitations are only for first joining an organization
08:00 dalek ecosystem: e5ea4e9 | (Andrew Robbins)++ | META.list:
08:00 dalek ecosystem: Added p6-c-parser to META.list
08:00 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/e5ea4e9144
08:00 adu :)
08:01 adu moritz: thanks
08:01 adu I guess I have to write some tests now
08:03 lsm-desktop joined #perl6
08:03 TimToady adu++
08:03 skids joined #perl6
08:04 raydiak \o/ adu++
08:05 adu :)
08:06 raydiak adu: you might want a .gitignore for those .DS_Store files among other things
08:06 adu raydiak: already done
08:06 raydiak nice
08:15 raydiak alright past my bedtime...g'night #perl6
08:15 TimToady o/
08:30 virtualsue joined #perl6
08:30 adu I just updated it
08:31 Psyche^ joined #perl6
08:31 mephinet joined #perl6
08:34 dalek doc: b7c434d | moritz++ | lib/Language/regexes.pod:
08:34 dalek doc: Be consistent in use of <.ws> (not <ws>)
08:34 dalek doc: review: https://github.com/perl6/doc/commit/b7c434d54b
08:38 kjs_ joined #perl6
08:48 avalenn joined #perl6
08:50 kjs_ joined #perl6
09:04 Sir_Ragnarok joined #perl6
09:05 dalek doc: 5607c3d | moritz++ | lib/Language/regexes.pod:
09:05 dalek doc: Examples for overriding ws
09:05 dalek doc: review: https://github.com/perl6/doc/commit/5607c3de47
09:10 Mso150 joined #perl6
09:24 bjz_ joined #perl6
09:26 xfix joined #perl6
09:26 rindolf joined #perl6
09:27 clkao joined #perl6
09:32 Woodi hallo today :)
09:33 Woodi just found: Wolfram Language (ex Mathematica ?)  https://www.youtube.com/watch?v=_P9HqHVPeik
09:34 Woodi why that damn thing is not open source ? or at list it's database... :)
09:34 Woodi we should do some perl6 interpreter embaded in SDL "display" window...
09:35 mickcy_ca joined #perl6
09:35 mickcy_ca Has there been any progress on memoization of user subs?
09:36 Woodi also: I think that when someone works with datas separated by \n then using .lines should be first try. not grammar...
09:48 rurban joined #perl6
09:48 Guest46108 joined #perl6
09:49 CurtisOvidPoe Trying to figure out parsing command line args: https://gist.github.com/Ovid/8dda7820aca6aec60124
09:58 mickcy_ca left #perl6
10:01 denis_boyun joined #perl6
10:07 FROGGS_ CurtisOvidPoe: we have the same issue when you put Str in the MAIN's signature, and you pass something that looks like an Int but can happily be a Str (because everything you pass could be)
10:08 CurtisOvidPoe So signature handling isn’t very robust yet?
10:08 FROGGS_ RT #119001
10:08 synopsebot Link: https://rt.perl.org/rt3//Public/Bug/Display.html?id=119001
10:10 rurban1 joined #perl6
10:10 FROGGS_ I think the problem is that when you call a multi sub from P6, the type of the args are pretty clear, and args from your shell get qualified later, and perhaps wrongish
10:10 FROGGS_ and we cannot say that an arg is a Str|Int|Num at the same time
10:11 FROGGS_ so, it is robust but it does not do what you mean
10:11 CurtisOvidPoe FROGGS_: thank you. Working on a P6 talk and I think I might leave the argument handling out then (not sure).
10:11 lue FROGGS_: we could if things like IntStr were implemented :) .
10:12 kjs_ joined #perl6
10:14 FROGGS_ CurtisOvidPoe: that kinda works:
10:14 FROGGS_ -sub MAIN(Real $num where { 0 <= $_ < 1 }, Int :$bits = 32) {
10:14 FROGGS_ +sub MAIN($num as Num where { 0 <= $_ < 1 }, :$bits = 32) {
10:15 FROGGS_ though if you pass something that cannot be turned into a Num:
10:15 FROGGS_ $ perl6-m gistfile1.pl a
10:15 FROGGS_ Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏a' (indicated by ⏏)
10:15 CurtisOvidPoe That at least makes sense :)
10:16 CurtisOvidPoe So, how would I add a “> 0” constraint to $bits and still have a default? Is that possible?
10:19 moritz m: subset Positive of Cool where * > 0; sub with-default(Positive :$bits = 32) { say $bits }; with-defaults; with-defaults bits => '64';
10:19 moritz huh, where's camelia?
10:19 camelia joined #perl6
10:20 moritz m: subset Positive of Cool where * > 0; sub with-default(Positive :$bits = 32) { say $bits }; with-defaults; with-defaults bits => '64';
10:21 moritz $ perl6-m -e 'subset Positive of Cool where * > 0; sub MAIN(Positive :$bits = 32) { say $bits }'
10:21 moritz 32
10:22 camelia rakudo-moar 80b912: OUTPUT«(timeout)»
10:22 moritz m: say 42
10:22 camelia rakudo-moar 80b912: OUTPUT«42␤»
10:22 moritz hthe server has a load of 17
10:23 moritz *the
10:24 FROGGS_ std: sub MAIN($num as Num where { 0 <= $_ < 1 }, Int :$bits is rw where ( $bits ||= 32 > 0 )) { } # does not work in rakudo
10:24 camelia std f9b7f55: OUTPUT«[31m===[0mSORRY![31m===[0m�Unable to parse signature at /tmp/Oq63vY_n20 line 1:�------> [32msub MAIN[33m�[31m($num as Num where { 0 <= $_ < 1 }, Int [0m�Couldn't find final ')'; gave up at /tmp/Oq63vY_n20 line 1:�------> [32msub MAIN($num [33m…»
10:25 CurtisOvidPoe Why would I use Cool instead of Int?
10:25 CurtisOvidPoe Oh, I guess that was just an example.
10:25 moritz CurtisOvidPoe: I was unsure how well MAIN coerces types automatically
10:25 moritz CurtisOvidPoe: but it seems Int also works here
10:28 mvuets joined #perl6
10:28 FROGGS_ std: sub MAIN ($num as Num) { } # is std broken?
10:28 camelia std f9b7f55: OUTPUT«[31m===[0mSORRY![31m===[0m�Unable to parse signature at /tmp/dRrjFPStyS line 1:�------> [32msub MAIN [33m�[31m($num as Num) { } # is std broken?[0m�Couldn't find final ')'; gave up at /tmp/dRrjFPStyS line 1:�------> [32msub MAIN ($num [33m�…»
10:28 CurtisOvidPoe Thanks! That works great. Also, what’s the difference between using * and $_ in a subtype?
10:29 FROGGS_ $_ can be used in a block as a closure, and * in a ( ) makes a closure for you
10:29 FROGGS_ m: say <a b c>.grep(* eq 'b')
10:29 camelia rakudo-moar 80b912: OUTPUT«b␤»
10:29 FROGGS_ m: say <a b c>.grep({$_ eq 'b'}) # it turns into that
10:29 camelia rakudo-moar 80b912: OUTPUT«b␤»
10:31 CurtisOvidPoe So in the subset moritz wrote, the () was implicit?
10:32 FROGGS_ I think so
10:32 FROGGS_ well, the ( ) is needed for invoking the grep... it is not needed per se
10:33 FROGGS_ m: say * * 42
10:33 camelia rakudo-moar 80b912: OUTPUT«WhateverCode.new()␤»
10:34 FROGGS_ m: my &foo = * * 42; say foo 11
10:34 camelia rakudo-moar 80b912: OUTPUT«462␤»
10:34 mvuets m: say (* * *)(2, 3)
10:34 camelia rakudo-moar 80b912: OUTPUT«6␤»
10:35 FROGGS_ aye, there you need the parens for parsing * * * as a statement of its own
10:35 moritz CurtisOvidPoe: the * is just a short way to write a closure, where the * stands for a parameter
10:35 moritz CurtisOvidPoe: so * > 0 is basically the same as  { $_ > 0 } or -> $x { $x > 0 }
10:36 FROGGS_ or { $^a > 0 }
10:36 CurtisOvidPoe Thanks all :)
10:36 FROGGS_ pleasure :o)
10:38 CurtisOvidPoe Trying to write a Perl 6 talk for FOSDEM showing that Perl 6 is easy to use and safer than most dynamic languages. Mostly this seems true, but some implementation gotchas are tripping me up.
10:39 moritz CurtisOvidPoe: please report them (rakudobug@perl.org) so that we have a chance to fix them
10:39 moritz :q
10:39 * hugme hugs moritz, good vi(m) user!
10:40 moritz EWRONGWINDOW
10:40 CurtisOvidPoe Just want to touch base here, first, to make sure I’m not being an idiot :)
10:40 CurtisOvidPoe And it looks like the command line issue is already known.
10:40 moritz that's fine too
10:41 FROGGS_ to be fair, the 'as Type' trait seems a pretty sane way to do it
10:41 CurtisOvidPoe Is there a difference between “Num $foo” and “$foo as Num”?
10:42 FROGGS_ m: sub foo($a as Num) { }; sub foo(Str $s) { }; say foo("bar")
10:42 camelia rakudo-moar 80b912: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/ZuvzzEOrq5â�¤Redeclaration of routine fooâ�¤at /tmp/ZuvzzEOrq5:1â�¤------> [32m foo($a as Num) { }; sub foo(Str $s) { }[33mâ��[31m; say foo("bar")[0mâ�¤    expecting any of:â�¤        horizontal…»
10:42 FROGGS_ m: multi foo($a as Num) { }; multi foo(Str $s) { }; say foo("bar")
10:42 camelia rakudo-moar 80b912: OUTPUT«Nil␤»
10:42 FROGGS_ hmmm
10:43 FROGGS_ ahh, it is fine in this case because the second foo is preferred over the first with the implicit Any
10:44 FROGGS_ Num $foo will really only be considered if you pass something that is Num (or something that has Num as a parent)...
10:45 FROGGS_ $foo as Num really is 'Any $foo as Num', so depending on your other multi candidates the 'Any' will matter
10:46 FROGGS_ I'm not sure I can come up with a good example though
10:46 moritz CurtisOvidPoe: 'as Num' is a coercion (and deprecated in favor for a syntax not yet impelemented), 'Num $x' is a type constraint
10:46 CurtisOvidPoe Thank you.
10:47 pnu NativeCall test is failing [ http://testers.perl6.org/report/recent/5100 ] So... just adding a whitespace is the correct fix? https://github.com/pnu/zavolaj/commit/f8f4e1b18ad54217d548f61fe18fcee32dda2738 .. broken since a recent change in Grammar. Sorry, I'm just guessing the syntax to get my tests run ok. ;-)
10:47 moritz the new thing is  sub foo(Any(Num) $x) { } where Any is the type that is accpeted, and Num the type being coerced to
10:49 CurtisOvidPoe Why is “as Num” being deprecated. I thought that syntax was there for a long time. The Any(Num) $x seems strange
10:49 CurtisOvidPoe (At least to me)
10:50 moritz CurtisOvidPoe: the Any(Num) exposes coercions as first-class objects (at least that's the reason I can remember)
10:55 Alula joined #perl6
10:56 camelia joined #perl6
11:01 dakkar joined #perl6
11:02 psch joined #perl6
11:02 psch hi #perl6 \o
11:04 moritz \p psch
11:05 moritz pnu: yes, I think that fix is correct
11:06 moritz .tell nine I've moved the camelia.service to camelia@.service (template) and have started two instances, one for freenode, one for magnet
11:06 yoleaux moritz: I'll pass your message to nine.
11:07 dakkar what's the idiomatic way to import a sub across packages? package One { our sub foo {...} }; package Two { our sub foo(|x) { One::foo(|x) } } ?
11:07 spider-mario joined #perl6
11:07 dakkar or something with binding?
11:07 moritz m: package One { sub foo is export { } }; import One; foo()
11:08 camelia rakudo-moar 80b912: ( no output )
11:08 dakkar yes
11:08 dakkar I may have written my question badly
11:08 moritz m: module A { our sub b { say 42 } }; constant &alias = &A::b; alias()
11:08 camelia rakudo-moar 80b912: OUTPUT«42␤»
11:09 dakkar aha! yes, that's the answer I was looking for
11:09 moritz dakkar: 'our' subs are nearly always unidiomatic in Perl 6
11:09 dakkar hm
11:09 moritz exporting/importing exists, and is lexical, and much sane
11:09 moritz *saner
11:09 moritz and analyzable at compile time
11:09 moritz and more understanble wrt shadowing
11:09 moritz and so on
11:10 dakkar I'm porting a js library, I'd like to keep the function names, and many of them are very short ("header","authorize")
11:10 dakkar they're functions, not methods, there's no state anywhere
11:11 dakkar so I thought of requiring them to be called with the full package name, to make the names non ambiguous
11:13 moritz does it make sense for them to be function in Perl 6 land?
11:15 dakkar what else could they be? class methods? methods on stateless singleton objects?
11:15 dalek zavolaj: f8f4e1b | (Panu Ervamaa)++ | t/08-callbacks.t:
11:15 dalek zavolaj: use whitespace to define subsignature for unpacking
11:15 dalek zavolaj:
11:15 dalek zavolaj: see rakudo/rakudo@dd5687cc9fb96ce175799090675fcb6bdc3dd067
11:15 dalek zavolaj: review: https://github.com/jnthn/zavolaj/commit/f8f4e1b18a
11:15 dalek zavolaj: e102c8e | moritz++ | t/08-callbacks.t:
11:15 dalek zavolaj: Merge pull request #54 from pnu/master
11:15 dalek zavolaj:
11:15 dalek zavolaj: use whitespace to define subsignature for unpacking
11:15 dalek zavolaj: review: https://github.com/jnthn/zavolaj/commit/e102c8e597
11:15 moritz dakkar: class methods, or ordinary methods (if you change the interface a bit)
11:15 psch o/ moritz
11:15 moritz dakkar: though if functions make sense, then by all means, go for functions
11:16 dakkar I'm never sure what the conceptual difference is, between class methods, methods on singletons, and namespaced functions
11:16 dakkar they're all the same thing to me…
11:16 psch m: module Foo { module Bar is export { sub baz { } } }; use Foo; Bar::baz
11:16 camelia rakudo-moar 80b912: OUTPUT«===SORRY!===␤Could not find Foo in any of: /home/camelia/rakudo-inst-1/languages/perl6/lib, /home/camelia/rakudo-inst-1/languages/perl6␤»
11:16 psch m: module Foo { module Bar is export { sub baz { } } }; import Foo; Bar::baz
11:16 camelia rakudo-moar 80b912: OUTPUT«Could not find symbol '&baz'␤  in method <anon> at src/gen/m-CORE.setting:13871␤  in any find_method_fallback at src/gen/m-Metamodel.nqp:2737␤  in any find_method at src/gen/m-Metamodel.nqp:988␤  in block <unit> at /tmp/Ht4cVaH3vl:1␤␤»
11:17 psch oh our of course
11:17 psch m: module Foo { module Bar is export { our sub baz { } } }; import Foo; Bar::baz
11:17 camelia rakudo-moar 80b912: ( no output )
11:17 moritz dakkar: the difference between subs and methods is that methods fall back to parent classes
11:17 moritz m: class A { method x() { 42 }; class B is A { }; B.x
11:17 camelia rakudo-moar 80b912: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/MSmOsJQcc3â�¤Unable to parse expression in block; couldn't find final '}' â�¤at /tmp/MSmOsJQcc3:1â�¤------> [32mmethod x() { 42 }; class B is A { }; B.x[33mâ��[31m<EOL>[0mâ�¤    expecting any of…»
11:17 dakkar yes, obvs
11:18 moritz m: class A { method x() { 42 }; class B is A { }; B.x()
11:18 camelia rakudo-moar 80b912: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/TqwyD6fxsAâ�¤Unable to parse expression in block; couldn't find final '}' â�¤at /tmp/TqwyD6fxsA:1â�¤------> [32mthod x() { 42 }; class B is A { }; B.x()[33mâ��[31m<EOL>[0mâ�¤    expecting any of…»
11:18 * moritz too dumb
11:18 moritz m: class A { method x() { 42 } ]; class B is A { }; B.x()
11:18 camelia rakudo-moar 80b912: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/SlvJexee0uâ�¤Unable to parse expression in block; couldn't find final '}' â�¤at /tmp/SlvJexee0u:1â�¤------> [32mclass A { method x() { 42 } [33mâ��[31m]; class B is A { }; B.x()[0mâ�¤    expecti…»
11:18 moritz m: class A { method x() { 42 } }; class B is A { }; B.x()
11:18 camelia rakudo-moar 80b912: ( no output )
11:19 moritz and the difference between singleton methods and class methods is that in the latter case, the type object it the singleton object
11:19 dakkar when I started porting this thing, to p5, the functions were ported to methods on normal objects, and all dependencies were on default-constructed attributes (i.e. DI all the way)
11:20 dakkar then I realised that this is a cryptographic authentication library
11:20 dakkar I really don't want people swapping the crypto implementation inside my authentication objects
11:20 dakkar not trivially, at least
11:22 virtualsue joined #perl6
11:27 pnu moritz: ok, thanks!
11:27 pnu BTW, I patched Panda::Tester to capture the prove stderr (for the reports posted to testers.perl6.org). Is there a better way to do this: pipe("... 2>&1", :r) ... since that depends on shell etc.
11:27 psch m: sub f { @_[0] = "baz" }; say f "foo"
11:27 camelia rakudo-moar 80b912: OUTPUT«baz␤»
11:28 skids joined #perl6
11:28 psch (that's #71112, fyi)
11:28 synopsebot Link: https://rt.perl.org/rt3//Public/Bug/Display.html?id=71112
11:28 sergot hi o/
11:28 psch o/ sergot
11:28 pnu I couldn't find any documentation about that stderr capture thing, except a comment on S32 .. XXX how to specify "2>&1"?
11:28 sirdancealot joined #perl6
11:36 telex joined #perl6
11:37 moritz pnu: I think everybody wants a better way, and nobody has designed and implemented a better way
11:37 pnu ah, ok. :)
11:43 bjz joined #perl6
11:44 dalek rakudo/nom: e9ea2dc | usev6++ | src/ (2 files):
11:44 dalek rakudo/nom: Add typed exception X::Syntax::AddCategorial::MissingSeparator
11:44 dalek rakudo/nom:
11:44 dalek rakudo/nom: would be used in test for RT #86906
11:44 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/e9ea2dc0c5
11:44 synopsebot Link: https://rt.perl.org/rt3//Public/Bug/Display.html?id=86906
11:44 dalek rakudo/nom: 84ed035 | FROGGS++ | src/ (2 files):
11:44 dalek rakudo/nom: Merge pull request #343 from usev6/nom
11:45 dalek rakudo/nom:
11:45 dalek rakudo/nom: Add typed exception X::Syntax::AddCategorial::MissingSeparator
11:45 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/84ed0358ca
11:51 andreoss joined #perl6
11:54 lue joined #perl6
11:56 jk_ joined #perl6
12:09 rurban1 left #perl6
12:12 virtualsue joined #perl6
12:27 fhelmberger joined #perl6
12:30 bjz joined #perl6
12:30 BenGoldberg joined #perl6
12:48 spider-mario joined #perl6
12:55 Ven joined #perl6
12:58 xfix joined #perl6
13:24 Ven joined #perl6
13:25 [Coke] joined #perl6
13:27 Juerd joined #perl6
13:28 synopsebot joined #perl6
13:29 hugme joined #perl6
13:40 skids joined #perl6
13:56 dalek roast/glr: 0b78b09 | moritz++ | S (6 files):
13:56 dalek roast/glr: start to get rid of Parcel
13:56 dalek roast/glr: review: https://github.com/perl6/roast/commit/0b78b0983e
13:56 dalek roast/glr: 5374215 | moritz++ | S (6 files):
13:56 dalek roast/glr: Remove more mentions of Parcel
13:56 dalek roast/glr: review: https://github.com/perl6/roast/commit/5374215e6a
13:56 kjs_ joined #perl6
13:59 DarthGandalf joined #perl6
14:00 moritz m: say ((1, 2), (3, 4)).elems
14:00 camelia rakudo-moar 80b912: OUTPUT«2␤»
14:00 moritz m: say elems((1, 2), (3, 4))
14:00 camelia rakudo-moar 80b912: OUTPUT«Cannot call 'elems'; none of these signatures match:␤:(Any $a)␤  in block <unit> at /tmp/hcqxIPd_Xu:1␤␤»
14:00 moritz m: say elems ((1, 2), (3, 4))
14:00 camelia rakudo-moar 80b912: OUTPUT«2␤»
14:02 moritz m: say 3.join('|')
14:02 camelia rakudo-moar 80b912: OUTPUT«3␤»
14:04 synopsebot joined #perl6
14:05 hugme joined #perl6
14:07 dalek roast/glr: b92b2f1 | moritz++ | S02-lists/flattening.t:
14:07 dalek roast/glr: Tests for list (non-)flattening
14:07 dalek roast/glr: review: https://github.com/perl6/roast/commit/b92b2f1aea
14:15 FROGGS_ moritz: you are changing the tests according to pmichaud++'s blog post?
14:16 moritz FROGGS_: in a branch, yes
14:16 moritz FROGGS_: at least a few of them :-)
14:16 FROGGS_ were there news about glr recentish?
14:16 moritz no
14:16 dalek DBIish: d9cbfa8 | moritz++ | / (3 files):
14:16 dalek DBIish: Switch from .map to .for
14:16 dalek DBIish:
14:16 dalek DBIish: .map will change its behavior to not flatten, while .for will stay
14:16 dalek DBIish: as it is now. See http://pmthium.com/2014/10/apw2014/ for reference
14:16 dalek DBIish: review: https://github.com/perl6/DBIish/commit/d9cbfa86ed
14:16 FROGGS_ k
14:17 moritz .ask pmichaud if there's anything I can do to help get the GLR started?
14:17 yoleaux moritz: I'll pass your message to pmichaud.
14:18 colomon moritz++: big patch there for ABC!
14:18 moritz colomon: just the result of  git grep -l '\.map' | xargs perl -i -pe 's/\.map/.for/g'
14:18 moritz ... + review
14:18 colomon how long has .for been working?
14:20 moritz colomon: a few months; checking...
14:20 moritz 2014-10-25
14:21 colomon oooo, I think I can use the patch then!
14:21 * colomon will be very happy when rakudo's pre-comp issues are fixed
14:30 colomon merged and functional.  moritz++
14:45 raiph joined #perl6
14:45 dalek rakudo/nom: 7104f00 | moritz++ | src/core/Range.pm:
14:45 dalek rakudo/nom: Add eqv operator for ranges
14:45 dalek rakudo/nom:
14:45 dalek rakudo/nom: previously, eqv of two ranges fell back to reifying the ranges,
14:45 dalek rakudo/nom: which could be rather big waste of resources
14:45 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/7104f00f99
14:46 psch argh
14:46 kjs_ joined #perl6
14:46 psch i have a case of "it works with debug output" in P6Regex :/
14:47 psch ohh
14:47 psch no
14:47 psch i have a stupid instead :)
14:53 kaare_ joined #perl6
14:58 [Coke] .u ¬
14:58 yoleaux U+00AC NOT SIGN [Sm] (¬)
15:00 lizmat ,ask jnthn what's the difference between nqp::queuepoll($!queue) and nqp::atpos($!queue,0) ?
15:00 lizmat .ask jnthn what's the difference between nqp::queuepoll($!queue) and nqp::atpos($!queue,0) ?
15:00 yoleaux lizmat: I'll pass your message to jnthn.
15:01 kjs_ joined #perl6
15:02 colomon m: my $a = ""; $a .= "hello"
15:02 camelia rakudo-moar 80b912: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/gpkuNf8Gxi�Quoted method name requires parenthesized arguments. If you meant to concatenate two strings, use '~'.�at /tmp/gpkuNf8Gxi:1�------> [32mmy $a = ""; $a .= "hello"[33m�[31m<EOL>…»
15:02 colomon m: my $a = ""; $a .= "N"
15:02 camelia rakudo-moar 80b912: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/J64KjNHb6M�Quoted method name requires parenthesized arguments. If you meant to concatenate two strings, use '~'.�at /tmp/J64KjNHb6M:1�------> [32mmy $a = ""; $a .= "N"[33m�[31m<EOL>[0m�»
15:02 colomon huh.  not getting that error message in my code.
15:02 colomon oh well, at least I figured out the problem.
15:03 lizmat m: my $a = ""; $a .= "hello"()   # just curious
15:03 camelia rakudo-moar 80b912: OUTPUT«No such method '' for invocant of type 'Str'␤  in method dispatch:<.=> at src/gen/m-CORE.setting:1322␤  in block <unit> at /tmp/wcmIPMGnEf:1␤␤»
15:03 moritz shouldn't it complain about method 'hello' not existing?
15:03 moritz m: my $a = 'ab'; $a .= 'uc'(); say $a
15:03 camelia rakudo-moar 80b912: OUTPUT«No such method '' for invocant of type 'Str'␤  in method dispatch:<.=> at src/gen/m-CORE.setting:1322␤  in block <unit> at /tmp/emkubaseXS:1␤␤»
15:04 moritz this looks rather broken to me
15:04 colomon that's closer to the error I was getting
15:07 moritz p: my $a = 'ab'; $a .= 'uc'(); say $a
15:07 camelia rakudo-parrot 80b912: OUTPUT«No such method '' for invocant of type 'Str'␤  in method dispatch:<.=> at gen/parrot/CORE.setting:1325␤  in block <unit> at /tmp/FMjhQM0mZV:1␤␤»
15:07 lizmat .tell jnthn please ignore: at_pos blocks, queuepoll doesn't
15:07 yoleaux lizmat: I'll pass your message to jnthn.
15:13 * lizmat just noticed mixed usage of "multi sub" vs "multi" in the settings
15:13 lizmat fwiw, I would prefer "multi sub" for easier greppability
15:18 * moritz too
15:21 colomon +1
15:22 * lizmat will then do so in a mo
15:22 zakharyas joined #perl6
15:24 kjs_ joined #perl6
15:28 rindolf joined #perl6
15:28 dalek rakudo/nom: 5fe1f4d | lizmat++ | src/core/Channel.pm:
15:28 dalek rakudo/nom: Change unlimited map back to a gather/take
15:28 dalek rakudo/nom:
15:28 dalek rakudo/nom: Should be the same with less overhead
15:28 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/5fe1f4de0f
15:34 kjs_ joined #perl6
15:38 moritz huh? I always thought map had less overhead than gather/take?
15:39 nwc10 to the batmobile^Wprofiler?
15:40 mr-foobar joined #perl6
15:42 lizmat moritz: that was an unlimited map, as in (1..Inf).map(&code)
15:42 lumimies What does the * in 'earliest { more *' mean?
15:43 lizmat whatever, as in any queue
15:43 integral joined #perl6
15:43 integral joined #perl6
15:48 lizmat moritz: is there a difference between 'my &foo := -> | { ... }' and 'sub foo(|) {...}'  ?
15:49 lizmat I can't think of any, so wonder why that idiom is used in the setting
15:49 TimToady Block vs Routine
15:50 lizmat aha...  hmmm... performance reasons, or "return" behaviour ?
15:50 TimToady or possibly immutable vs wrappable
15:50 lizmat I see that 'take' on the JVM is implemented as a my &foo ->, and as a sub anywhere else
15:51 lizmat hmmm... maybe related to #122732
15:51 synopsebot Link: https://rt.perl.org/rt3//Public/Bug/Display.html?id=122732
15:52 lizmat ok, won't touch that then
16:00 TimToady CurtisOvidPoe: coercion is not really what we're aiming for with the command line in any case; instead, we want certain kinds of text (such as command line arguments) to automatically become allomorphic
16:01 TimToady basically, anywhere you're forced to represent numbers as text, we'd assume it might be either of those that you intend
16:01 CurtisOvidPoe @TimToady: OK, thanks for the clarification!
16:01 TimToady so instead of always coming in as Str, you might get an IntStr, or a RatStr, or a NumStr
16:01 TimToady or even a ComplexStr
16:02 TimToady so this applies not just to command-line args, but also to what you get from a prompt, or what you get from < 1 2.3 22/3 foo >
16:03 TimToady with the weights set up such that an IntStr would prefer to dispatch to an Int, but can act like a Str at need, and reproduce the original string
16:04 CurtisOvidPoe Just to be clear, that won’t result in cases where “7apples” +1 gives 8, will it?
16:05 TimToady and there's supposed to be a val() function that produces these things
16:05 TimToady no, that's still an error
16:05 CurtisOvidPoe Cool!
16:06 TimToady n: .WHAT.say for < 1 2.3 1+2i foo >
16:06 camelia niecza v24-109-g48a8de3: OUTPUT«(IntStr)␤(RatStr)␤(ComplexStr)␤(Str)␤»
16:06 TimToady niecza implements this already
16:06 TimToady n: .WHAT.say for < 1 2.3 1+2i foo 7apples >
16:06 camelia niecza v24-109-g48a8de3: OUTPUT«(IntStr)␤(RatStr)␤(ComplexStr)␤(Str)␤(Str)␤»
16:15 pnu moritz: thanks, Task::Star tests run now without failures .. full panda smoke log still gives 20 references to "Shape declaration with () is reserved".. I'll try to hunt them down, at least for cases where that is the only error.
16:21 psch m: say "Ab" ~~ /A :i B/ # RT #77064
16:21 synopsebot Link: https://rt.perl.org/rt3//Public/Bug/Display.html?id=77064
16:21 camelia rakudo-moar 80b912: OUTPUT«Nil␤»
16:22 psch what i have found out is that Regex.subtype gets lost somewhere
16:22 psch i'm not sure if it's in P6Regex.termish or in qbuildsub though
16:22 psch TimToady: do you have a hint re that? ^^^
16:23 TimToady dunno offhand
16:23 TimToady definitely looks like a bug though
16:24 moritz I wonder if it's some literal optimization
16:24 psch n: say "Ab" ~~ /A :i B/ # RT #77064
16:24 synopsebot Link: https://rt.perl.org/rt3//Public/Bug/Display.html?id=77064
16:24 camelia niecza v24-109-g48a8de3: OUTPUT«「Ab」␤␤»
16:24 psch moritz: i'd think so.  concat is involved
16:24 moritz m: say 'Ab' ~~ /[A|A] :i [B|B]/
16:24 camelia rakudo-moar 80b912: OUTPUT«「Ab」␤␤»
16:24 psch m: say "Ab" ~~ /A [:i B]/ # works too
16:24 camelia rakudo-moar 80b912: OUTPUT«「Ab」␤␤»
16:24 TimToady probably a scoping issue with %*RX or some such
16:25 psch from what i can see, :i alone doesn't produce a Regex.node
16:25 psch err, QAST::Regex that is
16:25 psch TimToady: i don't think so, dumping %*RX<i> looks as it should
16:26 TimToady well, have the apppriate amount of fun :D
16:27 TimToady *pprop
16:28 psch right :)
16:28 moritz yes, it creates an QAST::Regex(:rxtype<scan>) with child 'AB'
16:28 TimToady oh, the literal concat optimization is ignoring :i I guess
16:29 TimToady you can't really concat if there's a policy shift in the middle
16:29 TimToady moritz: but you said that already :)
16:30 moritz $ ./nqp-m -e 'say("Ab" ~~ /A :i B/)'
16:30 moritz Substring length (-3) cannot be negative
16:30 TimToady psch: and so did you
16:30 TimToady TimToady: go get some more coffee...
16:33 dalek rakudo/nom: 310efb2 | lizmat++ | src/core/ (24 files):
16:33 dalek rakudo/nom: multi -> multi sub for easier grep/ackability
16:33 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/310efb2e8e
16:36 moritz ok, the bug is in NQP too
16:41 moritz and I can't seem to find the code that does the concat optimization :(
16:41 dalek nqp: 614f229 | moritz++ | src/QRegex/P6Regex/Actions.nqp:
16:41 dalek nqp: Fix indention
16:41 dalek nqp: review: https://github.com/perl6/nqp/commit/614f22948d
16:42 davido_ joined #perl6
16:43 moritz and the code that adds the literal to the nqp::scan opcode already gets the wrong one
16:48 psch moritz: method atom adds the correct subtype, that much i could find out
16:49 psch nevermind that, i just checked if %*RX<i> is set there
16:49 psch at least that's what my current code does, i've lost track a bit the last few moments
16:51 psch anyway, gtg.  will have another look later though, if neccessary o/
16:52 TimToady oh, lue++ for pointing out the IntStr in the backlog already
16:57 ptc_p6 joined #perl6
16:58 TimToady moritz: the coercion syntax is Num(Any), not Any(Num).  it looks just like a normal Num($x) coercion, except you put the incoming type inside instead of the incoming data
16:58 moritz TimToady: I guess I'll only start remembering it when I can use it
16:59 TimToady or another way to think of it is that the type outside the parens is the actual type of the variable
16:59 TimToady my Num() $x = $stuff;
16:59 TimToady $x is really a Num, not a Cool or Any
17:00 TimToady the parens say "oh, btw, I'll also accept this type", which is why it makes sense to default to something like Any or Cool
17:01 * TimToady doesn't remember offhand which we picked
17:02 dalek rakudo/nom: 63875df | lizmat++ | src/core/ (73 files):
17:02 dalek rakudo/nom: Remove trailing whitespace
17:02 dalek rakudo/nom:
17:02 dalek rakudo/nom: Clean with git diff --ignore-space-at-eol
17:02 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/63875dfaa2
17:02 TimToady I guess we picked Any
17:02 TimToady on the assumption that the user might define a coercion that goes from Any to MyType
17:03 TimToady and we already coerce Cool in a lot of places implicitly, though not in binding
17:03 moritz ok, I have a fix for the regex concat bug
17:04 TimToady \o/
17:05 lizmat hmmm....Inline::Perl5 no longer builds
17:05 lizmat Shape declaration with () is reserved;
17:06 FROGGS_ also missing whitespace?
17:06 moritz probably
17:06 moritz I have a commit bit, so should be able to fix pretty quickly
17:06 TimToady likelier than a missing colon, since that is NYI
17:07 lizmat &free_p6_object⏏(Int))  # so yes, I think missing whitespace?
17:07 FROGGS_ std: sub MAIN ($num as Num) { }
17:07 camelia std f9b7f55: OUTPUT«[31m===[0mSORRY![31m===[0m�Unable to parse signature at /tmp/fHMnzEQDuK line 1:�------> [32msub MAIN [33m�[31m($num as Num) { }[0m�Couldn't find final ')'; gave up at /tmp/fHMnzEQDuK line 1:�------> [32msub MAIN ($num [33m�[31mas Num) { }[…»
17:07 FROGGS_ TimToady: is that known to fail?
17:07 TimToady that one would be a :(Int)
17:07 FROGGS_ or... does std already know the new syntax?
17:07 moritz FROGGS_: the 'as' coercion syntax is deprecated
17:07 lizmat m: sub foo {}; &foo(Int)
17:07 camelia rakudo-moar 80b912: OUTPUT«Too many positionals passed; expected 0 arguments but got 1␤  in sub foo at /tmp/O_0BShoJ0q:1␤  in block <unit> at /tmp/O_0BShoJ0q:1␤␤»
17:07 moritz std: sub f(Int(Any) $x) { }
17:07 camelia std f9b7f55: OUTPUT«Potential difficulties:â�¤  $x is declared but not used at /tmp/JE5pkfa9MG line 1:â�¤------> [32msub f(Int(Any) [33mâ��[31m$x) { }[0mâ�¤ok 00:00 139mâ�¤Â»
17:07 FROGGS_ ahh, now I understand
17:08 lizmat m: sub foo {}; &foo (Int)
17:08 camelia rakudo-moar 80b912: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/1EEEeMOq3wâ�¤Two terms in a rowâ�¤at /tmp/1EEEeMOq3w:1â�¤------> [32msub foo {}; &foo [33mâ��[31m(Int)[0mâ�¤    expecting any of:â�¤        infix stopperâ�¤        infix or meta-infixâ�¤        â€¦Â»
17:08 TimToady that one wahts &foo:(Int)
17:08 TimToady *n
17:08 dalek nqp: b924e93 | moritz++ | / (2 files):
17:08 dalek nqp: Fix over-eager regex concat optimization
17:08 dalek nqp: review: https://github.com/perl6/nqp/commit/b924e932e2
17:08 TimToady oh, depends on what you mean
17:09 TimToady if you really want to call &foo, the &foo(Int)
17:09 TimToady but that syntax is reserved in a signature now
17:09 lizmat I was just pasting the place of the error in Inline::Perl5
17:09 moritz uhm, Inline-Perl5 passes all tests there
17:09 moritz *here
17:10 lizmat with latest rakudo ?
17:10 moritz This is perl6 version 2014.12-46-g7fca945 built on MoarVM version 2014.12
17:10 moritz too old?
17:10 moritz seems we are at 60
17:10 lizmat 2014.12-60-g7104f00 b
17:10 lizmat yup
17:11 lizmat and that change was done by TimToady like yesterday ?
17:11 lizmat dd5687cc9fb96ce175799090675fcb6bdc3dd067 if I'm not mistaken ?
17:11 moritz ok, rebootstrapping
17:13 * TimToady intentionally broke the omelette eggs last night because &foo(stuff) is terribly ambiguous in a signature
17:14 moritz just adding the colon breaks stuff :(
17:14 moritz Type check failed in binding $sig; expected 'Signature' but got 'Any'
17:14 TimToady if it was a subsignture, you want space instead
17:15 moritz it was meant as a type declaration of a callback
17:15 TimToady then it should be :, and we should fix it if it's busted
17:16 moritz then I fixed nativecall incorrectly
17:16 moritz (added spaces)
17:17 moritz but when I fix it, I get the same error
17:18 TimToady m: sub foo (&bar:(Int)) { say bar(-42) }; sub baz(Int $i) { abs $i }; foo(&baz)
17:18 camelia rakudo-moar 80b912: OUTPUT«42␤»
17:18 TimToady seems to work here
17:19 TimToady m: sub foo (&bar(Int)) { say bar(-42) }; sub baz(Int $i) { abs $i }; foo(&baz)
17:19 camelia rakudo-moar 80b912: OUTPUT«Too few positionals passed; expected 1 argument but got 0 in sub-signature of parameter &bar␤  in sub foo at /tmp/1NYvUYnMkh:1␤  in block <unit> at /tmp/1NYvUYnMkh:1␤␤»
17:19 moritz TimToady: NativeCall.pm6 explicitly checks for subsignatures
17:19 moritz my $info := param_list_for($p.sub_signature, :with-typeobj)
17:19 moritz how do I access the : thingy?
17:21 TimToady m: sub foo (&bar(Int $i)) { say bar(-42) }; sub baz(Int $i) { abs $i }; foo(&baz)
17:21 camelia rakudo-moar 80b912: OUTPUT«Too few positionals passed; expected 1 argument but got 0 in sub-signature of parameter &bar␤  in sub foo at /tmp/Z8exoseBcu:1␤  in block <unit> at /tmp/Z8exoseBcu:1␤␤»
17:21 TimToady I guess camelia is still the old version
17:22 moritz yes, it's old
17:22 moritz does the : thingy compile to a subset constraint?
17:23 TimToady it should be considered part of the longname for parsing purposes
17:23 moritz because that's not introspectable
17:23 moritz nativecall needs to introspect the thing to find out how to compile the callback
17:24 moritz and that works for subsignatures, but not for cod-y type constraints
17:25 andreoss joined #perl6
17:26 andreoss i wanna do something like my @x := [1, @x]
17:26 andreoss how is it done?
17:27 moritz @x.unshift: 1
17:27 moritz @x = 1, @x
17:27 TimToady maybe andreoss is asking for a recursive structure
17:27 moritz unless you want something else, in which case you should say verbally what you want
17:28 moritz for something recursive, you must take care that @x on the RHS doesn't get flattened out, so [1, $@x]
17:29 TimToady or do something like: @x[1] := @x;
17:30 TimToady but note that .perl doesn't handle recursion yet
17:30 andreoss moritz: in haskell ones = 1 : ones is called a list, no special name
17:31 TimToady m: constant foo = 1, foo;  # supposed to work, but doesn't yet
17:31 geekosaur haskell is lazy by default; perl 6 isn't
17:31 camelia rakudo-moar 80b912: OUTPUT«===SORRY!===␤Cannot invoke null object␤»
17:32 TimToady perl6 lists are lazy by default
17:33 TimToady hopefully this is one of the things that gets fixed in the GLR
17:33 TimToady the pseudo-assignment of a constant needs to be definitional, not operational
17:34 moritz andreoss: constant ones = 1 xx *;
17:34 TimToady that's not really the point :P
17:35 TimToady we ought to be able to use this for hamming numbers
17:35 moritz my point is to Perl 6 tools for solutions in Perl 6 space
17:35 moritz and that's usually the series operator for these kinds of problems
17:35 moritz but in this case, xx is enough
17:39 TimToady constant hamming = 1, squish hamming »*» 2 M hamming »*» 3 M hamming »*» 5;
17:39 TimToady assuming M is a suitably defined merge infix
17:40 TimToady well, except hypers are eager, oops
17:40 TimToady so instead:
17:41 TimToady constant hamming = 1, squish (hamming X* 2) M (hamming X* 3) M (hamming X* 5);
17:42 moritz m: say squish 1, 2, 3
17:42 camelia rakudo-moar 80b912: OUTPUT«1 2 3␤»
17:42 moritz m: say squish 1, 2, 3, 1
17:42 camelia rakudo-moar 80b912: OUTPUT«1 2 3 1␤»
17:42 moritz m: say squish 1, 2, 3, 1, 1
17:42 camelia rakudo-moar 80b912: OUTPUT«1 2 3 1␤»
17:43 TimToady where "suitably define" means monotonic, but not strictly so
17:44 TimToady so squish is sufficient to remove dups
17:45 TimToady but our list implementation is assuming it already knows the length of the list somewhere where it shouldn't be assuming that
17:46 TimToady one of those introspection-is-wrong things, probably, rather than just asking for the next value
17:46 TimToady or it's cloning something that shouldn't be cloned
17:46 TimToady or it's cloning it without maintaining the lazy bits correctly
17:50 * TimToady goes back to thinking about callback sigs
17:51 TimToady stealing the subsig syntax for callback sigs is kind of wrongish, since we could conceiably have a type that is both Callable and Positional
17:53 TimToady m: say &foo:(Int)
17:53 camelia rakudo-moar 80b912: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/KjZdU7aras�You can't adverb that�at /tmp/KjZdU7aras:1�------> [32msay &foo:(Int)[33m�[31m<EOL>[0m�»
17:53 TimToady n: say &foo:(Int)
17:53 camelia niecza v24-109-g48a8de3: OUTPUT«[31m===[0mSORRY![31m===[0m��Action method fakesignature not yet implemented at /tmp/sPu5elhHbg line 1:�------> [32msay &foo:(Int[33m�[31m)[0m��Action method sigterm not yet implemented at /tmp/sPu5elhHbg line 1 (EOF):�------> [3…»
17:55 andreoss joined #perl6
17:56 TimToady so I guess it parses under the fakesignature rule
17:56 TimToady we "just" need to copy that out into the function's attributions somehow
17:57 TimToady well, it wants to be considered part of the function type, really
17:58 TimToady and NativeCall wants to be introspecting the function type, not the signature
17:59 TimToady though as a temporary expedient we could poke the fakesignature into the subsig till we can do it right
18:03 dalek rakudo/nom: 31210cb | lizmat++ | src/core/CompUnitRepo/Locally.pm:
18:03 dalek rakudo/nom: Add path-spec convenience method
18:03 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/31210cb7ab
18:05 fhelmberger joined #perl6
18:06 Ven joined #perl6
18:07 andreoss http://paste.fedoraproject.org/164354/96280614
18:07 andreoss is it possible to run this function on infinite list?
18:08 andreoss when |@x is applied as argument a list is eagerly evaluated ?
18:10 dalek perl6-roast-data: b7c8336 | coke++ | / (5 files):
18:10 dalek perl6-roast-data: today (automated commit)
18:10 dalek perl6-roast-data: review: https://github.com/coke/perl6-roast-data/commit/b7c8336ef3
18:10 [Coke] looks like moar-jit died on osx today.
18:11 dalek rakudo/nom: f283710 | TimToady++ | src/Perl6/Grammar.nqp:
18:11 dalek rakudo/nom: allow &foo:(Int) param to parse as subsig for now
18:11 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/f283710889
18:11 TimToady moritz: ^^^ temporary workaround if we add colon
18:12 [Coke] re-running the build to see what failed.
18:12 Mso150 joined #perl6
18:13 andreoss m: sub foo(*@x) {@x[^3].perl.say}; my @x := 1...*; foo(|@x);
18:13 camelia rakudo-moar 80b912: OUTPUT«()␤»
18:14 hagiri joined #perl6
18:16 andreoss m: my @x := 1...*; say(|@x);
18:16 camelia rakudo-moar 80b912: OUTPUT«␤»
18:16 sqirrel_ joined #perl6
18:16 TimToady btw, this is perhaps a good argument to include NativeCall with the compiler, so we can test it in roast
18:17 dg joined #perl6
18:17 TimToady m: say 1...*
18:17 camelia rakudo-moar 80b912: OUTPUT«1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 8…»
18:18 TimToady andreoss: looks like a bug
18:18 dg joined #perl6
18:18 andreoss TimToady: what if i want to pass a lazy list (possibly infinite) as a list of argument to function?
18:19 TimToady if NativeCall had been in roast, I wouldn't have made that omelette last night in quite that way
18:19 TimToady andreoss: it's supposed to work
18:19 TimToady I don't know why it didn't
18:20 TimToady n: my @x := 1...*; say(|@x);
18:20 TimToady probably too eager...
18:20 camelia niecza v24-109-g48a8de3: OUTPUT«(signal SEGV)»
18:20 TimToady yeah
18:20 lizmat so what would be a reason not to include NativeCall in core ?
18:20 lue joined #perl6
18:22 [Coke] "I never use it, why is it bundled?"
18:22 TimToady might make it easier to have a POSIX module in core...
18:24 TimToady if that's an argument for, rather than against :)
18:25 CurtisOvidPoe Night all …
18:25 TimToady o/
18:25 CurtisOvidPoe And thanks for the help!
18:26 TimToady m: sub foo(*@stuff) { say @stuff }; my @x := 1...*; foo(|@x)
18:26 camelia rakudo-moar 80b912: OUTPUT«␤»
18:26 TimToady m: sub foo(*@stuff) { say @stuff }; my @x := 1...*; foo(@x)
18:26 camelia rakudo-moar 80b912: OUTPUT«1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 8…»
18:26 TimToady m: my @x := 1...*; say(@x);
18:26 camelia rakudo-moar 80b912: OUTPUT«1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 8…»
18:26 TimToady andreoss: I guess the short answer is: don't use | there
18:27 TimToady m: sub foo(@stuff) { say @stuff }; my @x := 1...*; foo(@x)
18:27 camelia rakudo-moar 80b912: OUTPUT«1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 8…»
18:27 TimToady works with or without the *
18:27 TimToady but | gives up on infinite lists, I guess
18:28 TimToady since parcels are defined to be finite, at least until the GLR
18:28 hagiri joined #perl6
18:30 kjs_ joined #perl6
18:32 adu joined #perl6
18:33 denis_boyun_ joined #perl6
18:34 andreoss m: my @x; @x <== 1...*; say @x.perl;
18:34 camelia rakudo-moar 80b912: OUTPUT«Array.new()␤»
18:34 andreoss m: my @x; @x <== 1...10; say @x.perl;
18:34 camelia rakudo-moar 80b912: OUTPUT«Array.new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)␤»
18:35 andreoss same problem i guess?
18:35 TimToady yes, .perl is going to give up on an infinite list
18:35 TimToady .gist, on the other hand, gives up after 100 elements
18:36 TimToady m: my @x; @x <== 1...*; say @x
18:36 camelia rakudo-moar 80b912: OUTPUT«␤»
18:36 TimToady hmm, or maybe something else is going on
18:36 TimToady m: my @x <== 1...*; say @x
18:36 camelia rakudo-moar 80b912: OUTPUT«␤»
18:36 TimToady m: my @x <== 1...*; say @x.elems
18:36 camelia rakudo-moar 80b912: OUTPUT«0␤»
18:37 TimToady m: my @x <== 1..*; say @x.elems
18:37 camelia rakudo-moar 80b912: OUTPUT«0␤»
18:37 TimToady m: my @x <== 1..*; say @x[10]
18:37 camelia rakudo-moar 80b912: OUTPUT«(Any)␤»
18:37 TimToady bug maybe
18:37 xfix joined #perl6
18:38 TimToady m: my @x <== flat 1..*; say @x[10]
18:38 camelia rakudo-moar 80b912: OUTPUT«(Any)␤»
18:38 TimToady m: 1...* ==> my @x; say @x[10]
18:38 camelia rakudo-moar 80b912: OUTPUT«(Any)␤»
18:38 [Coke] moar failure is not reproducable. annoynig.
18:38 TimToady m: 1,2,3,4,5,6,7,8,9,10,11,12 ==> my @x; say @x[10]
18:38 camelia rakudo-moar 80b912: OUTPUT«11␤»
18:38 nwc10 [Coke]: what failed for you (once)?
18:39 TimToady m: 1..100 ==> my @x; say @x[10]
18:39 camelia rakudo-moar 80b912: OUTPUT«11␤»
18:39 TimToady looks like ==> is giving up on infinite too
18:40 * TimToady suspects that .gimme started returning 0 instead of Inf at some point, because something similar happened to infinite slices
18:41 raydiak is anyone able to test io::socket::ssl on a recent rakudo under linux? reported a test failure, but sergot can't reproduce it, and I want to make sure it's not just me before I waste more of his time
18:42 raydiak looks like the only cpandatesters run for it since 2014.10, was OS X
18:43 raydiak ( and g'mornin #perl6 o/ )
18:46 dylanwh joined #perl6
18:47 japhb Anyone know what's the current state of the GLR?  I haven't seen any obviously relevant commits, so I'm guessing either the work is happening in a private branch/fork, or it's still in design.
18:47 lizmat japhb: only pmichaud can tell, really, afaik
18:49 * lizmat suppresses the joke about 'which Thanksgiving?'
18:51 dalek rakudo/nom: 68987f5 | lizmat++ | src/core/CompUnitRepo.pm:
18:51 dalek rakudo/nom: Fix bug in PARSE-INCLUDE-SPEC
18:51 dalek rakudo/nom:
18:51 dalek rakudo/nom: For some reason, the $class was pass by reference instead of value.  Which
18:51 dalek rakudo/nom: caused all of the entries to have the final class found, not the actual class
18:51 dalek rakudo/nom: active at the moment of pushing.  Not sure if this is a bug in general, a bug
18:51 dalek rakudo/nom: in the setting, or a bug in my head.
18:51 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/68987f5bcf
18:51 lizmat dinner&
18:54 mvuets joined #perl6
18:57 [Coke] nwc10: perl6-m didn't build with jit enabled. rebuild in same dir worked fine.
19:05 FROGGS[tab] joined #perl6
19:07 FROGGS[tab] b2gills: re v5: I'll fix it soon, thank you :o)
19:09 moritz j
19:09 moritz japhb: I've done some test reworkings in roast in a branch
19:10 sirdancealot joined #perl6
19:20 moritz and I'd love to contribute some code too, but I don't think I can get very far without guidance from pmichaud++
19:20 moritz I mean, I can start making .map not flatten, and some other routines too, but I guess I'll break much more in the process without any real benefit
19:21 hoelzro o/ #perl6
19:21 moritz \o hoelzro
19:22 colomon o/
19:23 dakkar joined #perl6
19:24 hoelzro is there a way to get the integer FD associated with an IO::Socket?
19:25 nwc10 [Coke]: Oh, odd. I've never seen that.
19:25 nwc10 how frustrating
19:25 moritz hoelzro: I'm not sure, but iirc the HTTP::UserAgent-module also needed that for SSL
19:26 hoelzro moritz: ok, I'll have a look
19:27 hoelzro hmm...from first glance it just uses the host/port combination and supplies it to IO::Socket::SSL
19:28 moritz ok, changing .map to not flattening is easy, and there are some spectest files that still pass after that
19:28 moritz hoelzro: and what does IO::Socket::SSL do?
19:29 hoelzro it calls a helper routine from a native library
19:29 hoelzro client_connect
19:29 hoelzro I should clarify; I ask because I'm implementing a new XMPP library, and the XMPP spec says when you upgrade a connection to use SSL, it *must* be the same TCP connection
19:31 hoelzro so I need to add a feature to IO::Socket::SSL to accept an existing socket to use for communication, and OpenSSL seems to operate purely on the file descriptor level
19:35 moritz hoelzro: I guess a good case can be made for exposing the fh for such things, but in the end moar uses libuv to manage its IO, and I don't know how gracefully it will deal with OpenSSL taking over
19:35 hoelzro hmm
19:35 hoelzro good point
19:36 hoelzro I would assume (perhaps wrongfully) that as long as nothing else is using that socket after it's been wrapped by SSL, it should be fine
19:38 hoelzro I'm guessing there's *some* proper way to wrap a libuv tcp stream in an SSL library
19:38 hoelzro but libuv's on my naughty list right now, because of a bug I found in MoarVM that's going to be hard to fix due to libuv's design
19:38 kjs_ joined #perl6
19:44 hoelzro hmm, it seems you *can* use OpenSSL without filenos, as long as you're willing to push the bytes through yourself
19:46 denis_boyun_ joined #perl6
19:51 denis_boyun___ joined #perl6
19:58 telex joined #perl6
20:01 raiph joined #perl6
20:03 Mso150 joined #perl6
20:12 adu how do I redirect stdout to a file for just one function?
20:13 * colomon thinks    my $*OUT = whatever
20:14 adu why would my grammar work with Grammar::Debugger, but not without it?
20:19 muixirt joined #perl6
20:22 colomon adu: Heisenbug somewhere?
20:24 FROGGS__ joined #perl6
20:25 kjs_ joined #perl6
20:25 Sqirrel_ joined #perl6
20:27 muixirt $ strace -c perl6 -e '1'
20:27 muixirt 23835 wait4 calls?
20:28 muixirt 44 clone calls? Wat?
20:31 adu colomon: Heisenbug?
20:34 raydiak adu: http://en.wikipedia.org/wiki/Heisenbug
20:34 davido_ joined #perl6
20:34 adu that's an apt description, yes
20:36 FROGGS[tab] joined #perl6
20:37 kjs_ joined #perl6
20:44 dalek roast: d84f6bc | usev6++ | S06-operator-overloading/sub.t:
20:44 dalek roast: Add test for RT #86906
20:44 synopsebot Link: https://rt.perl.org/rt3//Public/Bug/Display.html?id=86906
20:44 dalek roast: review: https://github.com/perl6/roast/commit/d84f6bcbb3
20:54 kjs_ joined #perl6
20:56 masak good evening, #perl6
20:58 sqirrel__ joined #perl6
21:03 cbk1090 joined #perl6
21:03 Khisanth joined #perl6
21:04 masak Mouq++ # improving 007 in a way I had tried and failed to do
21:04 masak all y'all should follow Mouq's excellent example and pull-request 007 ;)
21:04 masak remember, pull requests are made of love.
21:06 adu raydiak: I think it's failing on a proto rule
21:07 adu with options a and b, a is failing, but it never tries b
21:10 masak psch: re http://irclog.perlgeek.de/perl6/2014-12-28#i_9860925 , I'm pretty sure I had a valid use case for anonymous named parameters once.
21:11 masak psch: the thing that people forget is that code gets refactored, and in the transitions between states it's more important that refactors work and give a consistent result than it is to protect someone's notion of what is sane.
21:11 kjs_ joined #perl6
21:15 masak it's a point I have not yet quite figured out how to make in a blog post: Perl 6 feels like a solid language when you refactor.
21:15 masak I don't quite know why that is, either.
21:18 moritz maybe it's the sweet spot between catching many typical refactoring mistakes at compile time, and still offering enough freedom that for example type changes don't automatically percolate through the whole application
21:19 masak mebbe
21:19 masak the things I've observed that weigh into it:
21:20 raydiak adu: like your bug, /me is not really here atm if you look too close :)  I know you're not working on a small grammar, but if you can reduce the problem area to a demonstrable failure in a gist, someone can likely help you, or I can check it out when I'm back, or you might figure it out in the process
21:20 masak (a) Perl 6 offers many ways, and at different "scales"
21:20 masak (b) often refactors are about "upgrading" from a simpler way to a more involved way, due to some perceived benefit
21:21 masak (c) doing so feels very natural, for some reason, at least to an experienced Perl 6 developer who already knows the idioms
21:21 masak one upgrade I do quite a lot in a lot of projects is to keep things as ad-hoc hashes for a bit, and then "upgrade" them to being classes/objects.
21:22 Mso150 joined #perl6
21:33 bartolin .tell FROGGS looks like I'm ready to run 'PANDA_SUBMIT_TESTREPORTS=1 panda smoke' on a daily basis. do you want to get all those data at testers.perl6.org?
21:33 yoleaux bartolin: I'll pass your message to FROGGS.
21:35 [Coke] masak: I have gone the other way with my perl6 project; I started out making EVERYTHING classes. need to step back, and throw out a few of the lower level ones to simplify the objects I actually need to work with.
21:37 camelia joined #perl6
21:38 masak I dunno why. I like to work like that. bottom-up, YAGNI complexity.
21:40 davido_ joined #perl6
21:41 kjs_ joined #perl6
21:49 * raydiak usually starts with a small .p6 script, grows it to several hundred lines of globals and overlapping scopes in a short creative explosion which looks to the mind's eye like a man playing paintball with himself (and losing), then re-writes it (relatively) carefully from scratch with a much more thorough understanding of the problem space
21:49 masak yeah.
21:49 masak for me, tests and the TDD cycle plays an integral role, too.
21:49 masak I can do The Simplest Thing as a way to get tests to pass.
21:50 masak knowing that if I need to, I can come back and prop them up later using more imposing Perl 6 features.
21:50 masak often, I'm glad I deferred a bit in choosing how to do that upgrade step.
21:52 [Coke] lizmat: looks like my attempt to cancel the install of xcode 6.1.1 failed, and I'm using it already. whoops.
21:53 lizmat [Coke]: are you still on Mavericks
21:53 lizmat ?
21:53 adu is there a debugger?
21:54 adu [Coke]: are you on mac?
21:54 lizmat masak: wrt to using hashes during development: maybe we need an auto-accessor/mutator generating type of hash ?
21:55 lizmat so you wouldn't have to change the code much after you've made it a proper object?
21:55 masak lizmat: oh, I thought you were going to say "maybe we need an editor refactor that can do the upgrade (semi-)automatically?" :)
21:55 masak 'night, #perl6
21:55 lizmat gnight masak
22:06 lizmat m: class H is Hash { method FALLBACK($name,*@rest) { @rest ?? self{$name} = @rest !! self{$name} } }; my $h = H.new; $h.foo(42); say $h.foo   # the above idea
22:06 camelia rakudo-moar 80b912: OUTPUT«42␤»
22:09 lizmat m: class H { has %!h; method FALLBACK($name,*@rest) { @rest ?? %!h{$name} = @rest !! %!h{$name} } }; my $h = H.new; $h.foo(42); say $h.foo   # perhaps better
22:09 camelia rakudo-moar 80b912: OUTPUT«42␤»
22:17 colomon joined #perl6
22:26 Ven joined #perl6
22:27 Ven moritz: I think you have the right idea (WRT masak's discussion on "why refactoring in p6 feels strong/sane")
22:27 Ven also, I've come to realize dynamic scoping can be your dependency injection :-)
22:28 Ven (or rather, the other way around)
22:29 kjs_ joined #perl6
22:32 leont joined #perl6
22:33 dalek rakudo/nom: eaaf541 | lizmat++ | src/core/Inc.pm:
22:33 dalek rakudo/nom: Add support for RAKUDO_PRECOMP_WITH
22:33 dalek rakudo/nom:
22:33 dalek rakudo/nom: The idea being that we can force an @*INC on an externally starting perl6,
22:33 dalek rakudo/nom: so that the CompUnit.precomp method can take an :INC parameter.  This should
22:33 dalek rakudo/nom: do away with kludges such as setting PERL6LIB to add CompUnitRepo's for
22:33 dalek rakudo/nom: creating a precomp version of a file.
22:33 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/eaaf5410a0
22:33 lizmat and on that thought: good night, #perl6!
22:34 jnthn good night, lizmat :)
22:34 yoleaux 15:00Z <lizmat> jnthn: what's the difference between nqp::queuepoll($!queue) and nqp::atpos($!queue,0) ?
22:34 yoleaux 15:07Z <lizmat> jnthn: please ignore: at_pos blocks, queuepoll doesn't
22:34 jnthn ...well, that was an easy day for the messages :)
22:47 Ven :D
23:22 nine joined #perl6
23:22 nine m: say 'server upgraded to openSUSE 13.2'
23:22 yoleaux 11:06Z <moritz> nine: I've moved the camelia.service to camelia@.service (template) and have started two instances, one for freenode, one for magnet
23:22 camelia rakudo-moar 80b912: OUTPUT«server upgraded to openSUSE 13.2␤»
23:24 nine and camelia obviously survived :)
23:26 raiph joined #perl6
23:28 adu joined #perl6
23:31 Rounin joined #perl6
23:31 colomon joined #perl6
23:35 raydiak m: say $*DISTRO
23:35 camelia rakudo-moar 80b912: OUTPUT«opensuse (13.2.Harlequin)␤»
23:36 Khisanth joined #perl6
23:36 Ven joined #perl6
23:38 adu has anyone here used perl6-debug?
23:39 jnthn TimToady: About "my @x := 1...*; say(|@x);" - given the flattening happens as part of argument handling at the VM level, everywhere, making that work is going to be *extremely* painful.
23:39 jnthn adu: A bit ;)
23:39 jnthn Not for a while, mind.
23:40 jnthn TimToady: To expand a bit: the VM expects to be given a VM-level array of arguments that it can index into without causing any kind of code execution.
23:41 adu jnthn: so let me get this straight, all I need to do is run perl6-debug, I don't need https://github.com/jnthn/rakudo-debugger/ ?
23:41 jnthn TimToady: And the only way to provide that is being eager on the caller side.
23:42 jnthn adu: perl6-debug is only the driver; you need a frontend installed, the only one of which I know of at the moment is the github module you linked to (though the design is such there could be others).
23:42 jnthn adu: So you'd need to install that module with Panda, then you should be good to go.
23:43 adu so I do need both
23:43 adu I can't use panda
23:43 jnthn Rakudo Star comes with the module (and its dependency), so anyone installing that gets all that's needed.
23:44 jnthn OK, then you're left to manually copying the module somewhere sensible and also Term::ANSIColor
23:44 jnthn Why can't you use panda, ooc?
23:46 adu http://pastie.org/9805888
23:46 adu I looks like it's a bug in macosx
23:47 jnthn wtf...
23:47 adu it looks like macosx's "sh" is using the first line of file B to execute file A
23:47 FROGGS__ I'd try: perl6-m /Users/ajr/.local/bin/panda install ...
23:48 jnthn macosx does some weird sh..
23:49 * jnthn is a little surprised he ain't heard about this problem before, thoguh, given the fairly sizable OSX-using population on the channel.
23:50 geekosaur I... don't think that kind of chained interpreter is technically supported anywhere, although it may happen to work on linux
23:51 FROGGS__ chained interpreter?
23:51 geekosaur a #! line ponting to something with a #! line
23:51 adu jnthn: I'm on Yosemite, that's the only thing I can guess
23:52 FROGGS__ geekosaur: you... can't run a script with a script? that seems weird
23:52 jnthn We'll end up with perl6-m being a binary in the not too distant future anyways, which would solve it, provided that's what the issue is.
23:52 geekosaur (technically all executables have interpreters. the interpreter for a script is specified in the #! line. the interpreter for a program is the system's ld.so equivalent, although for a static executable it can be itself as a special case)
23:52 jnthn I know patches were worked on, I just was too snowed under to get to them.
23:52 geekosaur #! started out as a hack and mostly is one :)
23:53 geekosaur relying on that working is not portable
23:53 jnthn Seems my battery's nearly out, which probably means sleep time...
23:53 jnthn 'night
23:53 adu night
23:54 geekosaur iirc 4.2bsd would fail exec if the target of a #! was itself a script, and some later *BSDs supported limited nesting

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

Perl 6 | Reference Documentation | Rakudo