Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-03-23

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:10 cdg joined #perl6
00:14 johndau joined #perl6
00:20 lucs class Foo { has $n } ; class Bar is Foo { 「new should simply return an instance with $n set to 42」 } # How do I BUILD (I suppose) this?
00:22 timotimo you can call self.Foo::new(:n(42)) if you want
00:22 timotimo as in, from Bar's method new
00:23 lucs Hmm...
00:23 lucs (trying)
00:25 Xliff SrKeys, that gave me a migraine, dammit!
00:25 SrKeys lmao
00:25 Xliff I'm not yet up to the changes in map, and deepmap? WTF?
00:25 Xliff And flat? Are you trying to say something derogatory about certain women?
00:25 Xliff Shame on you, sir!
00:26 BenGoldberg joined #perl6
00:26 SrKeys no i'm just trying to say 'ayy lmao'
00:26 Xliff Well you got me to do that, sir.
00:26 * Xliff doffs hat.
00:26 Xliff Of course, my laugh was more pronounced like "Aaaaaieeeee!"
00:26 lucs timotimo: Yep, thanks.
00:27 Xliff SrKeys, You know... you could always have done "say 'ayy lmao'" -- but where's the fun in that?
00:27 SrKeys exactly
00:28 Xliff Hay. It's been a good day. I made an Amen break in Hydrogen.
00:28 * Xliff loves the Amen break.
00:28 diakopter *BLINK*
00:40 TEttinger Xliff: sped up, slowed down, whatever it is it sounds like... a thing
00:40 Xliff TEttinger, I very rythmic thing.
00:40 Xliff s/I/A/
00:41 Xliff https://www.youtube.com/watch?v=qwQLk7NcpO4&ab_channel=malminho
00:42 timotimo hmm. i wonder how we'd expose OOB message bytes to users of our sockets
00:42 Xliff It's one of those things I've always wanted to replicate in a drum program. But first I needed the right drum program. Then I needed the right samples.
00:42 synopsebot6 joined #perl6
00:42 Xliff Then I needed to program it all.
00:42 Xliff Today I accomplished all three.
00:42 Xliff *yay*
00:42 timotimo neat :)
00:43 Xliff And who'd have guessed the secret was #perl6?
00:43 Actualeyes joined #perl6
00:44 TEttinger nice!
00:44 TEttinger https://www.youtube.com/watch?v=P9NWXe9mHNY
00:44 Xliff Ooh! The warble.
00:45 TEttinger lots of good drum sampling in that
00:45 Xliff But oh, the pattern programming!
00:45 Xliff O_O
00:45 TEttinger heh
00:45 * Xliff throws his hands up and starts bopping his head, instead.
00:46 Xliff I could not imagine doing this by hand.
00:46 Xliff This requires drum pads.
00:52 nienacko_ joined #perl6
00:59 timotimo wow, tcp oob is pretty much uesless :\
01:07 lizmat joined #perl6
01:08 Xliff timotimo: Wow. Even trying to read about TCP OOB is useless! =)
01:08 timotimo yeah, potentially because nobody cares about it
01:08 Xliff Bingo
01:09 timotimo all it can really do is tell you up front "there's going to be a single byte of OOB information coming up some time soon!" and where exactly that OOB was inserted in the stream
01:09 Xliff http://www.gnu.org/software/libc/manual/html_node/Out_002dof_002dBand-Data.html
01:11 timotimo i read that, too
01:11 timotimo it wasn't terribly helpful
01:12 Xliff Well, thank god. I can stop reading, now.
01:14 Xliff Man, I just love it when corporations remove useful data from the internet.
01:15 AlexDaniel chrs??
01:15 Xliff Then I have to hit the Wayback Machine and hope.
01:15 Xliff https://web.archive.org/web/20090228185102/http://docs.hp.com/en/B2355-90136/ch03s07.html
01:15 AlexDaniel m: say ‘hello world’.chrs
01:15 camelia rakudo-moar 72ba5a: OUTPUT«This type cannot unbox to a native integer␤  in block <unit> at /tmp/d7kh4ACv_I line 1␤␤»
01:15 AlexDaniel aah
01:16 AlexDaniel m: say (50, 60, 60).chrs
01:16 camelia rakudo-moar 72ba5a: OUTPUT«2<<␤»
01:16 AlexDaniel m: say (Inf).chrs
01:16 camelia rakudo-moar 72ba5a: OUTPUT«This type cannot unbox to a native integer␤  in block <unit> at /tmp/SmdxV925rN line 1␤␤»
01:16 AlexDaniel m: say (-10).chrs
01:16 camelia rakudo-moar 72ba5a: OUTPUT«chr codepoint cannot be negative␤  in block <unit> at /tmp/jHtVndttHo line 1␤␤»
01:16 AlexDaniel fine.
01:17 AlexDaniel m: (999999).chrs.say
01:17 camelia rakudo-moar 72ba5a: OUTPUT«????␤»
01:20 AlexDaniel m: [[97, 98], [99, 100, [101, 102, 103]]].chrs.say
01:20 camelia rakudo-moar 72ba5a: OUTPUT«This type cannot unbox to a native integer␤  in block <unit> at /tmp/XJuD72avfe line 1␤␤»
01:20 AlexDaniel star: [[97, 98], [99, 100, [101, 102, 103]]].chrs.say
01:20 camelia star-m 2016.01: OUTPUT«a bc d e f g␤»
01:21 AlexDaniel Hmm…
01:25 vendethiel joined #perl6
01:26 geekosaur joined #perl6
02:01 BenGoldberg The sole and exclusive use of tcp oob that I know of is within telnet, when you press the break key on your keyboard.
02:02 geekosaur tcp oob isn't really oob, so it's kinda useless for most things you'd want to use oob for
02:09 BenGoldberg It's use in telnet kinda makes sense.  Let's suppose you accidentally typed 'cat really_long_file' ... if you typing control-c did nothing more than kill the 'cat' process, you still might end up with many unwanted pages of data scrolling up your terminal.  But by using an oob byte (one in each direction), and discarding everything prior to the oob byte, less is displayed and the problem is reduced.
02:10 geekosaur well, yes, as long as you only need to do it once
02:12 BenGoldberg If you send a second oob signal over tcp, the recipients oob pointer is altered from the first location to the second, so more bytes of unwanted data get discarded.
02:12 BenGoldberg Of course, if you send a couple of oob bytes, the location of that earlier one is forgotten, which could be a bad thing, if we were doing anything other than discarding stuff..
02:12 geekosaur exactly
02:13 geekosaur this is not OOB, this is a hack that is more or less only useful for telnet
02:14 cdg joined #perl6
02:14 mr-foobar joined #perl6
02:25 tmch joined #perl6
02:38 semigloss joined #perl6
02:46 shicheng joined #perl6
02:47 ilbot3 joined #perl6
02:47 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
02:48 noganex joined #perl6
02:55 kalkin-_ joined #perl6
02:59 cdg joined #perl6
03:00 sno joined #perl6
03:17 Xliff Does Perl6 have a module that groks XPath?
03:17 Xliff Hopefully XPath2?
03:17 Xliff Please?
03:17 khw joined #perl6
03:21 AlexDaniel Xliff: Not yet, as far as I can see
03:21 AlexDaniel I've also found this: https://github.com/supernovus/perl6-xml-xpath hehe :)
03:21 Xliff There are some on github using the same namespace.
03:21 Xliff XML::XPath -- one for Xpath 1.0, the other for XPath 2.0
03:21 Xliff XPath 2 - https://github.com/fjwhittle/p6-xml-xpath
03:22 Xliff XPath 1 -- https://github.com/supernovus/perl6-xml-xpath
03:22 AlexDaniel oh, interesting
03:23 Xliff Which sucks because I had a thought about doing something with Perl6 and XPath 2 to get my feet wet.
03:24 Xliff Although maybe I can get away with XPath 1
03:24 AlexDaniel Xliff: well, if you want to get your feet really wet then you can try that module by fjwhittle
03:25 Xliff I may try both, although I might suggest that fjwhittle rename his to XML::XPath2
03:25 AlexDaniel Xliff: last commit Jun 29, 2015 – which is before the release, and, if I am not mistaken, pre-GLR
03:25 Xliff Might put in a pull request for that.
03:25 Xliff pre-GLR?
03:25 AlexDaniel Xliff: which means that this modules will not run as is
03:25 AlexDaniel this module*
03:26 AlexDaniel well, the chances are not high :)
03:26 AlexDaniel Xliff: yeah, great list refactoring
03:26 Xliff Yikes! And the XPath1 fromn supernovus is later than that!
03:26 Xliff s/later/earlier/
03:26 AlexDaniel Xliff: well, if you look closely there's nothing in that repo
03:26 AlexDaniel just a readme…
03:26 Xliff LOL
03:27 Xliff I didn't get that far... no.... :P
03:27 AlexDaniel which is why I said “hehe :)” :)
03:27 Xliff =P =P
03:27 * Xliff facepalms
03:28 AlexDaniel Xliff: OK so there were some huge changes in the way the lists are handled (like what flattens and what doesn't)
03:28 Xliff This looks more promising though... https://github.com/supernovus/perl6-xml-query
03:28 AlexDaniel Xliff: so some pre-GLR code requires some tiny changes. Like, sometimes you have to add “flat”
03:29 Xliff And I still say that having a "flat" operator may be insulting to some females.
03:29 Xliff And males too!
03:29 Xliff =-D
03:30 AlexDaniel m: say 42.69.nude.flat
03:30 camelia rakudo-moar 72ba5a: OUTPUT«(4269 100)␤»
03:30 Xliff And "nude" too?
03:30 Xliff Perverts!!
03:32 noganex_ joined #perl6
03:32 AlexDaniel m: say ‘x’ leg ‘y’ # :)
03:32 camelia rakudo-moar 72ba5a: OUTPUT«Less␤»
03:33 TEttinger best not mention rack-mounted servers
03:34 Xliff We want MOAR leg, not LESS!
03:34 Xliff So supernovus aparently hangs around here, sometimes.
03:34 Xliff !seen supernovus
03:35 Xliff .seen supernovus
03:35 yoleaux I saw supernovus 28 Dec 2015 18:21Z in #perl6: <supernovus> At some point I should look at rakudobrew to replace my moon script that I've been using for the last 4 years.
03:37 AlexDaniel m: say ‘ant’ leg ‘spider’ # oh look! An operator that counts the number of legs!
03:37 camelia rakudo-moar 72ba5a: OUTPUT«Less␤»
03:38 SrKeys ?p6> ('z' leg 'a').subst('re', 'ar').say
03:38 SrKeys m: ('z' leg 'a').subst('re', 'ar').say
03:38 camelia rakudo-moar 72ba5a: OUTPUT«Moar␤»
03:38 SrKeys always use the wrong command in the wrong channel
03:47 Xliff Heh.
03:48 Xliff Well. Thought XML::Query might have been a good replacement, but that too is written by supernovus. At least that one is in the ecosystem, but it is not compiling.
03:48 Xliff Rather. It's failing tests.
03:50 AlexDaniel Xliff: by the way, what are you trying to do?
03:50 labster1 joined #perl6
03:51 Xliff AlexDaniel: I'm just randomly thinking about something to work on and trying to find modules to help.
03:52 Xliff One of the things I was thinking about doing was updating an old project that used regular expressions to screen scrape.
03:52 Xliff Replacing the extraction algorithm with something more modern.
03:53 AlexDaniel so you're actually parsing HTML?
03:53 AlexDaniel then use Gumbo
04:05 vendethiel joined #perl6
04:07 nowan joined #perl6
04:11 MadcapMobile joined #perl6
04:12 Xliff AlexDaniel, Gumbo? Will look into it.
04:12 AlexDaniel yeah, https://github.com/Skarsnik/perl6-gumbo
04:13 Xliff Looking now.
04:13 Xliff Although, at first blush, I -really- don't like the syntax.
04:13 Xliff Too used to XPath and jQuery, I guess.
04:16 Xliff And filtering only on one attribute is the real deal breaker.
04:17 MadcapMobile Xliff: how do you mean?
04:18 Xliff Gumbo is a tag based filter, and will only allow you to filter one attribute of that tag.
04:18 Xliff So you can't get all elements of the same class, regardless of tag.
04:18 Xliff At least I think that's what I'm reading.
04:20 Xliff parse-html(Str $html, :$nowhitespace, *%filters)
04:20 Xliff So does this match the above signature? - "parse-html($html, :TAG<p>, :SINGLE);"
04:23 Xliff Nevermind. $nowhitespace isn't given so everything after $html is slurped into %filters
04:23 Xliff This is going to take some getting used to.
04:24 MadcapMobile https://github.com/google/gumbo-parser/blob/master/examples/find_links.cc#L33
04:25 MadcapMobile Xliff: ^ looks like you can find any attribute
04:26 Xliff Yes, but what if I want to filter based on -2- attributes?
04:26 Xliff The docs aren't quite clear on that.
04:27 MadcapMobile you would do two separate calls to gumbo_get_attribute (or whatever the P6 wrapped equiv is), that'd be something great to provide in perl6-gumbo actually (not played with it yet though)
04:28 Xliff Would like to do something as simple as:
04:29 Xliff $xmldoc.root.elements(:TAG<div>, :class<mainDiv>, :name<element-*>)
04:29 Xliff Although :name<element-*> might be asking too much
04:31 Xliff Also would need positional concepts. You don't know how useful the following construct is when dealing with the DOM
04:33 Xliff $('div ul li.myClass')
04:33 skids It will be very interesting to see how DOM idiomizes in Perl6, and we'll probably see that soon with -js looming.
04:33 Xliff -js?
04:33 skids rakudo-js
04:33 Xliff Oooooo
04:33 Xliff Yes. Veeery interesting.
04:34 Xliff MadcapMobile, put simply, I want to have flexible selectors and Gumbo might be a start but will probably not do everything I need.
04:34 Xliff Not even close since it doesn't do positional filtering.
04:35 Xliff $('div ul li.myClass') -> Return all <LI> nodes with class "myClass" that is inside a UL. That UL must be inside a DIV.
04:36 Xliff Note that between the DIV and UL and the UL and LI, any number of containing tags may be included since we aren't using the ">" selector.
04:36 MadcapMobile yes your idea sounds really neat, I'm not knowledgeable enough on Gumbo nor the wrapper to tell you whether that'd be easy, I'm in the midst of wrapping MyHTML which this is all great insight into how the high-level P6 api should work
04:36 Xliff :)
04:37 MadcapMobile so essentially you'd like to use css selector language? ala jQuery
04:40 isBEKaml joined #perl6
04:44 Xliff Doesn't have to be. XPath would work.
04:45 Xliff Heck, I could even deal with a programmatic API as long as there's enough syntactic sugar so I don't have to remember the whole spec.
04:45 MadcapMobile It'd be neat to map that to a 6y API, 6y definitely wouldn't be a string-based DSL but maybe something hash-like: S(div => ul => li.myClass)
04:46 Xliff $xmldoc.root.find('a', :class<neat>).find('ul', :class<not>).find('b') -- Returns the jQuery equivalent of $('a.neat ui.not b')
04:48 Xliff Mind you I]
04:48 Xliff I'm mixing metaphors from the various projects I've looked at, today.
04:48 MadcapMobile that's not too bad for a wrapped C library, the sugary versions should be a module out from the C wrapper, I think
04:50 tmch joined #perl6
04:58 Xliff I'm getting sick of all of these mobile games that want to shove ads in your face (for their shit or someone else's) every 5-10 seconds.
04:59 Xliff Big Fish games are the worse. I am getting sick of seeing the Facebook "F" everywhere.
05:00 AlexDaniel m: say (^99999999999999999999999999999)[999999999999999]
05:00 AlexDaniel right…
05:01 AlexDaniel skids++
05:01 camelia rakudo-moar 72ba5a: OUTPUT«(timeout)»
05:01 Xliff MadcapJake, wrapping " myhtml_get_nodes_by_tag_id(tree, NULL, MyHTML_TAG_TITLE, NULL);" into something useful might not be that hard.
05:01 Xliff He says... with tongue firmly in cheek.
05:02 Xliff AlexDaniel, I put that in my perl interpreter. How many years should I have to wait until it finishes?
05:03 AlexDaniel Xliff: it seems like after this patch you will get the answer instantly: https://github.com/rakudo/rakudo/pull/728
05:03 Xliff Oh, SPIFF
05:07 Xliff Lemme see if I can pull that now.
05:08 SrKeys m: my &pretty-list = *.join(', ').trans(/', '(\w+)$/ => {", and $0"}); say "I'm " ~ pretty-list <cool great cool>
05:08 camelia rakudo-moar 72ba5a: OUTPUT«I'm cool, great, and cool␤»
05:08 SrKeys the code doesn't lie
05:11 MadcapJake Xliff: Once I sit down and put a couple more (2-4 really) hours into it (HTML::MyHTML), I should have the bindings and some low-level wrappings done. Then I was planning on doing some kind of high-level module that gives you the spiffy/sugary wrapping in the vein of jQuery (maybe called 6Query/sixQuery?).
05:11 AlexDaniel sexQuery
05:12 MadcapJake o_O that might be a bit too provocative!
05:12 AlexDaniel just a little bit
05:13 AlexDaniel again, how do I make an infinite list of one same element?
05:13 MadcapJake :P I was thinking of even finding a symbol that I could commandeer into the jQuery-style `$('string of css selectors')`
05:13 MadcapJake AlexDaniel: « 1 xx Inf »?
05:14 vendethiel joined #perl6
05:16 Xliff "sexQuery" too provocative for a language with "flat" and "nude" functions?
05:16 Xliff Seriously?
05:16 Xliff -_o
05:16 MadcapJake lol
05:18 MadcapJake maybe I could use ¢ or ¤ as they are both easily reachable unicode (a2 & a4) and would evoke that jQeury vibe
05:19 Xliff Now that I'm running WinCompose, I'm surprisingly OK with that.
05:19 Xliff c/
05:19 Xliff ¢
05:19 Xliff See?
05:20 synopsebot6 joined #perl6
05:20 Xliff I don't know what that second symbol was...
05:20 MadcapJake nice! that's really easy, I need to setup compose
05:20 Xliff I need a cheatsheet for my cheatsheet.
05:20 MadcapJake it's the generic currency symbol and apparently it's even on some european keyboards!
05:21 Xliff ě
05:21 Xliff Hummm... this font might not have the right glyps
05:21 Xliff =l
05:22 Xliff
05:22 Xliff That's L=, not =L
05:22 AlexDaniel m: my @l = <one two three four>; say [~]((@l.reverse Z ‘ and ’, |(‘, ’ xx ∞)).flat.reverse[1..*])
05:22 camelia rakudo-moar 72ba5a: OUTPUT«one, two, three and four␤»
05:22 AlexDaniel that's not too short
05:23 AlexDaniel SrKeys: ↑
05:23 Xliff Whoot!
05:23 MadcapJake Xliff: try « o x » or « x o » for WinCompose to get the generic currency symbol
05:23 Xliff > say (^99999999999999999999999999999)[999999999999999]
05:23 Xliff 999999999999999
05:23 Xliff Was instant!
05:23 Xliff ¤
05:23 Xliff ¤
05:23 synopsebot6 joined #perl6
05:24 Xliff MadcapJake, Yup. Thanks.
05:24 MadcapJake no prob! For a symbol I just learned about today, it apparently is common and used :P
05:24 MadcapJake synopsebot6 seems to be having some issues
05:25 SrKeys AlexDaniel: I wasn't golfing :p
05:25 AlexDaniel SrKeys: but… but…
05:25 AlexDaniel SrKeys: that's some regular code that I write…
05:25 SrKeys why not just
05:25 SrKeys (', ' xx *)
05:25 SrKeys instead of ∞
05:26 AlexDaniel ∞ looks more infinite
05:26 SrKeys fair
05:27 MadcapJake I kind of think using * there is a bit misleading as it's used elsewhere to indicate "whatever you got"
05:27 SrKeys here it can mean
05:27 SrKeys whatever you need
05:27 SrKeys :p
05:28 SrKeys ?p6> {grep 2..$^x-2: {[==] $x.polymod($_ xx*)}}(99).say # like this golf code
05:28 SrKeys m: {grep 2..$^x-2: {[==] $x.polymod($_ xx*)}}(99).say # like this golf code
05:28 camelia rakudo-moar 72ba5a: OUTPUT«(10 32)␤»
05:28 SrKeys damnit
05:28 MadcapJake lol, right just feels slightly unclear
05:28 SrKeys m: {grep 2..$^x-2: {[==] $x.polymod($_ xx*)}}(90).say # like this golf code
05:28 camelia rakudo-moar 72ba5a: OUTPUT«(14 17 29 44)␤»
05:28 AlexDaniel MadcapJake: synbot does not like unicode… for some reason
05:28 AlexDaniel MadcapJake: see this: https://github.com/tadzik/synopsebot/issues/8
05:29 SrKeys also your thing doesn't include the oxford comma AlexDaniel
05:29 SrKeys for shame
05:29 MadcapJake synopsebot6: help
05:29 MadcapJake what does synopsebot6 do?
05:30 MadcapJake oh tickets and what's Snn?
05:30 MadcapJake synopsebot6: botsnack
05:30 synopsebot6 om nom nom
05:30 AlexDaniel SrKeys: if I had a comma there I wouldn't really need “and”!
05:30 AlexDaniel m: my @l = <one two three four>; say join ‘, ’, @l
05:30 camelia rakudo-moar 72ba5a: OUTPUT«one, two, three, four␤»
05:30 MadcapJake synopsebot6: S02
05:30 AlexDaniel look! It's great! :)
05:31 MadcapJake synopsebot6: S02:12
05:31 synopsebot6 Link: http://design.perl6.org/S02.html#line_12
05:31 SrKeys well
05:31 SrKeys sure
05:31 SrKeys but the command with and gives you all the nice
05:31 SrKeys while avoiding any ambiguity
05:32 SrKeys one, two and three could be [one, two, three] or [one, [two, three]]
05:32 SrKeys but
05:32 SrKeys one, two, and three is only the first
05:32 SrKeys s/command/comma/
05:46 perlawhirl joined #perl6
05:47 perlawhirl hi nightshift, how are we all
05:50 Cabanossi joined #perl6
05:52 perlawhirl am i able to rename a method (eg. grep) to something else... or rather, create a method that basically points to grep
05:58 SrKeys can someone confirm that this is O(n)
05:59 SrKeys {@^a.first(* > max @a[^floor @a/e]) // @a[*-1]}
05:59 SrKeys I don't want to get yelled at on codegolf
06:00 SrKeys (whitespace added for readability)
06:02 CIAvash joined #perl6
06:30 mr-foobar joined #perl6
06:32 vendethiel joined #perl6
06:50 wamba joined #perl6
06:50 shicheng joined #perl6
07:00 domidumont joined #perl6
07:03 cdg joined #perl6
07:05 domidumont joined #perl6
07:13 araujo joined #perl6
07:14 firstdayonthejob joined #perl6
07:15 araujo joined #perl6
07:17 araujo joined #perl6
07:19 araujo joined #perl6
07:22 araujo joined #perl6
07:27 Xliff WTF is codegulf
07:28 TEttinger shortening code so it's in as few chars as possible
07:30 Xliff Yeah, OK.
07:30 Xliff http://codegolf.stackexchange.com/questions/69/golf-you-a-quine-for-great-good/4827#4827
07:30 Xliff Coding for laughs.
07:30 Xliff Unfortunately, my brain doesn't work that way. Too straight forwward.
07:33 Xliff HOLY CRAP! Jelly is crazy!
07:36 Xliff o7
07:42 nakiro joined #perl6
07:45 cpage_ joined #perl6
07:45 tadzik AlexDaniel: fwiw, I have no idea who actually runs synbot and what code is it using
07:48 _nadim joined #perl6
07:53 molaf joined #perl6
07:55 TimToady joined #perl6
07:57 fireartist joined #perl6
08:07 maybekoo2 joined #perl6
08:12 sno joined #perl6
08:16 abraxxa joined #perl6
08:17 darutoko joined #perl6
08:18 ely-se joined #perl6
08:22 FROGGS joined #perl6
08:27 nowan joined #perl6
08:29 cpage_ joined #perl6
08:31 perlawhirl joined #perl6
08:33 zakharyas joined #perl6
08:35 zakharyas joined #perl6
08:41 nakiro joined #perl6
08:41 araujo_ joined #perl6
08:44 araujo_ joined #perl6
08:51 _nadim morning!
08:51 _nadim I wonder if eqv is implemented for Match.
08:52 moritz mlenz@mlenz-workstation:~/p6/rakudo (nom)$ git grep 'eqv.*Match'|wc -l
08:52 moritz 0
08:52 moritz looks like a "no" to me
08:52 moritz might be a nice exercise for a new-ish-comer
08:57 Gentoolman joined #perl6
08:57 Gentoolman Hi
08:57 Gentoolman Is anybody there?
08:57 moritz just us bots
08:58 Gentoolman How can install rakudobrew for all users?
08:58 Gentoolman on a Linux
08:58 moritz Gentoolman: what I did was create a separate user account with a world-readable home directory, and installed rakudobrew there
08:59 moritz Gentoolman: and told everybody to source /home/rakudobrew/rakudobrew-bash or whatever I called that script that sets up the environment variables
08:59 Gentoolman moritz: But why a new user, if we can make just a new folder?
08:59 Gentoolman in /usr/perl6 for example
09:00 moritz Gentoolman: but it's a rather atypical workflow to have rakudobrew for global installation; it's usually much better to install release into /opt/rakudo-2016.02/ etc for example
09:00 moritz Gentoolman: rakudobrew looks in the user's home directory for files by default, so a separate user is cleaner/easier
09:01 moritz Gentoolman: it's a also a security feature, so that if compiling rakudo ever accidentally removes files or so, it can only remove files from the rakudobrew user
09:02 _nadim moritz:  I found hat by accident when two dumps said they were equivalent but obviously not.
09:13 nine Please do not use rakudobrew for a system wide installation. It has never been inteded for that use case.
09:13 vendethiel joined #perl6
09:19 kurahaupo joined #perl6
09:25 Gentoolman joined #perl6
09:25 Gentoolman Is there a way to install perl6 module system-wide?
09:30 moritz Gentoolman: sure
09:30 moritz Gentoolman: the easiest way is to install a Rakudo Star system wide, which comes with panda
09:30 moritz Gentoolman: then as a user that has write access to the system-wide installation (don't make that root; just give the files to somebody else) you can do 'panda install Math::Model' or something like that
09:31 Gentoolman I have gentoo and there r only rakudo, nqp and moarvm ebuilds. The panda ebuilds i found doesn't working
09:32 moritz Gentoolman: http://rakudo.org/downloads/star/rakudo-star-2016.01.tar.gz
09:32 moritz building from source isn't hard
09:32 Gentoolman I know, but i need to register it in my ports system
09:33 Gentoolman I better write a ebuild for panda
09:34 moritz Gentoolman: where does that need come from?
09:43 rindolf joined #perl6
09:44 nine Gentoolman: Please do not use rakudobrew for a system wide installation. It has never been inteded for that use case.
09:45 nine Gentoolman: I would hold off on the packaging modules. There are a couple of issues that make packaging a lot harder than it should. Fixes are in the works and will take a couple of weeks and should be well worth the wait.
09:49 dakkar joined #perl6
09:52 maybekoo2 joined #perl6
09:56 moritz installing to a location that the package manager doesn't control (/usr/local or /opt, typically) is not too nice, but not too hacky either
09:58 donaldh joined #perl6
09:58 trnh joined #perl6
09:58 trnh joined #perl6
10:04 vendethiel joined #perl6
10:05 bpmedley joined #perl6
10:14 CurtisOvidPoe joined #perl6
10:15 CurtisOvidPoe My apologies in advance. I’ll have a TechBeacon.com article on Perl 6 published soon, and they’ve gone with the click-bait title of ‘Why Perl 6 is the “Game of Thrones” of Programming Languages’ (in reference to a comment I made that A Song of Ice and Fire (GoT) started in 1991 and has been worth the wait, even though it’s not “finished”.
10:16 DrForr Dun dun duhhhh duh dunn dunn...
10:17 moritz CurtisOvidPoe: there are worse titles I could imagine :-)
10:18 CurtisOvidPoe Makes me nervous, though. Certainly wasn’t the title I originally had, but I admit that it’s a hell of a lot more attention grabbing.
10:19 xiaomiao CurtisOvidPoe: if I didn't know that I'd just ignore it
10:19 xiaomiao clickbait poop is not worth the attention
10:20 xiaomiao :\
10:20 DrForr https://www.youtube.com/watch?v=SVaD8rouJn0
10:20 Juerd CurtisOvidPoe: The sad thing about clickbait is that it actually works.
10:21 masak CurtisOvidPoe: as long as we're not all dead by the end of Perl 6, I'm fine with the title
10:21 jnthn .oO( I knew Rat.nude would come in useful for something... )
10:21 CurtisOvidPoe masak: Heh :)
10:21 masak well, I'm fine with that too, actually. at least if it means Perl 6 survives for 700 years or something.
10:22 DrForr I'll take Tyrion's role :)
10:22 masak how impish of you
10:23 DrForr "All men must die... who are related in any way to Sean Bean."
10:23 nadim joined #perl6
10:23 RabidGravy joined #perl6
10:25 moritz .oO( John Barleycorn must die )
10:26 Gentoolman joined #perl6
10:31 _nadim joined #perl6
10:32 azawawi joined #perl6
10:32 azawawi hi
10:32 azawawi .seen ugexe
10:32 yoleaux I saw ugexe 22 Mar 2016 18:49Z in #perl6: <ugexe> ==>> seems like it would do what i want (but nyi)
10:32 azawawi ugexe: ping
10:34 ely-se joined #perl6
10:39 zakharyas joined #perl6
10:43 trnh joined #perl6
10:43 trnh joined #perl6
10:45 timotimo i'm on hack and i'd like to figure out what exact version of Net::IRC::Bot is installed
10:48 nine > cat bin/pmversion
10:48 nine perl -M$1 -E "say \$$1::VERSION"
10:49 timotimo oh, duh :)
10:49 azawawi .tell ugexe how do i force zef into fetching the latest sources for my repo... i updated META.info and tried 'zef update'. didnot work until i did a 'zef nuke StoreDir'
10:49 yoleaux azawawi: I'll pass your message to ugexe.
10:50 timotimo "could not find symbol '&VERSION'"
10:50 timotimo could be because on hack, the system-wide rakudo is 2016.01
10:50 moritz oh, nine's answer was for perl 5 :-)
10:50 nine There is a Net::IRC::Bot for Perl 6? Oh how time flies by
10:54 timotimo has been for quite some time
10:55 RabidGravy timotimo, https://gist.github.com/jonathanstowe/0d5373a55db9df58d5c6 - adjust to taste
10:55 * RabidGravy has snippets for everything
10:55 timotimo i wonder why i can't just panda --installed list
10:57 timotimo RabidGravy: you decided to not share the first line and the first character of the "for" with me, though?
10:57 trnh joined #perl6
10:58 RabidGravy hahaha
10:58 RabidGravy it's an exercise for the reader
10:58 timotimo oh lord
10:59 timotimo the "version" was last touched april 2011
10:59 timotimo so ... yeah ... i have "the latest version"
11:10 z8 joined #perl6
11:19 kid51 joined #perl6
11:29 nadim joined #perl6
11:32 virtualsue joined #perl6
11:38 _nadim joined #perl6
11:39 trnh joined #perl6
11:44 mojca joined #perl6
11:44 mojca I'm experiencing a failure when upgrading panda from 2015.12 to 2016.02
11:44 mojca cd "/path/to/panda/work/panda-2016.02" && /opt/local/bin/perl6 bootstrap.pl --prefix=/opt/local
11:44 mojca Unhandled exception: Missing or wrong version of dependency 'gen/moar/stage2/QRegex.nqp' (from 'src/Perl6/Pod.nqp') at <unknown>:1  (/opt/local/share/nqp/lib/Perl6/Pod.moarvm:<dependencies+deserialize>)
11:45 timotimo sounds like you haven't "make install"'d
11:45 mojca If someone can help me out with this ...
11:45 mojca which part should I install?
11:45 timotimo rakudo
11:45 mojca I have MoarVM 2016.03 installed, nqp 2016.03
11:45 RabidGravy you may get this error if you are in the rakudo build directory and run another rakudo
11:45 timotimo well, something is out of date, probably the Pod.moarvm file
11:45 mojca and rakudo 2016.02 (because there is no 2016.03 yet available)
11:46 mojca RabidGravy, I don't understand
11:47 mojca can I actually use rakudo 2016.02 with MoarVM/nqp 2016.03?
11:47 timotimo yeah
11:47 mojca And if so, should I rebuild rakudo after upgrading MoarVM from 2016.02 to 2016.03?
11:47 timotimo as long as you're fulfilling the minimum required nqp version and your nqp fulfills the minimum moarvm version you're fine
11:48 mojca the file /opt/local/share/nqp/lib/Perl6/Pod.moarvm is binary, so I have no clue whether it is outdated or not
11:48 timotimo there are some points where you have to rebuild rakudo when your moarvm got newer
11:48 mojca ok, so I'll try to rebuild rakudo and then try again
11:48 RabidGravy [jonathan@coriolanus perl6]$ cd rakudo
11:48 RabidGravy [jonathan@coriolanus rakudo]$ perl6 -e 'say foo'
11:48 RabidGravy Unhandled exception: Missing or wrong version of dependency 'gen/moar/stage2/QRegex.nqp' (from 'src/Perl6/Pod.nqp')
11:48 RabidGravy there
11:48 RabidGravy that's what I mean
11:48 mojca is there any plan to have 2016.03 released?
11:48 timotimo you can rm -rf the whole nqp/ folder and re-install all these things
11:48 mojca ok, "perl6 -e 'say foo'" crashes with the same error
11:48 mojca I'll rebuild rakudo
11:49 RabidGravy If you are in a directory that you built rakudo in yes
11:49 DrForr CurtisOvidPoe: Maybe throw https://www.youtube.com/watch?v=1CLCOvZOh1o into the comments :)
11:49 lizmat mojca: I think the plan is for today
11:50 mojca if it's going to be released today, I might just as well wait with a rebuild
11:51 mojca I'm asking just in case: does panda also have to be reinstalled/rebuilt after upgrading rakudo?
11:52 mojca I'm actually unable to rebuild rakudo 2016.02
11:52 mojca it "crashes" with "Stage parse      : This type cannot unbox to a native string at gen/moar/stage2/QASTNode.nqp:863  (/opt/local/share/nqp/lib/QASTNode.moarvm:symbol)"
11:52 nine mojca: upgrade should not affect panda
11:52 mojca nine: thanks
11:52 nine mojca: all your modules will still be there
11:53 mojca in any case it seems that I'll have to wait for rakudo 2016.03
11:54 lizmat mojca: perhaps you need to run configure again to get the latest nqp / moar
11:54 mojca I already have the latest moarvm and nqp
11:54 mojca and I configure from a clean directory
11:54 RabidGravy yeah, because it does work "This is Rakudo version 2016.02-200-g54ce66e built on MoarVM version 2016.03"
11:55 mojca for me it runs until "/opt/local/bin/moar --libpath="/opt/local/share/nqp/lib" perl6.moarvm --setting=NULL --ll-exception --optimize=3 --target=mbc --stagestats --output=CORE.setting.moarvm gen/moar/m-CORE.setting"
11:55 lizmat mojca: it's just that that error feels to me like a version mismatch somehow
11:55 mojca and then Stage parse      : This type cannot unbox to a native string
11:56 timotimo ...wtf? :)
11:56 mojca I'll check the latest commit from github to see if that helps
11:56 jnthn mojca: Are you trying to rebuild it against nqp 2016.03?
11:56 timotimo oh, wait
11:57 timotimo this is 2016.02, the *release*
11:57 jnthn Generally you've got quite a lot of slack in using future MoarVM versions from Rakudo
11:57 mojca yes, I have installed moarvm 2016.03, then nqp 2016.03 … and only then noticed that rakudo 2016.03 has not been released yet
11:57 timotimo i didn't realize thet, sorry
11:57 jnthn But NQP versions need to kmatch more closely.
11:57 jnthn *match
11:57 timotimo i thought you were using latest from git
11:57 mojca no, I was using released versions only
11:58 mojca but with the latest git commit of rakudo it seems better
11:59 nine I can reproduce: MoarVM 2016.03 with nqp 2016.03 will give you a "Stage parse      : This type cannot unbox to a native string" in rakudo 2016.02
11:59 RabidGravy so don't do that then
11:59 mojca I'll package the latest git commit of rakudo until new version gets released (to avoid users complaining; because I already committed an upgrade of moarvm and nqp)
12:00 timotimo you're packaging for a distro?
12:00 mojca MacPorts
12:01 mojca I don't believe we have many users anyway
12:01 mojca will started the ball rolling
12:01 timotimo there's also potential users we should worry about
12:01 timotimo sorry to mislead you like that ;(
12:02 mojca I'll just upgrade rakudo to a commit from git, then I hope users won't experience problems
12:03 RabidGravy I'd guess that what's in there right now is a "release candidate"
12:03 mojca but I should really discuss packaging of panda with you experts
12:05 mojca and I would be really grateful if someone would look into dyncall, libtommath, libuv in MoarVM
12:06 RabidGravy "look into"
12:06 mojca because I had to mark a conflict between MoraVM and those three libraries, otherwise they all install the same files to the same locations
12:06 timotimo well, you can already use a system-wide installed version of at least some of the dependencies
12:07 mojca it would be great if MoarVM would install those dependencies to some private prefix, so that other software wouldn't find them there
12:07 timotimo i don't think we're supposed to install these libraries
12:07 RabidGravy I thought it did do that
12:07 mojca I tried to use system-wide dependencies, but it lead to a number of problems
12:07 mojca and at some point I "gave up" because I wanted to get the job done
12:08 mojca and some developers advised me that many libraries are simply not new enough in their latest release
12:09 mojca with "perl6 -e 'say foo'"
12:09 mojca I now get
12:09 mojca ===SORRY!=== Error while compiling -e
12:09 RabidGravy which is right
12:09 psch m: say foo
12:09 camelia rakudo-moar 176285: OUTPUT«5===SORRY!5=== Error while compiling /tmp/C8wbVjMH2E␤Undeclared routine:␤    foo used at line 1␤␤»
12:10 timotimo yeah, you don'thave a foo at all
12:10 mojca Undeclared routine: foo used at line 1
12:10 timotimo we could of course ship "foo", "bar" and "baz" and also "quux"
12:10 timotimo with some default implementation
12:10 RabidGravy when I typed that ^ I new it would fail before it started to parse
12:10 mojca ok, perl6 -e 'say "foo"' works
12:10 perlpilot_ joined #perl6
12:11 mojca I'm sorry, I've never actually used perl6, I didn't think of the example you provided me too much
12:11 colomon joined #perl6
12:14 mojca timotimo, yes, moarvm still ships $prefix/include/libuv/uv.h, $prefix/include/libtommath/tommath.h, $prefix/include/libatomic_ops etc.
12:14 mojca and this is a bit annoying
12:14 timotimo yeah, that's not so good
12:14 * timotimo doesn't grok the build system :(
12:16 virtualsue joined #perl6
12:20 FROGGS mojca: we dont install libtommath stuff if you configure moar with --has-libtommath
12:20 timotimo well, at least that
12:21 FROGGS mojca: same is true for --has-dyncall and --has-libuv
12:21 mojca I need to check, but isn't there some statement that at least some of these libraries are too old and that MoarVM includes the latest unreleased version?
12:21 FROGGS in fact, should be true for all of: --has-libtommath, --has-sha, --has-libuv, --has-libatomic_ops, --has-dynasm, --has-dyncall and --has-libffi
12:22 FROGGS mojca: depends on what distro you are...
12:22 mojca I can try to do the installation again, but the last time it started bugging me with some completely unrelated alternative dependencies
12:22 mojca I'm in my own distro :) :) :)
12:22 mojca ok, joke aside
12:22 FROGGS mojca: it is surely true for libtommath, but this might get released this year
12:23 mojca we generally provide the latest versions of released software
12:23 mojca because there are no releases, it's a "rolling" package manager
12:23 FROGGS mojca: yes, you have to compare the versions we rely on to the versions that exist for your distro before you try to use them
12:23 mojca I can start following libtommath
12:24 mojca but this still doesn't change the fact that it' a very bad practice to install libraries to the same place where the original library would put them
12:24 mojca and I still believe that MoarVM should fix that
12:24 mojca wxWidgets also installs a large number of libraries, but they are all well hidden
12:25 timotimo right, we shouldn't put them quite as globally
12:26 mojca for example: https://github.com/MoarVM/MoarVM/issues/320
12:27 mojca there are two examples where I was struggling to get external dependencies working (and then gave up)
12:28 RabidGravy I'm sure I've already made something for http://www.mybunnyhug.org/fileformats/pgm/ but can't find it
12:32 [Coke] mojca: see #p6dev, #perl6-release - 2016.03 rakudo will be uploaded today.
12:32 [Coke] (evening eastern time)
12:33 [Coke] we had a ticket that I thought was a blocker, but turned out to not be, and then $dayjob interfered.
12:33 mojca thank you
12:35 [Coke] mojca++ keeping macports updated!
12:35 wamba joined #perl6
12:35 mojca I hope you'll keep testing the packages to make sure that they don't end up in a broken state
12:36 mojca and make some suggestions about Panda
12:36 mojca I really don't like the current hacky approach
12:38 z8 joined #perl6
12:39 RabidGravy I'm sure patches would be appreciated
12:42 kent\n joined #perl6
12:42 kent\n joined #perl6
12:52 nowan joined #perl6
12:56 cpage_ joined #perl6
12:56 nowan joined #perl6
12:56 gregf_ m: if ( 10 < 1 ){ print "nope"; }
12:56 camelia rakudo-moar 08a760: OUTPUT«5===SORRY!5=== Error while compiling /tmp/LSznfPQLPc␤Missing block␤at /tmp/LSznfPQLPc:1␤------> 3if ( 10 < 1 ){ print "nope"; }7⏏5<EOL>␤    expecting any of:␤        block or pointy block␤»
12:57 gregf_ m: if ( 10 < 1 ) { print "nope"; }
12:57 camelia rakudo-moar 08a760: ( no output )
12:57 gregf_ the compiler is looking for whitespaces :|
12:57 gregf_ or parser
12:59 psch m: say %( a => 1, b => 2){'a'}
12:59 camelia rakudo-moar 08a760: OUTPUT«1␤»
12:59 psch because that wants to work
12:59 psch well, maybe not *only* because of that :)
13:00 perlpilot gregf_: you don't need parens there.  And yes, whitespace between ) and { would be required for Rakudo to parse it correctly.
13:01 gregf_ perlpilot: yeah, i saw that, but just for better readability
13:02 RabidGravy Is there anything in the ecosystem that will parse "Mon, 14 Mar 2016 13:28:19 +0000" as a DateTime?  DateTime::Parse doesn't quite manage it
13:04 RabidGravy ah DateTime::Format::RFC2822
13:11 cdg joined #perl6
13:15 gregf_ im not able to figure out why this code is failing
13:16 gregf_ https://gist.github.com/anonymous/ee9caad3bc145cdfef37
13:16 gregf_ do i need to instantiate Prime? can i not just call it as a class method?
13:16 psch m: https://gist.github.com/anonymous/ee9caad3bc145cdfef37
13:16 camelia rakudo-moar 08a760: OUTPUT«Cannot look up attributes in a type object␤  in method is_prime at /tmp/zfmMGEiTJi line 12␤  in method test at /tmp/zfmMGEiTJi line 24␤  in block <unit> at /tmp/zfmMGEiTJi line 29␤␤»
13:17 ilmari RabidGravy: does it handle all the date formats in https://youtu.be/JENdgiAPD6c?t=11m4s ?
13:17 timotimo m: say Int.new(99)
13:17 camelia rakudo-moar 08a760: OUTPUT«99␤»
13:17 ilmari including comment-folding-white-space
13:17 psch m: say Int.is-prime
13:17 camelia rakudo-moar 08a760: OUTPUT«Invocant requires an instance of type Int, but a type object was passed.  Did you forget a .new?␤  in block <unit> at /tmp/QoDaxnJyqi line 1␤␤»
13:17 gregf_ hmm :|
13:17 timotimo gregf_: you have to create a new Prime instance otherwise $.start won't work
13:18 gregf_ true :|, my bad
13:18 timotimo :)
13:18 psch similarly, an uninstantiated MyInt doesn't have a value either
13:18 gregf_ can it be made a class variable/ static?
13:18 vendethiel joined #perl6
13:18 RabidGravy ilmari, I'm sure you can fix it to do so
13:18 gregf_ psch: im instantiating it in the first map
13:19 RabidGravy I on the other hand only want to parse one particular format
13:19 psch oh, right, didn#t see that, sorry :)
13:20 psch gregf_: you could do 'my $start = 2' instead of 'has $.start is rw = 2', but then you have to reset it at the end of your is_prime
13:20 gregf_ ah, right
13:21 psch (you could also use CORE::<&is-prime> instead... :) )
13:21 gregf_ timotimo: psch: Thanks!
13:21 gregf_ oh , ok :)
13:21 psch m: say ^1000 .grep: *.is-prime
13:21 camelia rakudo-moar 08a760: OUTPUT«(2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 …»
13:21 psch it's probably faster, too :)
13:21 mprelude_ joined #perl6
13:22 gregf_ hmmm
13:23 pierrot joined #perl6
13:23 RabidGravy oh dear, that module can't *parse* those dates at all
13:24 RabidGravy or any dates
13:24 RabidGravy c'mon you slackers do I have to make everything for myself
13:25 perlpilot RabidGravy: you make everything for everyone else too :)
13:25 skids joined #perl6
13:29 DrForr I'm guessing that the interest in is-prime is because of the recent prime-number bias that's been found? :)
13:29 RabidGravy we need more people actually writing software
13:30 * psch is compiling
13:31 timotimo since i'm into making video games, i'm kind of blocked by performance :)
13:31 timotimo but to be fair, i've never actually maked a game yet
13:31 wbill joined #perl6
13:31 DrForr So far my talks on web development seem to be the popular thing :)
13:32 RabidGravy DrForr, I've noticed that the tests for Prancer only seem to test GET routes, is this because  POST/PUT/DELETE don't work or you just haven't got round to it
13:33 * jnthn is writing the MoarVM heap snapshot analyzer in Perl 6 *right now*! :)
13:33 RabidGravy jnthn++
13:34 RabidGravy I'm writing a thing to manage icecast servers
13:34 RabidGravy but the date thing might block me
13:35 jnthn Ugh. So far I've fixed 2 perf bugs (one in Rakudo, one in Moar) that were in my way... :)
13:35 DrForr The latter, but I'm not going to go to too much work as there's nothing in the code that distinguishes between GET and the others.
13:36 timotimo it surprises me that you actually got a performance problem out of a sync read blocking the GC
13:37 timotimo though i suppose when you're reading a line that's a megabyte or two long ...
13:37 RabidGravy so it's just try it and see what happens
13:39 brrt joined #perl6
13:40 jnthn timotimo: Command line app that processes stuff while waiting for you to type a query :)
13:40 jnthn (So it might be ready when you are)
13:42 timotimo right
13:46 vendethiel joined #perl6
13:46 dalek joined #perl6
13:53 El_Che <old man pointing at clouds mode> Go's stdlib command line handler is as weird as Perl6's: switches before arguments and anti-posix look and feel. Overwriting functions (e.g. usage) is more flexible though<cloud passed>
13:53 moritz more flexible than allowing a custom USAGE sub?
13:56 El_Che yes, e.g. wrapping the existing function and adding stuff. Instead of replacing the complete usage funciont
13:56 El_Che (my argument is that perl6 approach is more flexible)
13:57 xiaomiao Go is quite horrible because it doesn't distinguish short and long opts
13:57 xiaomiao it's the little detail that create friction ... :\
13:57 El_Che xiaomiao: I am using this: https://github.com/docopt/docopt.go
13:58 El_Che It would be nice to see this ported to p6: http://docopt.org/
13:58 RabidGravy feel free
13:58 El_Che looking at it now
13:58 xiaomiao El_Che: nice, but why is that not the standard ;)
13:58 El_Che xiaomiao: I feel your pain
13:58 xiaomiao El_Che: no, you don't ;) the real pain is "go get" and github together
13:59 El_Che xiaomiao: unversioned remoted github dependencies? mmm :)
14:00 xiaomiao El_Che: we see on average 3% connection failure rate
14:00 shicheng joined #perl6
14:00 xiaomiao with 30 dependencies on github ... well ... bash has nice loops to force success ;)
14:00 perlpilot Didn't Damian do something like that for Perl 5?  (write your command line doc using the normal conventions and it auto-processes the command line)
14:01 RabidGravy also I'd really like Int("unlimited") to be Inf
14:01 * moritz would really dislike that
14:01 timotimo we can't reasonably support Inf to be stored in Int objects
14:01 moritz seems like a very English-centric thing to do when parsing strings
14:02 RabidGravy yeah, it's just this pain in the arse data is "some integer or 'unlimited'"
14:03 khw joined #perl6
14:05 RabidGravy though, I'm not entirely sure that:
14:05 RabidGravy m: my Int $a = Int.max
14:05 camelia rakudo-moar 08a760: OUTPUT«Type check failed in assignment to $a; expected Int but got Num (-Inf)␤  in block <unit> at /tmp/ieQWDjOhLc line 1␤␤»
14:05 RabidGravy is very useful at all
14:06 perlpilot It certainly seems counter-intuitive
14:08 lizmat m: my Int $a = int.max;   # works fine  :-)
14:08 camelia rakudo-moar 08a760: OUTPUT«Type check failed in assignment to $a; expected Int but got Num (-Inf)␤  in block <unit> at /tmp/kkBZbpL5GA line 1␤␤»
14:08 lizmat no?
14:08 lizmat hmmm...
14:09 * RabidGravy goes with some very big number instead
14:10 Azry joined #perl6
14:10 cognominal joined #perl6
14:10 TreyHarr1 joined #perl6
14:10 Upasaka joined #perl6
14:10 [Sno] joined #perl6
14:10 BinGOs joined #perl6
14:10 mkz_ joined #perl6
14:10 lizmat m: dd int.Range  # confused it with this
14:10 camelia rakudo-moar 08a760: OUTPUT«-9223372036854775808..9223372036854775807␤»
14:10 RabidGravy actually I'd be surprised if "unlimited" in this context is more than (2**32) - 1
14:11 lizmat m: dd int8.Range  # confused it with this
14:11 camelia rakudo-moar 08a760: OUTPUT«-128..127␤»
14:15 Cabanoss- joined #perl6
14:18 mst joined #perl6
14:18 vytas joined #perl6
14:20 sjn joined #perl6
14:22 timotimo joined #perl6
14:24 [Tux] joined #perl6
14:24 ssm joined #perl6
14:25 zakharyas joined #perl6
14:30 skids http://www.theregister.co.uk/2016/03/23/npm_left_pad_chaos/ # What we don't want happening to our ecosystem
14:30 lizmat well, in fact, we had that happen already...
14:31 lizmat :-(
14:31 tony-o what did we have like that
14:33 tony-o lizmat: what do you use for determining where an application is spending most of its time? IE if some loop is using most of the time the process runs, etc ? is there something like that in p6 currently?
14:34 lizmat tony-o: somebody pulling their modules from github and the ecosystem
14:34 lizmat because they didn't like github
14:34 lizmat tony-o: wrt to profiling:  --profile is your friend  :-)
14:34 tony-o lizmat: oh really? i thought maybe it happened with SF left, didn't know about the github piece
14:35 RabidGravy yeah, installing from gh is a little fragile
14:35 timotimo yes, we don't want to rely on that for much longer
14:36 ilmari ranguard and co are working on perl6 support for cpan, no?
14:36 tony-o it seems it should work from any git - i have a server i can set up gitlabs on if you guys want some access to it
14:36 tony-o i remember having an issue with bitbucket installs 2 years ago
14:36 timotimo jdv is working on something. i know that much
14:37 tony-o lizmat: the profile came out with a bunch of {{var}} stuff in it - is there something i need to do to get those values filled in?
14:37 tony-o oh, i need to be patient :-)
14:38 timotimo yeah, takes a little bit :S
14:38 lizmat yeah, the generated HTML is usually large  :-)
14:40 tony-o this is a great tool.  i'm trying to figure out why a parallel testing thing i'm working on is slower than 'prove -j9' but now i can see why :
14:40 tony-o it's faster than just 'prove', at least
15:03 maybekoo2 joined #perl6
15:07 iH2O joined #perl6
15:12 AlexDaniel joined #perl6
15:14 MadcapJake How difficult would it be to make perl6 work with this https://github.com/whyrusleeping/gx
15:14 brrt joined #perl6
15:15 AlexDaniel well, ideally it should be possible to have non-github modules
15:15 AlexDaniel in fact, it would be even better if it was possible to provide several mirrors
15:16 Woodi hi today :)
15:16 virtualsue joined #perl6
15:17 iH2O hi Woody
15:17 _nadim im: my %a = <a 1 b 2> ; my @l = (%a<a>, %a<c>) ; @l.perl.say ;
15:17 _nadim m: my %a = <a 1 b 2> ; my @l = (%a<a>, %a<c>) ; @l.perl.say ;
15:17 camelia rakudo-moar e57e63: OUTPUT«[IntStr.new(1, "1"), Any]␤»
15:17 stmuk_ I'd assume the ecosystem would work with gitlabs although I've not actually tried it
15:17 tony-o MadcapJake: AlexDaniel: the CUR stuff is improving and getting to a point where that is possible without CORE changes
15:18 _nadim How do I write the line above soif %a<c> doesn not exist, itis not added. IE: not get theAny on thelist.
15:18 tony-o stmuk_: i was going to test that out in a bit
15:18 MadcapJake AlexDaniel: gx works with IPFS so each person could be a repo of modules
15:18 lizmat _nadim: what makes you think it was added ?
15:19 lizmat m: my %a = <a 1 b 2> ; my @l = (%a<a>, %a<c>) ; dd %a
15:19 camelia rakudo-moar e57e63: OUTPUT«Hash %a = {:a(IntStr.new(1, "1")), :b(IntStr.new(2, "2"))}␤»
15:19 AlexDaniel m: my %a = <a 1 b 2> ; my @l = (%a<a>, %a<c>) ; dd @l
15:19 camelia rakudo-moar e57e63: OUTPUT«Array @l = [IntStr.new(1, "1"), Any]␤»
15:19 lizmat m: my %a = <a 1 b 2> ; my @l = (%a<a>, %a<c>:v); dd @l
15:19 camelia rakudo-moar e57e63: OUTPUT«Array @l = [IntStr.new(1, "1"), ()]␤»
15:19 lizmat hmmm
15:20 lizmat m: my %a = <a 1 b 2> ; my @l = (%a<a>, %a<c>:v); dd @l.elems
15:20 camelia rakudo-moar e57e63: OUTPUT«2␤»
15:20 _nadim lizmat: I mean added to the list I am creating
15:20 lizmat hmmm.
15:20 lizmat ok
15:20 lizmat sorry, misunderstood
15:20 _nadim no problems :)
15:20 lizmat m: my %a = <a 1 b 2> ; my @l = %a<a c>:v; dd @l
15:20 camelia rakudo-moar e57e63: OUTPUT«Array @l = [IntStr.new(1, "1")]␤»
15:20 AlexDaniel well, you can grep it out but…
15:20 lizmat _nadim: ^^^
15:20 AlexDaniel right!
15:21 lizmat :v will grep only existing entries out for you
15:21 _nadim OK!
15:21 iH2O left #perl6
15:21 _nadim what's this dd that dumps the structure?
15:21 timotimo "dump data"
15:21 MadcapJake tony-o: that's what I was hoping! The concern I have is, can I have a package depend on an individual package/vendored directory for dependencies? so that all dependencies are internal to a module/project
15:22 _nadim timotimo: is that standard?
15:22 mohae joined #perl6
15:22 lizmat _nadim: yes it is
15:22 lizmat it's the tiny data dumper, so tiny it lost the t
15:23 tony-o MadcapJake: i'm not sure i'm understanding your question - the distribution stuff ugexe is working on will be able to select based on module/vendor/version/auth so that is in the works currently
15:24 tony-o the other part of your question, i don't know what that would look like from a repository side, how would you include all of the depends without explicitly packaging them as part of your module?
15:24 _nadim m: my %a = <a 1 b 2> ; my @l = (%a<a>, %a<c>:v) ;  dd @l ;
15:24 camelia rakudo-moar e57e63: OUTPUT«Array @l = [IntStr.new(1, "1"), ()]␤»
15:24 _nadim lizmat: it still returns a enpty list
15:25 timotimo _nadim: you need to fix the "width of terminal makes tests either fail or pass" thing, that's super unfortunate
15:25 _nadim timotimo: it done already ;)
15:25 ranguard ilmari: CPAN supports perl6... it's just downstream that has issues
15:26 ranguard mst is looking at those I think
15:26 _nadim i just needed to see if it was not something else on someone else's compuer
15:26 lizmat _nadim: why are you not using the slice?
15:26 lizmat %<a c>:v ?
15:26 _nadim because in reality I am using two different hashes.
15:26 lizmat ah, ok
15:27 lizmat m: my %a = <a 1 b 2> ; my @l = %a<a>, %a<c>:v; dd @l
15:27 camelia rakudo-moar e57e63: OUTPUT«Array @l = [IntStr.new(1, "1"), ()]␤»
15:27 lizmat m: my %a = <a 1 b 2> ; my @l = %a<a>, |%a<c>:v; dd @l
15:27 camelia rakudo-moar e57e63: OUTPUT«Unexpected named parameter 'v' passed␤  in block <unit> at /tmp/UhH15PHb_S line 1␤␤»
15:27 lizmat m: my %a = <a 1 b 2> ; my @l = %a<a>, |(%a<c>:v); dd @l
15:27 camelia rakudo-moar e57e63: OUTPUT«Array @l = [IntStr.new(1, "1")]␤»
15:27 lizmat _nadim: I guess for now you need to slip it
15:28 ranguard tony-o: not sure why people feel the need to re-implment a working distributed network with specific release control and archiving built in
15:28 ilmari ranguard: downstreams as in (meta|search\.)cpan?
15:28 Woodi that's idiotic what Kik lawyers did... story: there is students pub/disco/club in my university town named 'Imperial'. And that club was first opened somewhere in the soc-realism era (70s probably). Of course censors intervened... "How you can name something like that ?? That's worse then capitalism !!!1". But then one of the students showed them *few* labels of products named 'Imperial', one of them was popu
15:28 MadcapJake ranguard: cpan is a distributed network?
15:28 ranguard ilmari: cpan testers / irc bots etc
15:29 Woodi lar canned fish :)  so lawyers ...
15:29 Woodi ... just interned-killed that Kik-something...
15:29 ilmari ranguard: ah
15:29 ranguard MadcapJake: mirrored on 235 servers around the world
15:29 _nadim lizmat: hmm, no it comes from the same hash, I was wrong. but still, it is goodto know for next time. now, what do you mean with "slip it"?
15:29 ranguard MadcapJake: https://metacpan.org/mirrors
15:30 lizmat prefix it with |
15:30 Woodi 'C' is from 'Cloud' ? :)
15:30 ilmari Woodi: no, but N is for Network
15:30 timotimo _nadim: is it? i just ran "panda install Data::Dump::Tree" in a narrow terminal ("only" half of one of my screens) and it failed
15:30 Woodi ah ;)
15:30 ilmari Comprehensive Perl Archive Network
15:30 ilmari it long predates "cloud"
15:30 ilmari it's just a network of mirrors
15:31 MadcapJake ranguard: but is that really distributed? npm has mirrors all around the world too
15:31 ranguard MadcapJake: backpan never deletes
15:32 ilmari MadcapJake: and CPAN mirrors are run by disparate organisations and individuals, whereas AIUI all the npm mirrors are run by NPM, Inc
15:32 ranguard there are at least 4 backpans that I know off, and that doesn't count the tools built around CPAN (CPAN::Mini, Carton etc) that let you run your own easily
15:32 Woodi npm use some specific license ?
15:33 ranguard this is a solved problem.. (ok, there are edges that could be better) but I've not seen a better RUNNING solution
15:34 tony-o ranguard: what do you mean re-implement a working distributed network?  are you referring to cpan?
15:35 ranguard tony-o: yea
15:37 tony-o ranguard: i'm sure some of that need is the lack of gui type tools, plus it isn't 'pretty'
15:39 stmuk_ I think CPAN can be used as a backend but the requirements for perl 6 module installation are very different to perl 5 and the devil is in the details
15:39 RabidGravy yeah it's the tools not the storage that are at issue
15:41 MadcapJake tony-o: gx downloads packages/modules to a vendor directory in your workspace and I'd like to have perl6 compile into this vendor directory instead of the global dir, could I just dynamically change RAKUDO_PRECOMP_DIST for each workspace?
15:42 mst I'd also note that the last time somebody tried legal shit on us, they called me in, and http://p3rl.org/Nagios::Plugin was the result
15:43 mst it helps when the people running your centralised SPOF have a spine
15:43 tony-o MadcapJake: in zef (at least a long time ago) i wrote in a way to override the install dir to be local to the directory (like npm does).  i'd need to ask ugexe or dig through that code again to see if it still exists
15:44 tony-o MadcapJake: the result was having to add a relative dir to PERL6LIB environment var IIRC and it probably got taken out as a result
15:46 MadcapJake tony-o: I could have the gx-perl6 tool manage the PERL6LIB var
15:47 tony-o MadcapJake: it's most likely doable currently with a shell script, i'm not intimately familiar with gx but if were able to install a distro to a user's workspace and set their PERL6LIB var to that workspace then you'd be there
15:48 tony-o the module/auth/vers thing isn't working as expected yet, though afaik
15:49 ranguard tony-o: yea, people like the pretty :)
15:49 RabidGravy it works for "use" but not in the requires of a META.info afaik
15:51 ranguard RabidGravy: well, the storage not allowing things to easily dissapear kind'a helps :)
15:51 MadcapJake tony-o: awesome! gx provides a series of hooks for specific language tools to use (similar to npm builtin scripts) so I'd just need to do the perl6 specific stuff (compiling and changing PERL6LIB) and the gx tool will provide the interface to IPFS and the downloading
15:57 RabidGravy mst, strangely a monitoring framework is one of the things on my list
16:01 RabidGravy Hmm, it looks like I'm about to re-do a lot of the things that I'm doing for Sofa but for the icecast XML data rather than JSON
16:01 RabidGravy TIME FOR REFACTORING!
16:03 brrt joined #perl6
16:04 Juerd RabidGravy: I'd love a monitoring framework based on TAP. I wrote something in p5 and I actively use it, but I kind of abandoned the project.
16:06 Juerd http://pastebin.com/BeyFyWpe  # example of a test script I use for monitoring
16:07 zakharyas joined #perl6
16:07 Juerd This is also where the idea for an 'except' operator came from (line 23: @forum except 'www.wegenforum.nl')
16:08 Juerd This thing does both ipv4 and ipv6 so every test is actually two tests, unless "no ipv6;" or "no ipv4;" is in effect.
16:08 Juerd I've found many inconsistencies between ipv4 and ipv6 configs using this thing.
16:08 ugexe you can pick here it installs to, you just cant control where the precomp goes to
16:08 yoleaux 10:49Z <azawawi> ugexe: how do i force zef into fetching the latest sources for my repo... i updated META.info and tried 'zef update'. didnot work until i did a 'zef nuke StoreDir'
16:08 RabidGravy Looks nice
16:08 RabidGravy go for it
16:09 RabidGravy I'm mostly using monit these days
16:09 ugexe azawawi: `zef update`, or `zef update p6c` (to just update the normal ecosystem)
16:09 MadcapJake ugexe: there's no way to control where precomp goes?
16:09 Juerd RabidGravy: It's already on my wishful-thinking-to-do-list, but I'm afraid to mention tuits because someone might give me a wooden coin and except me to start working on it :P
16:10 Juerd s/except/expect/
16:10 ugexe MadcapJake: precomp location is determined by the CompUnit::PrecompilationRepository
16:10 MadcapJake ugexe: can I change it? :)
16:11 RabidGravy you can set $*REPO to something that does
16:11 ugexe MadcapJake: you could probably subclass CURI to use a custom CU::PrecompilationRepository
16:12 brrt joined #perl6
16:12 psch RabidGravy++
16:12 psch Audio::PortMIDI is fun
16:12 psch https://gist.github.com/peschwa/aaeb20debb7afb36c09b
16:13 psch ...note that the Positions enum clearly only fits onto ionian
16:13 ugexe getting it to precomp to a specific location you can do realatively easy though i believe. its the actual using of the location
16:13 MadcapJake ugexe: is that a viable way to do a local set of precomps?
16:13 RabidGravy psch, that almost looks like a module you have going there ;-)
16:14 ugexe MadcapJake: for a local set of precomps you are currently stuck with using ~/.perl6 afaik
16:14 psch Audio::DrunkPiano or what..? :P
16:14 RabidGravy :)
16:15 psch RabidGravy: fwiw, i'm not really happy with... most of it
16:15 psch as in, i have trouble thinking of a way to make it fit onto different modes
16:15 ugexe you can direct the directory of the precomp files via the first `-I` command
16:16 ugexe if you do -Ilib, it gets put in lib/.precomp. if you do -I. you get a .precomp. this can be abused
16:19 MadcapJake ugexe: oh I could totally use that, is there going to eventually be a facility to control precomp location?
16:19 ugexe nine has been working on precomp stuff, and i believe may have solved the $?FILE problem which may lead to using relative paths in precomp
16:20 araujo joined #perl6
16:20 ugexe and ive been working on internal Distribution stuff to allow a user to supply some of that type of functionality from the outside
16:20 ugexe so all that type of stuff will get an upgrade in the next few months i would imagine
16:21 ugexe i want to be able to have a FatPacked CompUnit::Repository, or even just a bundled
16:22 uvtc joined #perl6
16:23 uvtc What is the Perl-6-equivalent to Python's `for i,x in enumerate(arr): ...` (where `i` is the index and `x` is the elem)? That is, for the case where you want to iterate over an array but want the index too.
16:23 RabidGravy Now if I could just generalise this https://github.com/jonathanstowe/Sofa/blob/master/lib/Sofa/Method.pm to deal with xml as well as json then all would be good
16:24 SrKeys uvtc: for @a.pairs
16:24 ugexe @a.grep(*.so, :p)
16:24 jnthn m: my @arr = <a b c>; for @arr.kv -> $i, $v { say "$i = $v" }
16:24 camelia rakudo-moar e57e63: OUTPUT«0 = a␤1 = b␤2 = c␤»
16:25 SrKeys Oh right
16:25 SrKeys Kv
16:25 SrKeys Not pairs
16:25 SrKeys Doi
16:25 jnthn Well, paris does work too
16:25 jnthn *pairs
16:25 SrKeys I do prefer kv though
16:25 trnh joined #perl6
16:25 RabidGravy we'll always have Paris
16:25 uvtc Oi!
16:25 SrKeys Pairs makes me think it does .rotor(2)
16:25 uvtc Oui
16:25 SrKeys Rather than interleave the index
16:25 uvtc Thanks, @a.kv was what I was looking for.
16:26 SrKeys m: <a b c d>.pairs.say
16:26 camelia rakudo-moar e57e63: OUTPUT«(0 => a 1 => b 2 => c 3 => d)␤»
16:26 SrKeys Oh
16:26 SrKeys m: <a b c d>.kv.say
16:26 camelia rakudo-moar e57e63: OUTPUT«(0 a 1 b 2 c 3 d)␤»
16:27 SrKeys I see
16:28 uvtc left #perl6
16:29 SrKeys Rude
16:29 SrKeys Didn't stick around for good times
16:29 ugexe is there a better way to "take the .value of a Pair if its a string, otherwise assume .value is a hash and take .value.keys[0]" other than `$_.value ~~ Str ?? $_.values !! $_.values.keys[0]` ?
16:29 ugexe {"x
16:30 ugexe getting `y` from both: {"x" : "y" } {"x" : {"y" : "z"} }
16:31 ugexe the purpose of attaching arbitrary meta info to leaf node "y" (extending it for some subclass) while still allowing the first format to be understood
16:31 uvtc joined #perl6
16:31 SrKeys Maybe do some fun recursing traversing
16:32 ugexe the conditional above handles it. i was hoping there was some list operation though that could pull it off
16:32 lizmat ugexe: if it were the .values[0] of the list you're after
16:32 lizmat you could do something like $_.value.pairs[0].value
16:33 lizmat m: dd 42.pairs[0].value
16:33 camelia rakudo-moar e57e63: OUTPUT«42␤»
16:33 uvtc SrKeys, huh? Me rude? Thank you for the help. Unable to stay logged in ATM.
16:34 uvtc Plus, the good times never stop around here. It's 24-7. :)
16:34 tony-o mst: what happened with the nagios module?  i used that several years ago, iirc
16:34 SrKeys I was just joking uvtc
16:34 SrKeys :p
16:35 FROGGS NO LOL, NO PROJECT EULER
16:35 SrKeys Check out this fun recursing traversing https://gist.github.com/johnspurr/6e5b92102c342eea449d
16:35 uvtc left #perl6
16:35 mst tony-o: did you read the current tombstone release? I pretty much described it
16:36 SrKeys Ignore any poor form in there
16:36 SrKeys Or weird hacky bits
16:36 SrKeys It was just a quick script to make life easier
16:36 tony-o mst: tombstone release?  the document you linked to?
16:37 mst tony-o: yeah
16:38 mst I mean, like, the first two paragraphs basically summarise what went wrong originally
16:38 tony-o that's kind of a dumby [audible b] move from nagios
16:38 tony-o i liked their software, now they seem like a bunch of twats
16:38 sufrostico joined #perl6
16:39 mst yes, but they're forever doing things like that
16:40 mst Naemon is basically "the outside guy who did most of the work for Nagios Core 4 was summarily kicked off the project because he was being offered consulting work and they didn't want to share"
16:40 RabidGravy wasn't nagios something else before
16:40 tony-o i don't think it would be difficult to one up their software, configuration wise it is a bear and the concept of how they test is very simple
16:40 RabidGravy like ten or more years ago
16:40 mst http://www.legendiary.at/2014/01/23/nagios-more-drama-for-the-mama/
16:40 mst covers even more insanity
16:40 tony-o i like that title.
16:43 RabidGravy ah yes, netsaint
16:45 ggoebel16 joined #perl6
16:46 stmuk_ hasn't nagios been forked to something more open source now anyway?
16:46 mst it's been forked repeatedly
16:47 stmuk_ icinga
16:47 mst I literally just meantioned Naemon, the most recent one
16:47 mst and icinga, and there's at least one other I think
16:48 Khisanth joined #perl6
16:49 ugexe lizmat: my problem is when the leaf is also the root
16:49 ugexe m: sub foo($x) { $x.pairs[0].key }; say foo(%( :x(:y(1)) )); say foo(%( :x("y") )); say foo("y");
16:49 camelia rakudo-moar e57e63: OUTPUT«x␤x␤0␤»
16:49 ugexe m: sub foo($x) { $x.values[0] ~~ Str ?? $x.values[0] !! $x.values[0].keys[0]; }; say foo(%( :x(:y(1)) )); say foo(%( :x("y") )); say foo("y"); # ugly
16:49 camelia rakudo-moar e57e63: OUTPUT«y␤y␤y␤»
16:51 ugexe my Pairs example is flawed, but demonstrates what im looking for (Str can also be treated as a list, so hoping for some list method that would happen to align the stars to handle that)
16:54 shicheng joined #perl6
16:56 shicheng joined #perl6
16:56 * Woodi stuck somehow in Mon era...
16:59 shicheng joined #perl6
16:59 stmuk_ cricket!
17:01 RabidGravy goats!
17:01 sena_kun joined #perl6
17:02 trnh joined #perl6
17:03 RabidGravy Oooh a planetccrma RT kernel *the same version* as the stock kernel
17:03 RabidGravy that's never happened before
17:03 sena_kun joined #perl6
17:05 vendethiel joined #perl6
17:05 Xliff What is Match?
17:06 RabidGravy say ( "foo" ~~ /o/).perl
17:06 RabidGravy m: say ( "foo" ~~ /o/).perl
17:06 camelia rakudo-moar e57e63: OUTPUT«Match.new(ast => Any, list => (), hash => Map.new(()), orig => "foo", to => 2, from => 1)␤»
17:06 moritz the return value of a successful regex match
17:06 jkramer joined #perl6
17:06 jkramer Hello!
17:06 dalek ecosystem: 0853a27 | Altai-man++ | META.list:
17:06 dalek ecosystem: We have a snowball stemmer module in bindings.md, but not in the ecosystem.
17:06 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/0853a276f0
17:06 dalek ecosystem: e2801f2 | (Zoffix Znet)++ | META.list:
17:06 dalek ecosystem: Merge pull request #177 from Altai-man/master
17:06 Xliff Ah.
17:06 dalek ecosystem:
17:06 dalek ecosystem: Snowball module: See https://github.com/Sufrostico/perl6-snowball/
17:06 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/e2801f2bad
17:06 Woodi about installing from github: it's nice except commit granularity is to fine... and release too coarse - waiting a month is hard is some environments ;)  release is something to what devs should py attention so maybe tags can be used as when there is known good for users state of internals ?
17:07 SrKeys So risk-averse woodi
17:07 Woodi SrKeys: why ? :)
17:07 jkramer I want save some kind of action (would say code ref in p5) as attribute in an object and change it to some other callback every once in a while. How do I do that in p6?
17:08 SrKeys jkramer: probably just have an attribute &foo
17:08 SrKeys And store a callable in it
17:08 jkramer I currently have a "has Callable $.action" in the class but it dies with "Cannot modify an immutable Callable" whenever I want to change it
17:08 SrKeys Why not
17:08 moritz jkramer: you have to make it 'is rw' to able to change it from the outside
17:08 SrKeys has &.foo
17:09 SrKeys Oh right
17:09 SrKeys That too
17:09 jkramer I'm in the inside though - kind of
17:09 RabidGravy m: class D { has &.foo is rw = sub { say "foo" } }; my $d = D.new; $d.foo.();  $d.foo = sub { say "bap" };  $d.foo.();
17:09 camelia rakudo-moar e57e63: OUTPUT«foo␤bap␤»
17:09 moritz jkramer: then you need to assign to the ! form
17:10 moritz jkramer: so &!foo = ...; instead of &.foo = ...;
17:10 jkramer One problem might be that the callback itself needs to be able to change the callback attr to a new callback. I guess that's outside?
17:10 moritz jkramer: yes, unless the callback code is also on the inside
17:10 jkramer The callback is called by the object
17:10 jkramer And is also defined by a method of the object
17:11 jkramer Ah, just adding the "is rw" seemed to help. It still crashes, but it seems to be a different problem now :)
17:11 jkramer Thanks!
17:12 virtualsue joined #perl6
17:20 araujo_ joined #perl6
17:23 Xliff Is anyone on the "panda look" bug where it blocks further execution "perl6" in interactive shell mode?
17:25 pmurias joined #perl6
17:25 hoelzro Xliff: I opened an editor before I went to work with the intent of looking at it after work
17:25 hoelzro granted, I have a social thing after work tonight, so no promises there =/
17:25 pmurias hi
17:25 hoelzro o/ pmurias
17:26 Xliff hoelzro: No problems. Thanks for answering. I ran into that one, yesterday.
17:26 Xliff If I could help, I would. :/
17:26 hoelzro I remember!
17:27 Xliff A feature request for panda would be to have the equivalent of "look" that -doesn't- require the sub-shell.
17:27 Xliff Like I want to download and inspect the sources in a more permanent manner.
17:28 Xliff I'm kinda in that situation, right now.
17:29 stmuk_ just "panda info" and git clone the url?
17:29 stmuk_ actually that would make a useful new option IMO
17:29 Xliff Huh! Didn't think about it that way, but yes.
17:30 Xliff "panda inspect"
17:30 RabidGravy but without the subshell you won't be in the directory when panda exits
17:31 hoelzro I think `panda get $module` that downloads and prints the destination directory would be nice
17:34 sena_kun Also, about panda's options. Is it modulary enough to write modules without knowing its all codebase? I'd like to write one or two, but I don't know is it needed and easy enough. Also, panda had some troubles with "remove module" option before, is it related to question?
17:43 RabidGravy you don't really need to know anything about panda to write a module
17:43 RabidGravy just make the META file correctly and you're good
17:44 sena_kun RabidGravy, no, I meant a different thing. I meant, for example, to write for panda some new feature to call it from a command line.
17:45 RabidGravy I don't understand the question then
17:47 stmuk_ sena_kun: if you want to add options to panda just try forking it and modifying the code
17:48 ugexe `zef fetch XXX` fetches and tells you where it extracts to
17:49 sena_kun stmuk_, oh, okay.
17:49 ugexe zef also allows you to write plugins for different stages of the install process that you can turn on/off with a custom command line option (--cpan or --/cpan for instance)
17:50 dalek doc: e9bbef9 | (John Gabriele)++ | doc/Language/control.pod:
17:50 dalek doc: Add `@foo.kv` example to `for` sample code.
17:50 dalek doc: review: https://github.com/perl6/doc/commit/e9bbef91d1
17:51 ugexe also uninstalls if the rakudo is a little newer than 6.c
17:51 shadowpaste joined #perl6
17:51 Xliff OK. So here's a question.
17:52 Xliff What would make a Match object equivalent?
17:52 Xliff $.orig, $.from, $.to are easy. It's $.made and $.CURSOR that confuse me.
17:53 moritz well, $a.made eqv $b.made
17:53 moritz CURSOR isn't all that intersting; the sub-captures are
17:55 Xliff Yeah. Thought so. How are the sub-captures represented. Thought those would be in $.CURSOR
17:55 Xliff I'm just poking through Match.pm for .... I dunno
17:55 Xliff Halibut
17:57 arnsholt Xliff: Let me answer with a different question: For what purpose do you want to compare match objects?
17:57 Xliff eqv?
17:57 Xliff Doesn't exist yet.
17:58 Xliff There would be recursion, I would expect.
17:58 skids https://gist.github.com/skids/d1552470ba7c4ca6d318 might help but might have some stale parts.
17:59 moritz Xliff: I'd expect there to be recursion in infix:<eqv>(Match, Match), yes
17:59 domidumont joined #perl6
18:00 moritz because Match is basically a tree
18:00 Xliff Yeah.
18:00 travis-ci joined #perl6
18:00 travis-ci Doc build failed. John Gabriele 'Add `@foo.kv` example to `for` sample code.'
18:00 travis-ci https://travis-ci.org/perl6/doc/builds/118040250 https://github.com/perl6/doc/compare/8fa7964e9fa9...e9bbef91d198
18:00 travis-ci left #perl6
18:00 z8 joined #perl6
18:00 Xliff And I'm trying to figure out how to descend it.
18:00 Xliff Or ascend it, if you are upside down.
18:01 johnP joined #perl6
18:02 pmurias jnthn: what makes a VMException stringify to the message?
18:02 tony-o mst: JC that's a lot of drama
18:02 tony-o especially for people trying to expand a community for free
18:03 mst tony-o: indeed
18:03 virtualsue joined #perl6
18:04 jnthn pmurias: Hm, perhaps that smart_stringify thingy
18:05 pmurias jnthn: thanks
18:05 pochi joined #perl6
18:06 jevin joined #perl6
18:14 araujo joined #perl6
18:17 araujo joined #perl6
18:17 araujo joined #perl6
18:27 abaugher joined #perl6
18:28 jkramer How does p6 feel about circular dependencies lately? I just noticed it'll use up lots of CPU and hang when two modules use each other, but then again I noticed I'm moar-2015.12.
18:28 jkramer Just upgrading, but will that fix it? Should I open a report?
18:29 cdg joined #perl6
18:29 jkramer Seems to be still open: https://rt.perl.org/Public/Bug/Display.html?id=126688
18:30 moritz the fix will be a better error message
18:32 jkramer Hmm, guess I need to find another way to do it.
18:32 moritz aye
18:32 psch idk, i think prevent an obvious circular dependency from eating all memory is something we maybe should consider
18:33 psch as in, Foo.pm with "use Bar;" and Bar.pm with "use Foo;" doesn't seem like it should eat all my memory
18:33 Juerd I think it should fail gracefully.
18:33 Juerd Or be handled in a sane way, if that's at all possible.
18:34 Juerd But death by infinite loop isn't a nice thing :)
18:34 psch on the other hand we do accept similar things with recursion or regex, so maybe modules are just something i don't recognize the obvious pitfall as one
18:37 jkramer Meh, now I have to think about my OOP design instead of getting my stuff done :D
18:38 jkramer A global variable might solve all my problems
18:39 RabidGravy or define the two classes in the same scope so you can predeclare with a stub
18:41 psch or a global stub that you inject into Any /o\
18:42 RabidGravy :)
18:42 _nadim joined #perl6
18:42 telex joined #perl6
18:42 jkramer They all don't feel right, it's like working around obstacles the language creates for no reason. I mean, there are probably good reasons for not allowing circular deps, but I don't know 'em :)
18:43 RabidGravy if they are so tightly coupled it doesn't make sense to me for them to be in different files
18:43 psch jkramer: the fact that the ticket (#126688 that is) exists means to me that it's not something that's finished
18:43 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=126688
18:44 jkramer What would be a good OOP design for this situation: I have a server class which can have x client sessions as an array attribute. However the clients need to access the server object in order to communicate with other clients.
18:45 jkramer psch: Yeah but as moritz said, the solution will be an error message
18:46 skids define a role containing the functions that a client should be using from the server, in a third file.  Use that as the type contraint on Client.server
18:46 RabidGravy yeah, that was my third option
18:46 skids (or visa versa client/server)
18:46 RabidGravy but
18:47 psch jkramer: right.  practically, i'd go with what RabidGravy suggests; e.g. < unit module Thingy; class Thingy::Server { ... }; class Thingy::Client { ... } > or somesuch
18:47 jkramer BTW the server is a singleton and all I need to use the server class for is to get the instance method :)
18:47 Xliff Is uniq still in perl6?
18:47 RabidGravy m:  module Thing { class Server { ... } ;  class Client { has Server $.server; }; class Server { has Client @.clients };
18:47 camelia rakudo-moar e57e63: OUTPUT«5===SORRY!5=== Error while compiling /tmp/GuhMBeAyc4␤Missing block␤at /tmp/GuhMBeAyc4:1␤------> 3; class Server { has Client @.clients };7⏏5<EOL>␤»
18:48 RabidGravy m:  module Thing { class Server { ... } ;  class Client { has Server $.server; }; class Server { has Client @.clients; };
18:48 camelia rakudo-moar e57e63: OUTPUT«5===SORRY!5=== Error while compiling /tmp/L2IWVi9MvJ␤Missing block␤at /tmp/L2IWVi9MvJ:1␤------> 3 class Server { has Client @.clients; };7⏏5<EOL>␤»
18:48 RabidGravy m:  module Thing { class Server { ... } ;  class Client { has Server $.server; }; class Server { has Client @.clients; } };
18:48 camelia rakudo-moar e57e63: ( no output )
18:48 RabidGravy too many curlies
18:48 psch RabidGravy: that's why i left two out!
18:48 jkramer RabidGravy: Still doesn't feel right because both classes are fairly big and complex, but I guess it's the best solution now
18:48 RabidGravy or what skids said
18:49 RabidGravy define roles in separate files and use that as a typeconstraint
18:49 RabidGravy that has a side benefit
18:49 skids Well, with a singleton just used as a handle, I'd just go with a global, personally.
18:50 psch Xliff: .unique is
18:50 psch Xliff: the hummanization was deemed not worth it, *nix legacy not withstanding
18:51 psch err, huffmanization
18:53 Xliff LOL
18:53 Xliff OK. Next question. Can you manually enter subroutines in perl6 interractive mode?
18:54 edenc_ joined #perl6
18:54 hobbified joined #perl6
18:54 Xliff If not, I will script. Probably easier.
18:55 psch Xliff: you can define subs in the REPL, yes
18:55 skids I believe recent enough rakudos can multi-line as well.
18:55 psch skids: isn't that still in a branch?
18:55 arcetera joined #perl6
18:55 ilmari joined #perl6
18:55 skids I thought part of it was merged with more left in a branch?
18:55 skids Maybe I am wrong.
18:55 gabiruh joined #perl6
18:56 mojca joined #perl6
18:56 alnewkirk joined #perl6
18:56 broquaint joined #perl6
18:56 skids > sub a {
18:56 skids * 1.say
18:56 skids * }
18:56 skids sub a () { #`(Sub|74101808) ... }
18:56 psch huh
18:57 xiaomiao joined #perl6
18:57 psch hm, the repl6 branch has a commit today though
18:57 skarn joined #perl6
18:57 psch so yeah, probably the base mechanism merged already and hoelzro++ keeps expanding it
18:57 eyck joined #perl6
18:57 hoelzro the multi-line stuff is in nom
18:58 skids Or redoing the hacky bits better.
18:58 hoelzro repl6 is the REPL re-implemented in Perl 6 instead of NQP
18:58 psch hoelzro: ohh, okay
18:58 skids OHAI hoelzro :-)
18:58 hoelzro I'm going to merge repl6 back into nom after 2016.03 goes out, in case it blows up =)
18:58 hoelzro o/ skids
18:58 psch hoelzro: does repl6 still have the BEGIN hangup?
18:58 awwaiid nom nom nom
18:58 psch or was that already solved anyway..?
18:58 hoelzro psch: which BEGIN hangup?
18:59 psch as in, a BEGIN somewhere during a multi-line input reevaluates the BEGIN for every new line
18:59 hoelzro yes
18:59 hoelzro I'm only working on low hanging fruit atm =)
18:59 psch yes solved or yes still there?
18:59 psch oh, so yes still there
18:59 psch :)
19:00 hoelzro if you want to know what I've done vs not: https://gist.github.com/hoelzro/6bb9aa5163c7f79016ff
19:01 sftp joined #perl6
19:01 * awwaiid still wants MY::repl for that list :)
19:02 hoelzro awwaiid: feel free to fork that gist and send it to me so I can merge it in =)
19:02 Bucciarati joined #perl6
19:03 uvtc joined #perl6
19:03 labster joined #perl6
19:03 awwaiid hoelzro++ # open source life
19:03 araujo_ joined #perl6
19:04 uvtc Hi, #perl6. I made a tiny commit earlier to the docs, but then the doc build broke. I didn't think my change would break anything. Anyone know what the cause of the breakage was?
19:04 xinming joined #perl6
19:06 tony-o zef seems to install from a gitlab repo without any issues, does panda install from a url - is there an easy way to test that without mucking up the module ecosystem?
19:06 SrKeys anyone else doing google codejam in perl 6
19:06 SrKeys ?
19:06 psch yeah, the gist is impressive
19:06 SrKeys idk if anyone here is into code jam
19:06 tadzik tony-o: if you feed it a git-like url it will probably install it
19:06 tadzik tony-o: or used to :P
19:09 [Coke] uvtc: one moment.
19:09 tony-o tadzik: hmm, doesn't seem to like that
19:09 uvtc Thanks, [Coke]. The Travis report is at <https://travis-ci.org/perl6/doc/builds/118040250>. That log makes it look like it does an entire new rakudo/moar build just to then build the docs with it.
19:10 [Coke] looks like a segfault running make html.
19:11 [Coke] if I run it locally, it gets past that point, however.
19:11 [Coke] if the docs get updated, don't worry about it, if it seems like the site doesn't get updated, then we can worry.
19:11 olinkl_ joined #perl6
19:11 mithaldu__ joined #perl6
19:13 uvtc [Coke]: well, the doc I edited was updated, and the site shows the update. Thanks.
19:13 labster1 joined #perl6
19:14 zacts_ joined #perl6
19:14 cxreg2 joined #perl6
19:15 camelia joined #perl6
19:16 awwaiid hoelzro: well... forking your gist seemed like a good idea, but I have no idea how to PR against it now. https://gist.github.com/awwaiid/338cc538f660f95ff7a5
19:16 hoelzro awwaiid: I think I'll have to merge them by hand, which is ok
19:16 hoelzro thanks!
19:17 awwaiid :)
19:17 shadowpaste0 joined #perl6
19:17 silug joined #perl6
19:18 Hotkeys_ joined #perl6
19:19 risou_ joined #perl6
19:19 roguelazer_ joined #perl6
19:19 gabiruh joined #perl6
19:19 retupmoca joined #perl6
19:20 tadzik tony-o: ah crap :(
19:20 awwaiid Hotkeys_: I didn't know you could do it in other languages
19:20 arnsholt joined #perl6
19:20 dalek joined #perl6
19:21 tadzik tony-o: even if the url starts with "git://"?
19:22 solarbunny joined #perl6
19:23 skarn joined #perl6
19:23 tony-o i'll give it a shot once i finish this pre-build image of moar/p6 for travis
19:23 awwaiid Hotkeys_: ah, any language it looks like. nice
19:24 tony-o tadzik: i tried it with https://
19:24 tony-o it looked like it was just searching that package listing for a module with the name 'http ... '
19:25 tadzik yeah, the code just checks for leading "git://". Suboptimal
19:25 tony-o i'll give it a go with git://
19:29 teatime joined #perl6
19:33 uvtc left #perl6
19:36 firstdayonthejob joined #perl6
19:50 virtualsue joined #perl6
19:52 FROGGS joined #perl6
19:54 maybekoo2 joined #perl6
19:57 Xliff How's this for the start of a Match eqv? It's raw since I had to keep the debugging code in, but my simple test case works -- http://pastebin.com/ct76gh5H
19:58 Xliff I'm sure there's a Better Way to Do It, but I'm only 2 perl6 days old.... =)
19:58 moritz Xliff: missing $a.made eqv $b.made
19:59 Xliff *sob*
19:59 Xliff Adding
19:59 Xliff Fixed
19:59 moritz Xliff: the .list comparison is unreliable
20:00 Xliff Yeah, but since Match is comprised of both, that was the best way I could figure out how to do it.
20:00 moritz Xliff: if $a.list is false but $b.list isn't, it returns a match when it shouldn't
20:00 Xliff Ah! That I can solve.
20:01 psch m: my $m = "abc" ~~ /$<a>=a (b)/; say $m.list; say $m.hash # .list and .hash also aren't exclusive
20:01 camelia rakudo-moar e57e63: OUTPUT«(「b」)␤Map.new((:a(Match.new(ast => Any, list => (), hash => Map.new(()), orig => "abc", to => 1, from => 0))))␤»
20:01 moritz Xliff: if you call it as multi sub infix:<eqv> instead of sub MatchCheck, you can recursive into eqv directly
20:02 moritz Xliff: $a.list eqv $b.list
20:02 Xliff moritz: That is the eventual plan.
20:02 psch ...but maybe i've not been reading closely enough
20:02 moritz Xliff: then you don't need to check for truthiness of the lists at all
20:03 Xliff OK.
20:03 moritz Xliff: and you can also recurse into $a.hash eqv $b.hash, I think
20:04 moritz so the whole thing can be be boiled down to  the simple attribute check && $a.list eqv $b.list && $a.hash eqv $b.hash
20:04 Xliff OK. So I overthought the heirarical comparison, then.
20:05 moritz the beauty of recursion and multis :-)
20:13 Xliff OK. Updated
20:13 Xliff Tests still work. I will try moar tests and see if I can get it to break.
20:15 Xliff Actually, if this works, I won't need to explicitly reference the array elements at the end...
20:18 Xliff Here's a thought.
20:18 Xliff Should the following two regexs be equiv?
20:18 Xliff my regex yyy { ($<t1> = [aa] ) ($<t2> = a) a } ;
20:18 Xliff my regex zzz { ($<t1> = [aa] ) ($<t2> = a) a } ;
20:19 Xliff So:
20:19 Xliff my $m3 = $string ~~ m:g/<yyy>/;
20:19 Xliff my $m4 = $string ~~ m:g/<zzz>/;
20:19 Xliff $m3 eqv $m4 # True or False???
20:20 yqt joined #perl6
20:23 psch Xliff: fwiw, they look textually identical here..?
20:24 psch well, except for the name
20:24 psch so, i guess that's a good question... :)
20:25 edenc joined #perl6
20:27 gabiruh joined #perl6
20:27 teatime joined #perl6
20:29 psch hm, but Regex eqv Regex is different than Match eqv Match
20:29 tony-o hi all - i have a nightly build of rakudo (via rakudobrew) being pushed to repo https://github.com/tony-o/perl6-travis-bin.git - you're welcome to clone and use this repo for travis testing if, like me, you're impatient and don't care about testing your modules on JVM -
20:29 tony-o see the sample.travis.yml  for how to use the repo
20:30 psch Xliff: take that to mean that i personally don't have an opinion whether the Regexen themselves should be equivalent, but i do think the Match objects returned against identical Str should be equivalent
20:32 Xliff psch: OK, that means that the Match equivalence test should eleminate the rexexp name from the test, which my current implementation doesn't.
20:33 Xliff I would posit that you are correct Regexp yyy and zzz are equivalent, but ($m3 eqv $m4) are not.
20:33 psch m: say ("foo" ~~ my regex baz { .+ }).perl;
20:33 camelia rakudo-moar e57e63: OUTPUT«Match.new(ast => Any, list => (), hash => Map.new(()), orig => "foo", to => 3, from => 0)␤»
20:33 colomon joined #perl6
20:33 psch the Match object doesn't contain any reference to the producing regex
20:34 psch Xliff: ...i'm pretty sure i said almost the exact opposite.  the Match objects should be equivalent, but the equivalence of the Regex objects depends on whether the name matters
20:34 Xliff m: $a = "foo" ~~ my regex bas { .+ }); say $a.perl
20:34 camelia rakudo-moar e57e63: OUTPUT«5===SORRY!5=== Error while compiling /tmp/ByeYvEIfWH␤Variable '$a' is not declared␤at /tmp/ByeYvEIfWH:1␤------> 3<BOL>7⏏5$a = "foo" ~~ my regex bas { .+ }); say ␤»
20:34 psch m: no strict; $a = "foo" ~~ my regex bas { .+ }); say $a.perl
20:34 camelia rakudo-moar e57e63: OUTPUT«5===SORRY!5=== Error while compiling /tmp/M0b2Hcpzjh␤Unexpected closing bracket␤at /tmp/M0b2Hcpzjh:1␤------> 3trict; $a = "foo" ~~ my regex bas { .+ }7⏏5); say $a.perl␤»
20:35 Xliff m: ($a = "foo" ~~ my regex bas { .+ }); say $a.perl
20:35 camelia rakudo-moar e57e63: OUTPUT«5===SORRY!5=== Error while compiling /tmp/QWfAoZKLiA␤Variable '$a' is not declared␤at /tmp/QWfAoZKLiA:1␤------> 3(7⏏5$a = "foo" ~~ my regex bas { .+ }); say ␤»
20:35 Xliff m: (my $a = "foo" ~~ my regex bas { .+ }); say $a.perl
20:35 camelia rakudo-moar e57e63: OUTPUT«Match.new(ast => Any, list => (), hash => Map.new(()), orig => "foo", to => 3, from => 0)␤»
20:35 Xliff m: (my $a = "foo" ~~ my regex bas { .+ }); say $a.hash
20:35 camelia rakudo-moar e57e63: OUTPUT«Map.new(())␤»
20:35 Xliff m: (my $a = "foo" ~~ my regex bas { .+ }); say $a.list
20:35 camelia rakudo-moar e57e63: OUTPUT«()␤»
20:35 Xliff Hmmm....
20:35 psch it doesn't capture anything
20:35 tony-o zero door handles in this building open upwards, this is a hostile work environment
20:35 tony-o oops, not meant for this channel
20:36 Xliff m: (my $a = "foo" ~~ my regex bas { [.+ ]}); say $a.perl
20:36 camelia rakudo-moar e57e63: OUTPUT«Match.new(ast => Any, list => (), hash => Map.new(()), orig => "foo", to => 3, from => 0)␤»
20:36 psch m: no strict; $a = "foo" ~~ my regex bas { $<f>=f (oo) }; say $a.perl
20:36 camelia rakudo-moar e57e63: OUTPUT«Match.new(ast => Any, list => (Match.new(ast => Any, list => (), hash => Map.new(()), orig => "foo", to => 3, from => 1),), hash => Map.new((:f(Match.new(ast => Any, list => (), hash => Map.new(()), orig => "foo", to => 1, from => 0)))), orig => "foo", to …»
20:36 psch m: no strict; $a = "foo" ~~ my regex bas { $<f>=f (oo) }; say $a.list; say $a.hash
20:36 camelia rakudo-moar e57e63: OUTPUT«(「oo」)␤Map.new((:f(Match.new(ast => Any, list => (), hash => Map.new(()), orig => "foo", to => 1, from => 0))))␤»
20:36 Xliff OK, that's odd.
20:36 Xliff The regex name is definitely getting captured in my Match objects
20:36 psch the point of note is that the Match object does not know that the Regex it comes from has a name
20:37 psch Xliff: gist and then m: it?
20:37 psch 'cause that'd be interesting :)
20:38 Xliff Oh.
20:39 dalek ecosystem: 7381a1e | tony-o++ | META.list:
20:39 dalek ecosystem: flow multiplex testing with full flex
20:39 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/7381a1e993
20:40 Xliff m: my $a = "foo"; my regex bas { [.+ ]}; my $m = $a ~~ m/<bas>/; say $m.perl
20:40 camelia rakudo-moar e57e63: OUTPUT«Match.new(ast => Any, list => (), hash => Map.new((:bas(Match.new(ast => Any, list => (), hash => Map.new(()), orig => "foo", to => 3, from => 0)))), orig => "foo", to => 3, from => 0)␤»
20:41 Xliff So in the examples I was using the regex is used as a named capture.
20:41 psch m: my $a = "foo"; my regex bas { [.+ ]}; my $m = $a ~~ m/$<foo>=<.bas>/; say $m.perl
20:41 camelia rakudo-moar e57e63: OUTPUT«Method 'bas' not found for invocant of class 'Cursor'␤  in block <unit> at /tmp/9ChDRQcRx1 line 1␤␤»
20:41 Xliff THAT's why its showing up in my Match objects.
20:41 psch hrm, almost :)
20:41 psch m: my $a = "foo"; my regex bas { [.+ ]}; my $m = $a ~~ m/$<foo>=<&bas>/; say $m.perl
20:41 camelia rakudo-moar e57e63: OUTPUT«Match.new(ast => Any, list => (), hash => Map.new((:foo(Match.new(ast => Any, list => (), hash => Map.new(()), orig => "foo", to => 3, from => 0)))), orig => "foo", to => 3, from => 0)␤»
20:42 psch Xliff: yeah, using a regex as <foo> binds to a named capture.  the above example shows one way around that
20:42 Xliff OK. So I mis-stated my test, above.
20:42 psch (note that inside a grammar you'd probably use <.bas> instead as in my failed attempt.  <&foo> looks up lexicals, while <.foo> looks up methods)
20:43 Xliff So $m3 eqv $m4 IS false since different name captures are used.
20:44 psch Xliff: yes, but that obliges you to add a test that binds to a identically named capture and test that those *are* eqv :)
20:44 Xliff m: say ("foo" ~~ my regex baz { .+ }); say ("foo" ~~ my regex bar { .+ });
20:44 camelia rakudo-moar e57e63: OUTPUT«「foo」␤「foo」␤»
20:44 psch m: my regex baz { .+ }; say "foo" ~~ &baz
20:44 camelia rakudo-moar e57e63: OUTPUT«「foo」␤»
20:44 Xliff psch: True. And I will have to do that.
20:45 psch ^^^ that was the idiom i was thinking of when i said they should be eqv, fwiw
20:45 Xliff But the match objects resulting from your initial example would still be eqv based on what I wrote since the name capture isn't used.
20:45 psch which, incidentally, is another bunch of test cases :)
20:45 Xliff YAY!
20:45 psch Xliff++
20:46 Xliff I'll spend more time writing test cases than I did the infix:<eqv>
20:46 Xliff *sigh* such is life.
20:49 Xliff OK
20:49 Xliff my $ml1 = $string ~~ my regex y1 { ($<t1> = [aa] ) ($<t2> = a) a };
20:49 Xliff my $ml2 = $string ~~ my regex y2 { ($<t1> = [aa] ) ($<t2> = a) a };
20:50 Xliff $ml1 eqv $ml2 #True
20:51 Xliff Oh, let me try that other idiom.
20:52 TimToady psch, Xliff: the other reason for the rename is that *nix's uniq doesn't actually do .unique, but .squish
20:52 Xliff TimToady, LOL. Didn't know that.
20:52 Xliff Hah!
20:53 Xliff psch: Idiom test also holds true.
20:53 Xliff my $ml3 = $string ~~ &yyy;
20:53 Xliff my $ml4 = $string ~~ &zzz;
20:53 Xliff $ml3 eqv $ml4 # True
20:54 Xliff And since matches turn out arrays, let me ditch the [0]s in my test cases and see if they still work.
20:56 Xliff Still working, although I am not seeing the say statements I emit in the infix:<eqv> sub as much as I'd expect.
21:12 TEttinger joined #perl6
21:29 Xliff Anyone have any more test cases for Match object eqv?
21:35 moritz m: say ('aaa' ~~ /a(..)/) eqv ('aaa' ~~ /a../)
21:35 camelia rakudo-moar e57e63: OUTPUT«False␤»
21:35 moritz m: say ('aaa' ~~ /a(..)/) eqv ('aaa' ~~ /a./)
21:35 camelia rakudo-moar e57e63: OUTPUT«False␤»
21:38 firstdayonthejob joined #perl6
21:38 colomon joined #perl6
21:39 Xliff moritz: You already have Match eqv?
21:41 cdg joined #perl6
21:43 Xliff Well shucks.
21:43 Xliff Match eqv is already in there.
21:43 Xliff Was a nice excercise in writing, though.
21:43 psch m: say ('aaa' ~~ /a(..)/) eqv ('aaa' ~~ /a(..)/)
21:43 camelia rakudo-moar e57e63: OUTPUT«True␤»
21:43 geekosaur joined #perl6
21:46 zakharyas joined #perl6
21:50 [Sno] joined #perl6
21:53 moritz Xliff: no, it's not there
21:54 moritz Xliff: it's just a fallback from (Any, Any), which gives wrong results
21:56 Xliff So should "('aaa' ~~ /a(..)/) eqv ('aaa' ~~ /a../);" return true?
21:56 Xliff Due to capture, I find that hard to believe.
21:56 firstdayonthejob joined #perl6
21:56 Xliff O. wait. () isn't capture anymore.
21:56 Xliff Hmmm...
21:57 Xliff Or is it.... Still looks like capture to mer.
21:57 Xliff s/r\.//
21:58 Xliff > ('aaa' ~~ /a(..)/)
21:58 Xliff 「aaa」
21:58 Xliff 0 => 「aa」
21:58 Xliff > ('aaa' ~~ /a../)
21:58 Xliff 「aaa」
21:59 xinming joined #perl6
22:00 Xliff moritz: Do you have an example where the (Any, Any) fails for Match eqv?
22:03 moritz m: say ('a' ~~ /./) ~~ ('a' ~~ /./)
22:03 camelia rakudo-moar e57e63: OUTPUT«「a」␤»
22:03 moritz m: say ('a' ~~ /./) eqv ('a' ~~ /./)
22:03 camelia rakudo-moar e57e63: OUTPUT«True␤»
22:03 moritz m: say ('a' ~~ /(.)/) eqv ('a' ~~ /(.)/)
22:03 camelia rakudo-moar e57e63: OUTPUT«True␤»
22:03 moritz hmmm
22:03 moritz m: say ('a' ~~ /(.)/) eqv ('ab' ~~ /(.)/)
22:03 camelia rakudo-moar e57e63: OUTPUT«True␤»
22:04 moritz Xliff: ^^ that should be False
22:04 moritz m: say ('a' ~~ /(.)/) eqv ('b' ~~ /(.)/)
22:04 camelia rakudo-moar e57e63: OUTPUT«True␤»
22:04 moritz it seems it comparse *only* the captures, but not the root node of the Match
22:04 moritz *compare
22:08 Sgeo__ joined #perl6
22:12 cpage_ joined #perl6
22:24 psch yeah, the one that should be False i definitely agree with.  the .orig is different and that should be reflected
22:25 labster joined #perl6
22:37 cpage_ joined #perl6
22:43 vendethiel joined #perl6
22:44 cpage_ joined #perl6
22:47 kid51 joined #perl6
22:48 geraud joined #perl6
22:48 cpage_ joined #perl6
22:50 cpage_ joined #perl6
22:56 Xliff my $t_im1 = ('aaa' ~~ /a(..)/) eqv ('aaa' ~~ /a../);
22:56 Xliff my $t_im2 = ('a' ~~ /(.)/) eqv ('ab' ~~ /(.)/);
22:57 Xliff $t_im1 = False / $t_im2 = False  # my Match eqv implementation
23:00 Ulti m: say [+] 1..9999999999999999
23:00 camelia rakudo-moar e57e63: OUTPUT«49999999999999995000000000000000␤»
23:00 Ulti ^ that is really quite fast compared to the more obvious things in Perl 5
23:01 Ulti not to mention bigint just works too
23:02 Ulti List::Util::sum(1..blah) goes nuts on bigger ranges on my laptop and a postfix for loop sum over the range takes ages
23:02 Ulti in Rakudo is that compiling down to anything special?
23:05 riatre joined #perl6
23:06 [Tux] joined #perl6
23:07 jack_rabbit joined #perl6
23:09 perlawhirl joined #perl6
23:09 perlawhirl hi perlers
23:09 perlawhirl i asked a question earlier but got no replies. being on aussie time means i'm usually in here when it's quiet
23:09 perlawhirl but anyways...
23:10 perlawhirl am i able to rename a method (eg. grep) to something else... or rather, create a method that basically points to grep
23:11 roguelazer joined #perl6
23:12 molaf joined #perl6
23:16 hobbs joined #perl6
23:18 perlawhirl it's times like these i need a tumbleweed unicode
23:18 AlexDaniel joined #perl6
23:22 labster joined #perl6
23:29 geekosaur I think someone did answer that question at one point, negatively
23:29 geekosaur there may be something hacky you can do with the MOP
23:30 geekosaur ...but I think that mixes in an anonymous role rather than changing the class
23:31 BenGoldberg joined #perl6
23:32 arcetera joined #perl6
23:33 BenGoldberg joined #perl6
23:33 perlawhirl yeah, i have a (probably misguided) design proposal and wanted to see if I could do it in a module first... though by the sounds of it I might not be smart enough :D
23:34 perlawhirl geekosaur: would you mind reading my ramblings and give me your opinion. https://gist.github.com/0racle/ea0523759e2da15758d4
23:35 geekosaur I'm probably the wrong person to do it. I am not a p6guts expert or anything like that
23:36 perlawhirl but from a user pov, do you think that seems nice
23:37 perlawhirl if it existed, would you use it instead of grep. i think i would, as it reads more like english
23:37 perlawhirl or am i just a weirdo ?
23:38 geekosaur I feel like grep is largely a concession to perl5, and there are other mechanisms in perl6 already? but I could be wrong
23:39 perlawhirl perhaps... like i said, i'm probably misguided (and a weirdo :D)
23:40 cpage_ joined #perl6
23:42 geekosaur joined #perl6
23:44 kid511 joined #perl6
23:52 zacts joined #perl6
23:56 cpage_ joined #perl6
23:57 johndau joined #perl6
23:59 cdg joined #perl6

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

Perl 6 | Reference Documentation | Rakudo