Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2015-06-22

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:33 lizmat joined #perl6
00:39 laouji joined #perl6
00:46 laouji joined #perl6
01:04 kurahaupo joined #perl6
01:07 jack_rabbit joined #perl6
01:11 tinyblak joined #perl6
01:12 laouji joined #perl6
01:21 pyrimidine joined #perl6
01:36 jack_rabbit_ joined #perl6
01:54 aborazmeh joined #perl6
01:54 aborazmeh joined #perl6
02:06 cognominal joined #perl6
02:15 noganex joined #perl6
02:17 Ben_Goldberg joined #perl6
02:38 rmgk_ joined #perl6
02:50 tinyblak joined #perl6
02:50 telex joined #perl6
03:07 CQ_ joined #perl6
03:52 tinyblak joined #perl6
03:58 zacts joined #perl6
04:18 lsm-desktop joined #perl6
04:21 _mg_ joined #perl6
04:39 cognominal joined #perl6
04:49 kaare_ joined #perl6
04:52 bakedb_ joined #perl6
04:53 tinyblak joined #perl6
04:54 tinyblak joined #perl6
04:58 tinyblak joined #perl6
05:01 bartolin joined #perl6
05:03 tinyblak joined #perl6
05:05 atroxaper joined #perl6
05:19 dalek roast: 9d5a3ec | usev6++ | S09-hashes/objecthash.t:
05:19 dalek roast: Add test for RT #125352
05:19 dalek roast: review: https://github.com/perl6/roast/commit/9d5a3ec119
05:23 laouji joined #perl6
05:33 atroxaper joined #perl6
05:46 Psyche^ joined #perl6
05:57 xinming_ joined #perl6
06:00 domidumont joined #perl6
06:01 spider-mario joined #perl6
06:05 domidumont joined #perl6
06:07 FROGGS joined #perl6
06:08 diana_olhovik_ joined #perl6
06:14 atroxaper Hello, #perl6 !
06:15 FROGGS morning
06:15 atroxaper Is it good that Grammar::Debugger fails test on Rakudo MoarVM 2016.06 ?
06:15 atroxaper FROGGS: o/
06:16 FROGGS not good most probably
06:16 atroxaper And Bailador too :(
06:17 tadzik oh noes
06:17 atroxaper I just tried to panda install Task::Star
06:18 dalek rakudo/nom: 164f1e0 | TimToady++ | src/Perl6/Grammar.nqp:
06:18 dalek rakudo/nom: fix @foo = $bar = 5, 10;
06:18 dalek rakudo/nom:
06:18 dalek rakudo/nom: Assignment is right associative, so the intent is that the righthand
06:18 dalek rakudo/nom: assignment pay attention only to it's immediate left arg as its left term.
06:18 dalek rakudo/nom: It would be incorrect to pay attention to treat the entire lefthand assignment
06:18 dalek rakudo/nom: as the target of the righthand assignment.
06:18 dalek rakudo/nom:
06:18 dalek rakudo/nom: The patch makes infix:sym<=> consume any $*LEFTSIGIL it finds, freeing up
06:18 dalek rakudo/nom: the next term to set its own $*LEFTSIGIL.
06:18 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/164f1e0701
06:20 TimToady .tell Zhtwn You're making it too difficult trying to work around a bug.  See http://irclog.perlgeek.de/perl6/2015-06-22#i_10784896
06:20 yoleaux TimToady: I'll pass your message to Zhtwn.
06:25 FROGGS m: say '<>'.ords
06:25 camelia rakudo-moar b95a22: OUTPUT«60 62␤»
06:28 FROGGS m: say 'äöüßÄÖÜ<>'.ords».fmt: '&#%d;'
06:28 camelia rakudo-moar b95a22: OUTPUT«&#228; &#246; &#252; &#223; &#196; &#214; &#220; &#60; &#62;␤»
06:28 jnthn TimToady: Well, that's a cute solution...
06:29 dalek roast: e6ff033 | TimToady++ | S03-operators/assign.t:
06:29 dalek roast: tests for @foo = $bar = 5, 10; working right
06:29 dalek roast: review: https://github.com/perl6/roast/commit/e6ff033b65
06:31 masak morning, #perl6
06:32 jnthn o/ masak
06:33 * TimToady waves from about 10 meters north of the Yellowstone River, which is loud
06:34 TimToady but not annoyingly so
06:34 jnthn :)
06:34 * jnthn wants to visit Yellowstone some day...
06:35 TimToady jnthn: did you see my suggestion that preclim pay attention to associativity to decide whether to match exactly?
06:35 jnthn TimToady: Yes, but I wasn't clever enough to work out exactly how to turn that into code yet ;)
06:35 jnthn Probably 'cus I was spending my cycles on figuring out how to put my apartment into boxes. :)
06:35 jnthn It sounded reasonable, anyways.
06:36 TimToady okay...I just have a sneaking suspicion it'll work out better for some case or other
06:37 cognominal joined #perl6
06:40 espadrine joined #perl6
06:40 * masak was implementing associativity in 007 during the weekend
06:40 masak there are a lot of things I like about Perl 6 operators (and defining them), but in 007 I brought in a bunch of simplifications, which I hope to blog about soon.
06:40 * FROGGS did some NativeCall stuff, which was fun
06:41 masak it surprised me a little that unary ops can have associativity... even though that bit's been in S03 since forever
06:41 * jnthn commutes to the office, so he can associate with colleagues... &
06:42 masak basically, from the point of view of precedence, prefixes and postfixes are considered together.
06:51 [Sno] joined #perl6
06:55 zakharyas joined #perl6
06:56 araujo joined #perl6
06:56 araujo joined #perl6
07:08 nwc10 jnthn: and help them brew better coffee?
07:10 kurahaupo joined #perl6
07:16 g4 joined #perl6
07:18 masak we do need some help with that.
07:18 espadrine_ joined #perl6
07:19 masak (we're also currently looking for Java, C#, Perl, and JavaScript/web developers. get in touch.)
07:23 espadrine joined #perl6
07:24 cognominal interesting, the use of emojis in atom commit messages : https://github.com/atom/atom/blob/master/CONTRIBUTING.md#git-commit-messages
07:26 masak ok, that is a cute use of the "penguin" character, I concede.
07:27 moritz "you think this is a cute penguin today" :-)
07:28 abraxxa joined #perl6
07:32 masak I do!
07:33 masak I guess someone could filter-branch away all the penguins in the future, if they turn out to be a really bad idea. but I doubt it.
07:35 jnthn nwc10: Well, my first attempt to pour coffee resulted in coffee outside of the cup...
07:35 nwc10 today?
07:35 jnthn Bootstrapping strikes again.
07:35 jnthn Yes. :P
07:35 nwc10 aha
07:35 jnthn Unfamiliar jug type. That's a good excuse.
07:35 nwc10 :-)
07:36 masak they look like designer jugs. almost encouraging misuse.
07:36 masak way too high a center of gravity.
07:37 moritz but did the designer add a cute penguin?
07:37 moritz .u penguin
07:37 yoleaux U+1F427 PENGUIN [So] (🐧)
07:37 nine .oO(now what would a real engineer's cup look like?)
07:39 moritz nine: I wanted to say "it's self-cleaning", but that would a violation of Separation of Concerns
07:44 nine moritz: so that's one property: modularity
07:44 nine I would appreciate a heating unit thats compatible with my mug
07:45 masak I think I would be happy with a mug that was robust and nice to hold.
07:47 domidumont joined #perl6
07:48 atroxaper joined #perl6
07:48 RabidGravy joined #perl6
07:50 moritz and standards compliant, so that it works with all standards-compliant coffee machines, dish washers, heating devices etc.
07:50 RabidGravy yawn! marnin!
07:50 moritz (and the ops guy in me says: there should be an easy way to monitor it; possibly via snmp)
07:51 masak ;)
07:51 masak actually I don't mind if it's all that standards-compliant. as long as it's not ridiculously un-compliant.
07:51 moritz good yawning, RabidGravy
07:57 darutoko joined #perl6
08:03 * cognominal notes that the ce marking (european conformity) logo does not seem to belong to Unicode. http://webmasters.stackexchange.com/questions/28299/what-is-the-html-code-for-ce-mark
08:03 abraxxa joined #perl6
08:04 cognominal Not sure if there is a european standard for mugs :)
08:04 DrForr U+212e maybe?
08:04 DrForr U+212E ESTIMATED SYMBOL - used in European packaging
08:05 nwc10 they should add it. and unify it with the "China Export" symbol :-)
08:06 nwc10 context: https://www.raspberrypi.org/easter-picture-post/
08:10 itz joined #perl6
08:10 pyrimidine joined #perl6
08:12 itz Good UGT
08:14 moritz joined #perl6
08:14 larion joined #perl6
08:14 DrForr joined #perl6
08:15 nine nwc10: looking at a couple of things lying on my desk, I wonder if even the manufacturers are aware of this subtle difference. Because I actually think they meant the Conformité Européenne mark instead of China Export. Especially with my iAudio player that's made in Korea.
08:18 masak "However, the European Commission says that this is a misconception." -- https://en.wikipedia.org/wiki/CE_marking#China_Export
08:18 salva joined #perl6
08:20 * vendethiel submitted his SPW talk
08:21 masak \o/
08:21 bliizZzards joined #perl6
08:22 dakkar joined #perl6
08:24 itz joined #perl6
08:25 itz joined #perl6
08:26 andreoss joined #perl6
08:28 laouji joined #perl6
08:29 silug_ joined #perl6
08:31 tadzik oh, right...
08:31 Ven joined #perl6
08:32 rarara joined #perl6
08:33 bin_005 joined #perl6
08:33 sqirrel joined #perl6
08:38 cognominal joined #perl6
08:41 domidumont joined #perl6
08:42 atroxaper joined #perl6
08:44 |Tux| today p6 was even slower than before :(
08:46 kaare joined #perl6
08:46 tadzik . o O ( dear diary )
08:47 tadzik . o O ( or is it dairy, I know one is funnier than the other... )
08:47 * itz considers patching the last star to ignore "unit"
08:49 masak tadzik: how appropriate! you fight like a journal!
08:49 tadzik :D
08:50 |Tux| :p for pipe seen at:
08:50 |Tux| src/gen/m-CORE.setting, line 18616
08:50 |Tux| Deprecated since v2015.6, will be removed with release v2015.9!
08:52 masak |Tux|: you're getting errors for things in the core setting? that seems harsh.
08:52 |Tux| this is a fresh rakudo build with fresh Inline::Perl5
08:52 |Tux| git pull about 5 minutes ago
08:54 moritz in IO::Handle:
08:54 moritz method pipe(IO::Handle:D: |c) {
08:54 moritz self.open(:p, |c);
08:54 moritz }
08:54 amurf joined #perl6
08:57 masak is that `pipe` method the one the deprecation message is suggesting you use?
08:57 |Tux| http://tux.nl/Files/20150622105714.png <= test-t once was below 36.0 - the last few days it is rising to over 40
08:57 |Tux| no changes to my code at all: I'm writinbg slides
08:58 itz |Tux|: thats a known problem with someone working on it see scrollback
08:59 masak there's a 'multi sub pipe' in src/core/io_operators.pm, which calls that method in IO::Handle, which uses the deprecated :p flag.
08:59 espadrine joined #perl6
09:08 RabidGravy related but tangential to that is there scope for "#file ..." type directives in the catted source so that it points to the actual source rather than the settings file?
09:08 brrt joined #perl6
09:12 RabidGravy m: class A { my $boo will leave { say "leaving boo" }; } # is this my usual monday morning stupid or broken?
09:12 camelia rakudo-moar 164f1e: OUTPUT«5===SORRY!5=== Error while compiling /tmp/9nfDPkobaI␤Method 'add_phaser' not found for invocant of class 'A'␤at /tmp/9nfDPkobaI:1␤»
09:28 masak RabidGravy: looks broken to me.
09:30 masak |Tux|: submitted it here: https://rt.perl.org/Ticket/Display.html?id=125454
09:32 |Tux| top
09:42 RabidGravy masak, if you're interested RT'd the above with https://rt.perl.org/Ticket/Display.html?id=125455
09:43 masak RabidGravy++
09:43 dalek modules.perl6.org: 8af90f1 | paultcochrane++ | web/index.tmpl:
09:43 dalek modules.perl6.org: Remove link to proto.json
09:43 dalek modules.perl6.org:
09:43 dalek modules.perl6.org: This is because the more up to date information is located at
09:43 dalek modules.perl6.org: http://ecosystem-api.p6c.org/ and keeping proto.json around is likely to
09:43 dalek modules.perl6.org: confuse people.
09:43 dalek modules.perl6.org: review: https://github.com/perl6/modules.perl6.org/commit/8af90f15c5
09:44 pmurias joined #perl6
09:44 pmurias hi
09:44 masak \o
09:44 Ven o/
09:44 masak RabidGravy: (until next time: it helps if you supply what Rakudo you're running. version/platform. that's part of the "steps to reproduce" data.)
09:44 pmurias do a lot of #perl6 people plan on coming to YAPC::EU?
09:45 masak pmurias: yes!
09:47 RabidGravy masak, it appears that the RT has custom fields for that information but they aren't available to edit
09:48 masak RabidGravy: I always just put it in the ticket body.
09:48 DrForr I'm speaking, kind of have to be there :)
09:48 masak RabidGravy: easiest way to remember to include it is to just copy the output from camelia.
09:48 masak m: say "OH HAI"
09:48 camelia rakudo-moar 164f1e: OUTPUT«OH HAI␤»
09:49 masak that 'rakudo-moar 164f1e' has all the requisite info
09:49 RabidGravy :)
09:51 * jnthn got an accepted talk at YAPC::EU also, so will be showing up ;)
09:53 * masak ditto
09:53 DrForr Oh, wonder if my other p6 talk got in then, should check.
09:53 * pmurias is planning on comming
09:54 DrForr And this time my way is paid for.
09:54 pmurias * coming
09:55 pmurias hopefully to also means to that nqp-js will be revived ;)
09:55 masak pmurias: oh! meant to ask you.
09:55 masak pmurias: have you seen the webasm news?
09:56 masak pmurias: and will this change things for nqp-js and rakudo-js?
09:56 masak (guessing "no", at least in the short term)
09:58 pmurias in the short term no
09:58 pmurias webasm is the first iteration at least is just a more concise asm.js version
09:59 pmurias and targeting asm.js is really equivalent to emitting raw native code
09:59 pmurias only more restricted
10:00 masak right.
10:00 masak thought so. :)
10:00 masak pmurias++
10:01 pmurias the features on the "long term" look very promissing
10:02 atroxaper Question: if I have token in grammar like this - token <a> { <b> (<c1> | <c2> | <c3>)+ <d> } - how can I iterate over elements in round brackets? Like $result<a>....
10:03 vendethiel atroxaper: [0], et
10:03 vendethiel etc*
10:03 atroxaper It's just for testing by eyes. I'm going to make Action for grammar.
10:03 pmurias as they plan to turn webasm into both a llvm backend (as it currently is) and a way to support high level languages
10:03 vendethiel m: 'abc' ~~ /(<[a..z]>)+/; say $0, $1, $2
10:03 camelia rakudo-moar 164f1e: OUTPUT«「a」 「b」 「c」NilNil␤»
10:04 vendethiel m: 'abc' ~~ /(<[a..z]>)+/; say $0[0], $0[1], $0[2] #whoops :) $0 is the whole ()
10:04 camelia rakudo-moar 164f1e: OUTPUT«「a」「b」「c」␤»
10:04 pmurias and Perl 6 seems to be something that goes back and forth between those two worlds
10:05 atroxaper vendethiel: Thanks. I'm gonna test that.
10:05 masak pmurias: yeah, it does look exciting. I'm left wondering how much webasm will end up toppling JavaScript from its current position as "you must pass through me to do web things"
10:06 pmurias replacing asm.js seems fairly easy
10:06 masak oh, sure.
10:07 espadrine for some uses, js was an implementation detail
10:07 pmurias having something that can both support a c++ and a javascript style language efficently seems a hard problem
10:10 espadrine they have supporting gc languages as a long-term goal, too
10:13 itz m: EVAL "use Pod::To::Text";  say Pod::To::Text.new.WHAT
10:13 camelia rakudo-moar 164f1e: OUTPUT«Could not find symbol '&Text'␤  in block <unit> at /tmp/ZnHOqfeRF2:1␤␤»
10:15 pmurias it could be useful to sneak to sneak in an agent of ours into the the webasm council (which might just be a bunch of people hacking on it on github ;) ) to try to influence it into something Perl 6 can efficently target
10:15 pmurias :)
10:18 espadrine they'll definitely be looking for that feedback
10:22 * btyler joins the 'got a talk accepted at ::EU' party
10:23 jaffa4 joined #perl6
10:23 domidumont joined #perl6
10:24 jaffa4 hi all
10:24 jaffa4 Is unit implemented?
10:24 jaffa4 My code does not seem to compile
10:25 itz do you mean uniq ;)
10:25 RabidGravy or
10:26 Vlavv joined #perl6
10:26 jaffa4 there is such a thing as unit declarator
10:26 RabidGravy m: unit module Foo;
10:26 camelia rakudo-moar 164f1e: ( no output )
10:26 RabidGravy as opposed to
10:26 RabidGravy m: module Foo { }
10:26 camelia rakudo-moar 164f1e: ( no output )
10:27 RabidGravy ?
10:27 jaffa4 I downloaded the latest rakudo start
10:27 jaffa4 It get a compilation error
10:27 RabidGravy in what way?
10:28 nine Seems like I really should get my act together and submit my talk proposals. Now I've just to come up with a good title...
10:28 jaffa4 Undeclared routine:  Did you mean 'uniq'?
10:28 RabidGravy jaffa4, you need to show the code too
10:28 nine jaffa4: you're on rakudo star? That doesn't support unit yet.
10:28 itz jaffa4: that sounds like the last star not the last rakudo release
10:28 RabidGravy (or the smallest part that can be made to fail)
10:29 jaffa4 yes, rakudo star
10:30 itz rakudo star is broken with many modules now
10:31 jaffa4 Is there compilation for the lastest version for rakudo on Windows?
10:32 RabidGravy isn't there a * release coming up RSN?
10:33 itz I think Task::Star mostly works with the current rakudo with the exception of Bailador
10:35 brrt joined #perl6
10:41 atroxaper joined #perl6
10:42 itz hmmm the REPL seems to ignore -I
10:43 rudi_s joined #perl6
10:43 tardisx joined #perl6
10:43 hobbs joined #perl6
10:43 sqirrel joined #perl6
10:43 ilbelkyr joined #perl6
10:43 itz actually only ignored inside the REPL itself
10:43 zakharyas joined #perl6
10:44 uncleyear joined #perl6
10:46 lizmat_ joined #perl6
10:46 masak jaffa4: `unit` is in the latest Rakudo compiler release, but not in the latest Rakudo Star (which is older).
10:47 dalek joined #perl6
10:50 aborazmeh joined #perl6
10:50 aborazmeh joined #perl6
10:54 nine Does this talk abstract sound interesting/intriguing? Comments very welcome! http://niner.name/talks/Building%20bridges%20-%20bringing%20Perl%205%20and%20Perl%206%20back%20together/abstract
10:55 jnthn .oO( If you build Inline::PHP, is that a bridge too far? :P )
10:55 jnthn nine: Seems like an attractive talk, anyways.
10:56 nine jnthn: if it didn't sound so painful, I'd actually be tempted to try it ;) Cause if we lose 10 % of Perl developers due to this bridge and gain 10 % of PHP developers, we grew our community. A lot ;)
10:57 jnthn True that :)
10:59 nwc10 The whole Hack vs PHP 7 thing is panning out to be "interesting"
10:59 nwc10 http://news.softpedia.com/news/HHVM-Now-Faster-than-PHP-7-484687.shtml
11:00 nwc10 I sincerly hope that the journalist is being wrong in his assumption "While this firmly puts HHVM back on top as the best optimization tool for PHP code, the PHP7 team has not even gotten started, as their product is still an alpha-level technology and more improvements are certainly still being developed as we speak."
11:01 nwc10 PHP 7 ought to be being stabilised at this point.
11:01 nwc10 not destabilised.
11:01 nwc10 I'm also suspicious/informed guessing that PHP 7 doesn't have as much scope for speedup as HHVM.
11:02 masak nwc10: sounds a bit like hyperbole, just from that sentence.
11:02 nwc10 its architecture is what, 15?, years more recent?
11:02 itz looks about as reliable as Phoronix :)
11:05 nine itz: phoronix is quite reliable if you use it as a link aggregator and ignore the written text ;)
11:14 dalek doc: f10e583 | paultcochrane++ | lib/HomePage.pod:
11:14 dalek doc: Mention Perl 5 documentation web site explicitly
11:14 dalek doc:
11:14 dalek doc: Using a link with the word "here" is supposedly bad practice in web pages.
11:14 dalek doc: The text is now more explicit as to what "here" is.
11:14 dalek doc: review: https://github.com/perl6/doc/commit/f10e583cdd
11:18 masak [ptc]++
11:19 masak I'd say it's often a missed opportunity. it's like you label all of your jars for different foods, but you label them all "here".
11:20 masak :P
11:21 tadzik hm, now that I think of it I can see why "here" may be a bad practice, especially in times of mobile where you may often not know what link is going to until you actually go there
11:22 tadzik mouseover is a blessing indeed
11:23 DrForr It's a PITA for screen readers.
11:24 moritz also, SEO
11:24 masak naming a product "Here" would give it a great head start in terms of popularity.
11:25 tadzik heheheh, like Here Maps
11:25 moritz Here Docs
11:26 masak Here Wolves
11:30 tadzik "Here here"
11:31 masak Here Raising
11:39 daxim I can't figure out from the documentation how to add to a set:  http://docs.perl6.org/type/Set
11:39 masak daxim: sets are immutable.
11:40 masak m: my $s = set(1, 2, 3); $s (|)= 4; say $s
11:40 camelia rakudo-moar 164f1e: OUTPUT«set(4, 3, 1, 2)␤»
11:40 telex joined #perl6
11:40 masak m: my $s = set(1, 2, 3); $s ∪= 4; say $s
11:40 camelia rakudo-moar 164f1e: OUTPUT«set(4, 3, 1, 2)␤»
11:41 daxim baffling
11:41 masak daxim: ^ ^^ Texas operator, Unicode operator
11:42 atroxaper joined #perl6
11:44 smls joined #perl6
11:45 smls How can I EVAL a Perl 6 file to make its subroutines etc available, but without executing its mainline?
11:46 smls e.g. to unit-test the subroutines in a stand-alone script
11:46 smls In Perl 5 this trick works reasonably well:
11:46 smls eval 'package Script { sub { '.slurp_file($script).'} }';
11:46 masak daxim: perhaps what you want is a SetHash?
11:46 smls but in Perl 6, subs are lexical so that won't work
11:46 masak m: my SetHash $s .= new; $s<foo>++; say $s; $s<foo>--; say $s
11:46 camelia rakudo-moar 164f1e: OUTPUT«SetHash.new(foo)␤SetHash.new()␤»
11:46 brrt if you use a sub MAIN i'd think you can just use it
11:47 jnthn Was gonna say, the usual idiom I've seen is a sub MAIN('test') { ... } or so
11:47 smls ok
11:47 daxim I dunno.  how do I decide?  don't just answer, one is immutable and the other is not
11:47 masak `multi MAIN('test')`
11:47 moritz multi MAIN, to be specific
11:47 moritz masak++
11:47 jnthn uh, yes :)
11:48 masak daxim: SetHash is a hash where the values can only be Bool values.
11:48 masak daxim: and False is taken to mean "remove this entry from the hash"
11:49 colomon basically it’s a mutable Set
11:49 masak colomon: we weren't allowed to say that :P
11:49 masak by daxim's rule above
11:49 daxim how do I decide?
11:50 colomon do you want to change it?
11:50 masak daxim: how do you decide whether you want an array or a hash in a program? it's a fairly ill-posed question.
11:50 daxim maybe, I don't know yet
11:50 masak daxim: to me, the answer is "it depends on a lot of things -- try to make your program nice"
11:50 daxim that's easy, arrays have order and hashes don't
11:51 moritz huh
11:51 masak well, SetHash mutates, Set doesn't
11:51 colomon I don’t know how you think about whether you want a Set or a SetHash without considering mutability.
11:51 moritz for me it's mostly "hashes if I mostly need lookups by name"
11:51 colomon Since that is the difference between the two
11:51 masak moritz: hashes are enormously powerful. there's at least five orthogonal-ish use cases.
11:52 masak slightly fewer in Perl 6 than in Perl 5, since Perl 6 has things like Set.
11:52 jnthn Well, it's algorithm design in some sense. Adding/removing from a SetHash is O(1). If you have a set and want to union in another value, getting a new set, then it's O(n) to do so.
11:53 jnthn If on the other hand you'll have sets of value and mostly be doing union/intersect and so on between the sets, or membership testing, then Set likely makes more sense.
11:53 masak the link 'See setbagmix#Set/Bag Operators' in http://docs.perl6.org/type/Set is broken -- do I report this to https://github.com/perl6/doc/issues ?
11:53 [ptc] masak: let me have a look
11:54 masak if you know you're doing certain kinds of lookup/modification, then a union/find data structure might be exactly what you want.
11:54 masak ooh, we don't have a good union/find data structure in the module ecosystem yet.
11:54 masak I bet CPAN has one.
11:54 colomon I think I mentioned this a couple of days ago, but I converted some p5 $work code to p6 last week, and I really dug being able to use ∈
11:54 colomon it’s really elegant for certain uses
11:56 masak aye.
11:57 masak I've had this feeling too.
11:57 sqirrel joined #perl6
11:58 [ptc] masak: fixed in local repo.  Am building html to check that I fixed it correctly.  Thanks for the bug report!
11:58 masak [ptc]++ # fast turnaround
11:59 masak [ptc]: abstracting away a bit -- is it by necessity that we have a build system for the docs pages that allows broken links?
12:00 [ptc] masak: dunno.  However, afaik the links can't be checked at build time
12:00 [ptc] masak: probably best to ask moritz++ or Mouq++
12:02 masak why can't the links be checked at build time?
12:02 masak what was it about this link that you fixed that makes it not checkable at build time?
12:02 moritz it's all a matter of adding another step/layer to the build process
12:02 moritz patches welcome :-)
12:02 masak ok, fair enough. that's what I was hoping to hear. :)
12:05 moritz if somebody has an idea for how to structure the whole HTML building to make it easier to debug (and/or to make it easier to build parts of the site), that would be also very welcome
12:06 brrt insufficient ideas left, sorry :-)
12:10 moritz brrt: if you JIT-compile everything to be 10x faster, that also counts as an idea :-)
12:11 * [ptc] wishes that the html docs built quicker...
12:11 brrt hah. if you're coming to YAPC::EU, you'll hear *precisely* why that 10x will/won't happen :-P
12:11 [ptc] or maybe just that one can optionally build a single html page
12:12 smls moritz: I experimented with that a few months ago, but I also wanted to make use of concurrency and that was still to unstable in r-m
12:12 smls maybe I should try again
12:13 moritz smls: I also have a concurrent branch which I abandoned due to instabilities
12:13 moritz parallel-htmlify and parallel-htmlify-2
12:13 smls ok
12:14 jnthn Dunno if things are better enough yet
12:15 itz m: say <yes no>.pick
12:15 camelia rakudo-moar 164f1e: OUTPUT«no␤»
12:15 smls camelia has spoken!
12:15 masak m: say <no yes>.pick
12:15 camelia rakudo-moar 164f1e: OUTPUT«yes␤»
12:15 masak see, she just picks the last one you said :P
12:15 masak like a 2-year-old.
12:16 * moritz wants to emphasize that camelia as a bot is 8 years old
12:17 smls I read that when kids are asked questions that don't make sense, they tend to pick an answer anyway because they believe that one is expected
12:17 smls e.g. in poorly phrased interviews/studies with kids
12:18 masak smls: *I* tend to believe an answer is expected, when asked a question.
12:18 moritz I also notice that kids have their very own logic
12:18 masak but I guess you mean they feel they have to choose between the alternatives given, or something like that.
12:18 smls yeah
12:26 TEttinger hello again! I can't quite recall who figured out the way postcircumfix and/or postfixish worked with the unshifting of the variable preceding the op... jnthn++ maybe?
12:26 TEttinger but I can't find unshift, specifically, in this chunk, and I have no idea what the rest means https://github.com/perl6/nqp/blob/master/src/HLL/Grammar.nqp#L454-L470
12:27 TEttinger I strongly suspect that shift and unshift are not interchangeable :)
12:28 TEttinger there's definitely a lot of work done by HLL for operator stuff already, but since I am not using the operator functionality, I'm in a bit of an odd place
12:29 arnsholt What are you trying to do? (I haven't scrollbacked, so I don't have the preceding context)
12:30 TEttinger hey arnsholt! I'm trying to make a lisp, but I can't take advantage of cargoculting the existing code for array access because it's an operator
12:30 TEttinger I should probably look at snake, huh :)
12:31 arnsholt I don't have array dereferencing yet, unfortunately =)
12:31 itz arggg I just forget I was on a case insenstive file system
12:31 arnsholt TEttinger: But is your problem that you need to implement array accesses as an operator in your Lisp?
12:31 TEttinger the contrasting problem, actually
12:32 TEttinger sym<[ ]> is the core of how NQP and Rubyish do it
12:32 arnsholt Aha, I see
12:32 TEttinger which is an operator, postcircumfix
12:32 arnsholt While in your Lisp, it's just going to be a fucntion, I see
12:33 TEttinger postfixish operators somehow get their preceding array available to them
12:33 arnsholt I think what you want is something like the nqp::op code in Snake/Rakudo/NQP
12:33 TEttinger or preceding hash yeah
12:33 TEttinger ohhh
12:33 TEttinger I saw that I didn't get it
12:33 arnsholt Basically, a way to expose the compiler primitives into your language
12:34 TEttinger so it would let me call an existing nqp op?
12:34 TEttinger right
12:34 arnsholt And then you can do something like (defun aref (arr idx) (nqp::atpos arr idx))
12:34 TEttinger nice
12:35 arnsholt Yeah, it's a nice trick
12:35 TEttinger thanks, arnsholt++ !
12:36 arnsholt You're welcome =)
12:53 leont joined #perl6
12:54 dalek doc: 67fd46d | paultcochrane++ | lib/Type/Set.pod:
12:54 dalek doc: Fix link to Set/Bag Operators from Set page
12:54 dalek doc:
12:54 dalek doc: Thanks to masak++ for pointing out the broken link.
12:54 dalek doc: review: https://github.com/perl6/doc/commit/67fd46d4d1
12:57 espadrine_ joined #perl6
13:06 leont http://perl5.git.perl.org/perl.git/commitdiff/d9fc04ee
13:08 leont So starting perl 5.23.1, doing «perl perl6script.pl» will do the right thing if perl6script.pl contains a perl6 hashbang
13:09 leont Which should make using prove a lot easier
13:10 FROGGS that's great!
13:12 masak leont: wow, this is big news! looking forward to seeing how that plays out.
13:13 raiph joined #perl6
13:14 leont Sadly 5.24 will only be out in about 11 months, but still
13:15 leont Should have amended it to add a proper description to the commit, forgot about that, perl5's behavior there is interesting and strange.
13:15 smls nice
13:15 leont (it already did the right thing for any string that doesn't contain the word "perl", I just had to special case the string "perl6")
13:17 masak this will have any number of minor, interesting consequences.
13:17 tadzik leont: awesome!
13:17 smls masak: It will?
13:17 masak first off, it slightly rewards any implementation that decides to call its executable `perl6`.
13:18 yqt joined #perl6
13:18 masak it's also the first time (I believe) that any acknowledgement of the existence of Perl 6 makes it into the Perl 5 code base.
13:18 RabidGravy joined #perl6
13:20 leont masak: not really, because of what I just said. If it says "#!/usr/bin/rakudo" perl5 will execute the hashbang faithfully today, it didn't use to do that for "#! /usr/bin/perl6"
13:21 leont It's more unblocking than rewarding, really
13:21 masak I didn't say anything about rewarding.
13:21 masak I said "acknowledging".
13:21 masak as in, recognizing that it's there.
13:22 leont I replied on "first off…"
13:22 masak oh! sorry :)
13:22 masak yes, you're right.
13:22 masak any executable name without the substring `perl` in it would already work.
13:22 masak so, yes -- unblocking is a better phrasing.
13:23 masak actually, it suggests to me that matching on /perl/ in the first place is risky. should be /\bperl\b/ or something.
13:24 leont Backwards compatibility makes that tricky
13:24 prevost joined #perl6
13:24 DrForr imperlious, experlience...
13:25 leont That last \b is a no-go, versioned perl5's are not that uncommon
13:26 masak oh, good point.
13:26 * masak .oO( backwards compatibility would be a lot simpler, if it weren't for all those annoying users out there )
13:27 leont The first \b would have been a good idea, but given the dubious gains and the risks I suspect it wouldn't be accepted
13:27 masak *nod*
13:30 smls joined #perl6
13:31 atroxaper joined #perl6
13:35 [Sno] is http://learnxinyminutes.com/docs/perl6/ known here?
13:36 DrForr #perl6 is mentioned at the bottom :)
13:37 timotimo yes, one of ours has written that. it was vendethiel
13:41 dalek tablets: 5658144 | (Herbert Breunung)++ | docs/appendix-a-index.txt:
13:41 dalek tablets: removed sprintf
13:41 dalek tablets: review: https://github.com/perl6/tablets/commit/56581443fc
13:46 aborazmeh joined #perl6
13:46 aborazmeh joined #perl6
13:49 nine leont: nice! Love that patch :)
13:49 bjz joined #perl6
13:54 masak lichtkind: doesn't that commit remove printf, not sprintf?
13:59 gtodd1 what is the technical term for perl6 (and other languages) feature that allows multiple iteration/loop values like:   for @list -> $a , $b, $c { do separate things with $a,$b,$c }
14:00 gtodd1 or is there one ...
14:01 PerlJam gtodd1: you can always make one up ... "multi-iterative" might work  :)
14:04 Ulti gtodd1 list/parameter unpacking is what I've heard it referred to fairly generally not sure there is something specific for it being in a loop
14:04 timotimo hmm
14:04 timotimo it feels to me like list or parameter unpacking is about having a single item-y value in a list and taking it apart into pieces
14:04 timotimo rather than taking multiple items from a list for every iteration
14:04 Ulti well yeah usually a single list
14:05 gtodd1 hehe wheeee!!!     it is not really something that gets bragged about in the synopses  too much  http://design.perl6.org/S04.html#The_for_statement
14:05 gtodd1 Ulti: good point
14:05 Ulti because its not really /that/ special
14:05 gtodd1 :-D
14:05 gtodd1 wait is it in Ecmascript 6 ?! :-D
14:06 Ulti dunno but its in most languages that have everything as a list
14:08 gtodd1 heh right ...  one day over the course of time perl6 might become ecmascript compatible by accident ....
14:09 rindolf joined #perl6
14:10 Ulti I guess the cool thing for the loops in P6 is that its a pointy block rather than special syntax for just the loop
14:10 PerlJam I guess those zip examples need updating with parens now.
14:10 DrForr Heh, change the P6 frontend to write out asm.js instead of JVM code :)
14:12 masak DrForr: pmurias is working on nqp-js (and eventually rakudo-js)
14:12 masak sorry, meant pmurias++
14:13 gtodd1 pointy block  ... for @list -> THIS_CAN_BE_ANYTHING?
14:13 * DrForr scribbles for future reference.
14:13 masak gtodd1: it's a signature
14:13 masak gtodd1: just like inside `sub foo(...)`
14:14 gtodd1 so could that signature part be a function ?
14:14 gtodd1 that returns a signature
14:14 masak ...no. not if I understand you right.
14:14 gtodd1 errm wait let me figure out if what I just asked makes sense
14:14 gtodd1 hahaha
14:14 gtodd1 ok skip that :-D
14:15 PerlJam masak: could it be ... A MACRO?!?  ;)
14:15 gtodd1 that's the word I was looking for!
14:15 masak I think gtodd1 ventured into the realm of macros with that suggestion, yes.
14:15 gtodd1 we can haz macros! :-D
14:15 gtodd1 sorry
14:15 masak but I'd want a concrete example, I think. not just handwaving :)
14:15 gtodd1 \o
14:15 gtodd1 :-D
14:18 Ulti but then what are ($var1,$var2) = @list;  or ($var1,$var2) = funcall(); the concept is more general than signatures just P6 goes the extra mile in the example of pointy blocks its more about a list populating a sequence of scalars generically? what's that called
14:18 timotimo it's not pointy blocks that are doing it
14:19 timotimo the mechanism that implements list iteration for for loops inspects the arity of the given block
14:20 Ulti sure but the semantics of taking things from a list/iterable and populating scalars regardless of where and how, does that have a name which is language agnostic?
14:20 Ulti feels like something functional people would have a name for
14:21 arnsholt I usually call that "destructuring"
14:24 masak yes, there you go. that's the name of it.
14:24 masak and it's what ES6 has too, though I'm not sure it can be used in loops.
14:24 masak not in for loops, I don't think.
14:25 masak well, not the foreach type, anyway.
14:26 Ulti lisp does though by the looks of it, and calls it destructuring (what doesnt lisp do)
14:27 nys joined #perl6
14:28 masak I didn't find any function that does this in the Haskell standard prelude.
14:29 Ulti oh neat lisp uses the same range keywords as icon if only it had less () so I could fall in love with it
14:32 arnsholt masak: Well, in Haskell it's basically a syntactic construct, isn't it?
14:35 masak arnsholt: my Haskell ain't so good. how would you do it in Haskell?
14:41 arnsholt You get it via the pattern matching syntax, don't you?
14:41 arnsholt The exact syntax escapes me ATM, but basically "foo [head | tail] = ..." for lists for example
14:43 masak oh, that's one way, yes.
14:43 |Tux| joined #perl6
14:54 pierrot joined #perl6
14:57 moritz head:tail iirc
14:58 moritz though my haskell is also rather rusty
14:58 masak aye
14:59 JimmyZ_ joined #perl6
15:00 timotimo it may be interesting to see what a haskelly rust might look like :P
15:02 espadrine isn't rust already haskelly?
15:08 timotimo no clue
15:10 leont A bit
15:10 TimToady my haskell is a bit rusty
15:12 andreoss` joined #perl6
15:19 TEttinger oh boy. arnsholt++, I imagine you encountered this error when running Snake:    Syntax error at line 2, near "'1'"
15:20 TEttinger I'm trying to run a quick eval on the command line, like...
15:20 TEttinger nqp-m.bat lilikoi\lilikoi.nqp -e'1'
15:20 TEttinger (I'm on windows, but rubyish ran fine so it isn't a \r\n thing I think)
15:21 TEttinger the two sets of quotes are odd. "'1'"
15:21 timotimo there is a --rxtrace flag that you may be able to use
15:22 timotimo for perl6 it's pretty useless, because it always only outputs up to CompUnit or something
15:23 gfldex joined #perl6
15:24 kurahaupo joined #perl6
15:26 geekosaur TEttinger, you are aware that cmd.exe only supports "" quoting and only of whole "words"?
15:26 TEttinger oh boy. thanks timotimo, that does help
15:26 TEttinger geekosaur: ?
15:26 geekosaur so the double quoting in the error is the "" delimiting the error string, and the '1' is what nqp tried to parse
15:26 TEttinger ah
15:27 geekosaur when you say -e'1', a unix shell sends -e1 and cmd.exe sends -e'1'
15:27 TEttinger which is not valid in my lisp, since ' as the quote macro isn't implemented yet
15:27 TEttinger oh ok
15:27 TEttinger so is there a better shell to use for this?
15:28 tony-o_ cygwin is more fun
15:28 geekosaur well, if you expect unix-style shell quoting to work, you should use a unix-like shell :)
15:28 geekosaur otherwise adapt your quoting to fit the shell you are using
15:28 TEttinger I didn't actually know that was a unix thing
15:28 TEttinger would -e(+ 1 2 3)
15:28 TEttinger that type of thing, work?
15:28 tony-o_ you have to do -e "(+ 1 2 3)"
15:29 geekosaur ^
15:29 tony-o_ otherwise it parses -e(+ and then the rest as just extra params
15:29 TEttinger that definitely helps, thanks
15:29 tony-o_ cygwin might be a decent download if you want to get unixy style parameter parsing, it doesn't work half badly with perl6 either (though you still need to compile perl6 for windows)
15:30 geekosaur (note, in reality windows just passes a single string to the application, it is the C runtime that does simplistic "" handling and argument splitting)
15:30 tony-o_ didn't know that geekosaur++
15:30 TEttinger "Unable to obtain AST from NQPMatch" is the current error that seems accurate now...
15:31 dalek Inline-Perl5: 2caa790 | (Stefan Seifert)++ | / (6 files):
15:31 dalek Inline-Perl5: Support subclassing Perl 5 classes directly, without the Perl5Parent role.
15:31 dalek Inline-Perl5:
15:31 dalek Inline-Perl5: Inline::Perl5 creates a corresponding Perl 6 class for each Perl 5 module
15:31 dalek Inline-Perl5: loaded via the use Foo:from<Perl5> or $p5.use('Foo') mechanisms.
15:31 dalek Inline-Perl5:
15:31 dalek Inline-Perl5: You can subclass these automatically created classes as if they were original
15:31 dalek Inline-Perl5: Perl 6 classes:
15:31 dalek Inline-Perl5:     use Data::Dumper:from<Perl5>;
15:31 dalek Inline-Perl5:     class MyDumper is Data::Dumper {
15:31 dalek Inline-Perl5:         has $.bar;
15:31 dalek Inline-Perl5:     }
15:31 dalek Inline-Perl5: review: https://github.com/niner/Inline-Perl5/commit/2caa790eab
15:35 khw joined #perl6
15:38 FROGGS joined #perl6
15:43 TEttinger so this error, "Unable to obtain AST from NQPMatch", could it mean that somewhere I'm not returning a make $<whatver>.ast from an action method?
15:43 tadzik nine++ # this is amazing
15:44 TEttinger errr, not .ast
15:45 nine tadzik: I remember us sitting on those steps in Sofia and talking about how much you can do with the most basic support. Who'd have thought this little experiment would evolve so quickly? :)
15:47 timotimo TEttinger: "return" and "make" behave very differently
15:47 timotimo TEttinger: but it cold very well be the case that you're missing a "make" somewhere
15:48 TEttinger I think I may have spotted something...
15:48 TEttinger I will commit this so it will be easier to communicate
15:50 TEttinger I think the problem is, I have this proto token but no corresponding method https://github.com/tommyettinger/lilikoi/blob/master/perl6/lilikoi/lilikoi.nqp#L29
15:51 TEttinger I don't know what the method would look like though
15:51 diana_olhovik_ joined #perl6
15:51 timotimo i don't think that's problematic
15:51 timotimo i don't even think we call the action method on proto tokens and such; is that right?
15:51 TEttinger rubyish doesn't have one
15:51 TEttinger hm
15:52 timotimo all in all, i think the proto token and the one it ends up actually calling will only have a single match object that you can set a .ast on with "make"
15:53 TEttinger I do have   method exp:sym<value>($/) { make $<value>.ast; }
15:54 TEttinger and I have lots of rules like value:sym<string> and such
15:54 timotimo right
15:54 timotimo that seems to be correct
15:54 TEttinger (well, tokens not rules)
15:54 TEttinger I may be misusing rules and tokens
15:54 TEttinger it seems to call ws rules a lot
15:55 timotimo any rule, token, regex is more or less "just a method"; which one you choose just changes the default parameters that are set inside for the regex portion
15:55 ugexe what is actually emitting an NQPMatch object instead of the CompUnit you expect
15:55 ugexe er, QASTUnit
15:55 TEttinger ugexe, I don't understand
15:56 ugexe which 'rule' causes the problem
15:57 TEttinger here's the rxtrace http://pastebin.com/S300AiRq
15:57 dalek rakudo/nom: eb39888 | lizmat++ | src/core/IO/Handle.pm:
15:57 dalek rakudo/nom: Quick fix for #125454
15:57 dalek rakudo/nom:
15:57 dalek rakudo/nom: This is handled properly in the newio branch already, so I think a quick
15:57 dalek rakudo/nom: fix will do.
15:57 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/eb398889b1
15:58 TEttinger I really have no idea which rule-like thing is causing the problem
15:58 ugexe its token ws where it stops
15:58 TEttinger yes, I had to tweak that one a bit
15:58 timotimo welllll, this is inside the compile step
15:59 timotimo ... could it be that your TOP isn't "make"ing something?
15:59 TEttinger https://github.com/tommyettinger/lilikoi/blob/master/perl6/lilikoi/lilikoi.nqp#L154
15:59 timotimo it's most likely that the parse step is already complete at that point
15:59 timotimo so the ws at the end just means that your code ends in something being parsed as ws
15:59 timotimo like the last end of line
15:59 PerlJam does <!after <id>>  parse properly?
16:00 PerlJam I would have written  "<!after <id> >" so as not to confuse myself later at least
16:01 timotimo it ought to work
16:01 PerlJam (since >> has a high "chunking factor" for me)
16:01 TEttinger hm, I changed https://github.com/tommyettinger/lilikoi/blob/master/perl6/lilikoi/lilikoi.nqp#L179 just now, still no change
16:02 TEttinger but I think for @<exp>    is what it should be?
16:04 ugexe $<exp>.list possibly
16:04 PerlJam or @($<exp>)
16:05 timotimo i know we have support for @<exp> in perl6, we may not have it in nqp
16:06 TEttinger I've seen it in rubyish
16:07 TEttinger stmtlist in rubyish uses: for @<stmt>;
16:07 TEttinger as a suffix
16:08 timotimo OK
16:10 pmichaud good morning, #perl6
16:10 hoelzro_ morning pmichaud
16:11 nine Good morning, pmichaud
16:11 timotimo good morning, pmichaud :)
16:11 tadzik nine: yes! :)
16:12 tadzik nine: I didn't expect it to become so advanced, like, ever :P
16:12 nwc10 good UTG, pmichaud
16:12 TEttinger interesting, @($<exp>) throws an exception about being unable to find .list
16:13 PerlJam nine: Inline::Perl5 should be part of Rakudo Star   :)
16:14 nine PerlJam: of course I'd like that :) Come to think of it: is there any reason not to include it? Perl 5's already needed for building rakudo, isn't it?
16:17 lizmat_ m: class A { my $boo will leave { } }; # what should "will leave" on a class lexical do ??
16:17 camelia rakudo-moar 164f1e: OUTPUT«5===SORRY!5=== Error while compiling /tmp/xNkXzDDNKu␤Method 'add_phaser' not found for invocant of class 'A'␤at /tmp/xNkXzDDNKu:1␤»
16:17 uncleyea1 joined #perl6
16:17 lizmat_ agree with #125455 that error is LTA, but I'm not sure what meaning it would have
16:18 lizmat PSA: I may or may not get to doing a P6W today
16:19 TEttinger Pat 6 Weimerauners
16:20 TEttinger there's a lot of acronyms in use here :)
16:20 atroxaper joined #perl6
16:21 PerlJam S99
16:21 PerlJam S99:P6W
16:22 synbot6 joined #perl6
16:22 PerlJam S99:P6W
16:22 synbot6 Link: http://design.perl6.org/S99.html#P6W
16:23 spider-mario joined #perl6
16:26 smls joined #perl6
16:27 gtodd1 hmm http://stackoverflow.com/a/28587025/2019415
16:27 gtodd1 the perl6 example there shows <> at the end of a %hash.perl
16:27 gtodd1 oh wait I forgot about camelia :-)
16:29 gtodd1 camelia: m:  my %war_on_drugs_industrial_complex = < money prisons > ;  %war_on_drugs_industrial_complex.perl ;
16:29 camelia gtodd1: rakudo-moar eb3988: ( no output )
16:29 gtodd1 camelia: m:  my %war_on_drugs_industrial_complex = < money prisons > ;  %war_on_drugs_industrial_complex.perl.say ;
16:29 camelia gtodd1: rakudo-moar eb3988: OUTPUT«{:money("prisons")}<>␤»
16:30 gtodd1 why is there a <> ?  ...
16:31 tony-o_ because you're not using Data::Dump ;)
16:32 vendethiel joined #perl6
16:32 gtodd1 :-) which is "built in" now ... doh!
16:33 gtodd1 ok  ... I figured the <> was telling the compiler something special about constructing a list  so the output could be "round tripped" back and forth etc.
16:34 timotimo i didn't know we could "camelia: m:"
16:34 timotimo the <> at the end means basically "deconted"
16:34 pmichaud gtodd1: yes, the <> is there for round tripping, I think.  I'm hoping to eliminate that post-GLR.
16:34 pmichaud (expecting to do so)
16:35 gtodd1 wow cool
16:35 lizmat m: my @a = 1,2,3; say @a.perl
16:35 camelia rakudo-moar eb3988: OUTPUT«[1, 2, 3]<>␤»
16:35 lizmat m: my $a = [1,2,3]; say $a.perl
16:35 camelia rakudo-moar eb3988: OUTPUT«[1, 2, 3]␤»
16:35 tony-o_ m: my @a = EVAL('[1, 2, 3]<>'); @a.perl.say;
16:35 camelia rakudo-moar eb3988: OUTPUT«[1, 2, 3]<>␤»
16:35 lizmat <> is the (temporary) decontainerize marker
16:36 lizmat afk again&
16:36 tony-o_ m: my @a = EVAL('[1, [2]<>, 3]<>'); @a.perl.say;
16:36 camelia rakudo-moar eb3988: OUTPUT«[1, 2, 3]<>␤»
16:36 gtodd1 pmichaud: once you have done that the explanation will appear obvious so I will hereby NOT ask to explain how perl will know it is dealing with the output of .perl :-)
16:37 pmichaud well, in the new GLR design,   my @a = 1,2,3; say @a.perl   will output  "[1, 2, 3]"  with no <>.
16:37 pmichaud because [...] no longer containerizes the array.
16:37 gtodd1 I had the feeling that the answer would "there will be no such question any longer"  ...
16:38 gtodd1 pmichaud: that makes sense :-\
16:39 pmichaud that also means that things like     my @a = [ 1, 2, 3 ];   does what most people expect.
16:40 gtodd1 data point: .... it seems that each time I spend a month or so away from perl6  when I come back and it seems simpler and easier to understand
16:41 gtodd1 even if this is a more a personal neuronal thing ... it is still a very good sign
16:41 nine pmichaud: speaking of the GLR, how is it coming along?
16:42 pmichaud I worked on it over the weekend (during a road trip) -- I'm transfering new information into S07 tonight.
16:42 gtodd1 I changed that SO answer to add a Perl6 example ... I hope it makes Perl6 look good :-D
16:43 pmichaud I'm expecting to get a fair bit done (code) on GLR this week.
16:43 nine pmichaud: I haven't been able to follow the channel in the past 6 weeks. So I was hoping for a bit coarser answer :)
16:44 gtodd1 so SO7 is the thing to watch?  Is there a branch ... github dropdown shows a lot of them to choose from!
16:44 pmichaud nine: oh.  Current information is in S07-glr-draft.
16:44 pmichaud https://github.com/perl6/specs/blob/master/S07-glr-draft.pod
16:44 pmichaud there's not a code branch yet
16:44 pmichaud it's still in design
16:44 nine pmichaud: ah, thank you very much :)
16:45 gtodd1 ++
16:45 rindolf joined #perl6
16:49 pmichaud My latest musings (re-)introduce a Seq type, which will be used to efficiently manage iteration.
16:50 pmichaud anyway, it'll be in tonight's S07 update.  :)
16:52 gtodd1 hmm from somewhere deep down in https://twitter.com/CompSciFact (++)  "2015 is a palindrome in binary: 11111011111"
16:54 gtodd1 wait ... there are 11 numbers (5+6) and 0 is in the 6th and the 6th last position ... this could be the numerological explanation of Christmas!
16:57 muethos joined #perl6
16:57 muethos joined #perl6
17:02 DrForr I don't suppose there' a variant of .perl that prettyprints its output... Lining up braces so I can see the output with some whitespace is driving me blind.
17:02 skids joined #perl6
17:03 PerlJam DrForr: you probably want Data::Dump
17:03 DrForr Right, that'll do.
17:04 smls nine: Nice work, making Perl 5 classes directly subclassable from Perl 6.
17:04 smls Now make exported Perl 5 functions directly callable from Perl 6... :P
17:05 vendethiel joined #perl6
17:05 smls Also, is it intentional that "panda install Inline::Perl5" will fail if Moose is not installed?
17:05 smls If it doesn;t actually need it except to run some tests, wouldn't it be better if those tests were skipped when Moose is not installed.
17:06 colomon joined #perl6
17:06 nine smls: it's not intentional. I seem to have screwed up the skipping
17:12 dalek Inline-Perl5: 24600bc | (Stefan Seifert)++ | t/inherit.t:
17:12 dalek Inline-Perl5: Fix tests not being skipped when Moose is not installed
17:12 dalek Inline-Perl5:
17:12 dalek Inline-Perl5: Thanks to smls++ for reporting!
17:12 dalek Inline-Perl5: review: https://github.com/niner/Inline-Perl5/commit/24600bcfd9
17:13 muethos grrr
17:13 muethos ups
17:13 larion joined #perl6
17:14 timotimo gtodd1: there's actually no need to loop over the < ... > stuff at all for that SO answer
17:14 timotimo er, no
17:14 timotimo what i meant to say was:
17:14 timotimo if you use a list of pairs instead, you can just push that into a hash and it'll give multivalue values :)
17:14 nine smls: Actually I already tried importing exported Perl 5 functions directly, but ran into a strange limitation of perl
17:15 TEttinger hm, this is going better, maybe? I found that I had lots of rules and tokens that mentioned the token id , but no action method for id
17:15 TEttinger however, after adding an action method, it doesn't seem different
17:16 TEttinger id's body is just:          make ~$/;
17:16 TEttinger id is exactly like the builtin ident, but tolerating more than alphanumeric and underscores
17:17 TEttinger (at least it's supposed to be.  anything that you can put in a name)
17:17 rir joined #perl6
17:18 nine pmichaud: what bothers me about the Slip or Seq type is it's yet again a different way to flatten. For me the hardest thing about learning Perl 6 was just passing on arguments from a slurpy array. I never knew whether I needed |@args or @args.list or now the new Seq(@args)
17:20 pmichaud well, I suspect most programmers will rarely encounter or use Slip directly.
17:20 tony-o_ DrForr: i'll take a look ^
17:20 DrForr Ohai.
17:20 tony-o_ howu
17:21 nine pmichaud: if Slip is the way to concatenate lists, they probably will
17:21 pmichaud I could be wrong about that.  In many ways Slip is what Parcel was intended to be -- something that happens internally but doesn't get a lot of exposure outside.
17:21 pmichaud well, Slip is the way to concatenate lists without flattening their contents.
17:22 pmichaud if I want to concatenate two arrays, then     flat @a, @b     is still likely to be the way to do that.
17:22 nine As a Perl 5 programmer, concatenating without flattening sounds like the "normal" use case.
17:23 tony-o_ DrForr: in that bug, what is '$p' ?
17:23 pmichaud nine: really?  that's.... odd, since  Perl 5 does concatenation with flattening.
17:23 gtodd1 timotimo: !!!
17:24 nine pmichaud: I'd argue that it doesn't. A Perl 5 array cannot contain anything flattenable as lists would be flattened already when they are put into the array. Once they're there, they're no lists anymore. And arrayrefs will not be flattened.
17:25 pmichaud nine: in p5,  the result of       @a, (1, 2, 3, (@b, 5..10))   is completely flattened
17:25 pmichaud to get that same behavior in p6, use  'flat'
17:26 nine Ok, I didn't think of parenteses. But with my @a = (1, 2, [3, 4]); my @b = (5, 6); my @c = @a, @b; will give you (1, 2, [3, 4], 5, 6)
17:26 pmichaud in p5 or p6?
17:26 nine in p5
17:27 gtodd1 timotimo: like:  %hash = <tinku 15 tina 4 rita 18 tinku 18 tinku 17 tinku 16 rita 19>.pairs.push ;
17:27 pmichaud in p6, one would write:    my @a = 1, 2, $[3, 4];  my @b = 5, 6;   my @c = @a, @b    results in  (1, 2, [3, 4], 5, 6)
17:27 gtodd1 timotimo: oh wait that doesn't work quite right
17:27 pmichaud the $ explicitly says "don't flatten this part"
17:27 DrForr tony-o_: If there's not enough info for you to debug I can tell you how to derive the test scripts.
17:28 pmichaud more precisely, it results in   (1, 2, $[3, 4], 5, 6)
17:28 pmichaud i.e., @c.elems is 5, and @c[2] is an Array.
17:28 gtodd timotimo: but I get your drift :)
17:29 nine pmichaud: pre or post GLR?
17:29 pmichaud post GLR
17:29 pmichaud more importantly, no Slip involved at the programmer level.
17:30 nine pmichaud: so what's the difference between my @c = @a, @b; and my @c = Slip(@a), Slip(@b);?
17:30 pmichaud in this case, nothing.
17:30 pmichaud Slip() is primarily needed when creating a list using a generator of some sort, such as a gather/take or a map
17:31 pmichaud and then only if you want to produce a list that has a different number of elements than the number of takes or map iterations
17:32 nine Ok, that sounds like a more advanced feature, indeed. Might be something worth clarifying in S07
17:32 pmichaud the number of times we need to concatenate lists is fairly small.  Indeed, at the moment Rakudo (pre-GLR) doesn't have any way to concatenate lists, and we obviously do okay without it.  :)
17:33 nine m: my @a = 1, 2, 3; my @b = 4, 5, 6; my @c = @a, @b; say @c.perl;
17:33 camelia rakudo-moar eb3988: OUTPUT«[1, 2, 3, 4, 5, 6]<>␤»
17:33 nine For me that ^^^ still looks like concatenation :0
17:33 nine ;)
17:33 pmichaud actually, it's a flattening.
17:33 pmichaud the type of concatenation I'm referring to is something like this:
17:34 pmichaud my @a := (1, 2..5);
17:34 pmichaud my @b := <a b c>
17:34 pmichaud now, make a list that is exactly    (1, 2..5, <a b c>) from @a and @b
17:34 pmichaud such that the number of elems of that list is 3
17:35 pmichaud oh, wait, i got that slightly wrong.
17:35 pmichaud make a list that is exactly
17:35 pmichaud (1, 2..5, 'a', 'b', 'c')     from @a and @b
17:35 pmichaud such that the number of elems of that list is 5
17:35 pmichaud i.e., @a has two elements (an Int and a Range)
17:36 pmichaud @b has three elements  (three Strs)
17:36 pmichaud so the concatenation of @a and @b should have five elements
17:36 pmichaud we don't have a way to do this in Perl 6 currently.
17:36 nine Ok, now its crystal clear. Thanks for enlightening me!
17:38 masak pmichaud++ # hadn't thought of that difference
17:38 pmichaud it's the problem I repeatedly run into when trying to implement things like  .kv
17:38 pmichaud obviously .kv should be created using some sort of iterator.  but if we do something like     take $key, $value
17:38 pmichaud then what we end up with is a list consisting of 2-item lists
17:39 pmichaud i.e.,  ((k0, v0), (k1, v1), (k2, v2), ...)   when what we really want is  (k0, v0, k1, v1, k2, v2)
17:40 nine With take Slip($key, $value) it would work as intended
17:40 pmichaud correct
17:40 pmichaud also, Slip() becomes the way to have an iteration that doesn't insert a value into a list
17:41 pmichaud i.e.,  for 1..5 { $_ == 3 ?? Slip() !! $_ }    can produce  (1, 2, 4, 5)
17:41 PerlJam and what happens to () ?
17:41 pmichaud as opposed to (1, 2, Nil, 4, 5)   or (1, 2, (), 4, 5)
17:42 pmichaud PerlJam: () is a List with zero elements.
17:42 gtodd camelia: m: (my %h3).push: <tinku 15 tina 4 rita 18 tinku 18 tinku 17 tinku 16 rita 19>.pairs.invert.unique ; %h.perl.say
17:42 camelia gtodd: rakudo-moar eb3988: OUTPUT«5===SORRY!5=== Error while compiling /tmp/eYVZ0GRIRq␤Variable '%h' is not declared␤at /tmp/eYVZ0GRIRq:1␤------> 3tinku 16 rita 19>.pairs.invert.unique ; 7⏏5%h.perl.say␤»
17:42 nine So Slip() really is what () is in Perl 5 while [] is something between P5's () and [] and $[] is mostly like []
17:42 domidumont joined #perl6
17:42 pmichaud [] is an Array constructor.
17:42 tony-o_ DrForr: i was able to reproduce the rror by 'Dump'ing GLOBAL::
17:42 pmichaud $[] is most like an arrayref, without actually being a ref
17:43 gtodd /gsm camelia
17:43 pmichaud (or, more precisely, it's the equivalent of all of the other refs we have in p6)
17:43 tony-o_ DrForr: i think i got it working enough that it won't die, it may not show you everything that you expect to see though.  if it doesn't lmk and i can figure out how to add more info to Dump
17:43 pmichaud the main thing about [ ]  is that it itemizes it contents
17:43 pmichaud and produces an Array object instead of a List object
17:43 DrForr Cool, let me update.
17:44 gtodd timotimo: what am I doing wrong here ?
17:44 gtodd camelia: m: (my %h).push: <tinku 15 tina 4 rita 18 tinku 18 tinku 17 tinku 16 rita 19>.pairs.invert.unique ; %h.perl.say
17:44 camelia gtodd: rakudo-moar eb3988: OUTPUT«{"15" => 1, "16" => 11, "17" => 9, "18" => [5, 7], "19" => 13, "4" => 3, :rita([4, 12]), :tina(2), :tinku([0, 6, 8, 10])}<>␤»
17:46 DrForr tony-o_: t/01-hash.t fails at line 22 after rerunning 'panda install Data::Dump'.
17:46 gtodd timotimo:  I just want the "classified"  part :rita([4, 12]), :tina(2), :tinku([0, 6, 8, 10] ... not sure I get where something like "17" => 9  ... is  coming from
17:46 nine m: say (1, 2..5).perl; say [1, 2..5].perl;
17:46 camelia rakudo-moar eb3988: OUTPUT«(1, 2..5)␤[1, 2, 3, 4, 5]␤»
17:47 gtodd timotimo:  well I know where it's coming from but I don't know whey it is there :-)
17:47 nine pmichaud: if [] itemizes, shouldn't it keep the range as is instead of interpolating it?
17:47 pmichaud yes, in the current GLR design it would do that.
17:48 pmichaud which is why there's a conjectured   :[  ]   which flattens its contents.
17:48 pmichaud (and then itemizes)
17:48 TEttinger so if in an NQP action method, the only line is:    make ~$/;
17:48 TEttinger in that case, what does that mean?
17:48 TEttinger it seems not to do what I would expect, which is just return the string of what was matched
17:49 tony-o_ DrForr: try it again, i forgot to commit the test files
17:49 pmichaud and, of course, one could always do  [flat 1, 2..5, <a b c>]   which would produce an array of eight elements
17:49 masak I think I prefer that form
17:49 pmichaud same here
17:49 masak in terms of legibility
17:49 DrForr Heh. One sec...
17:50 pmichaud I'm not a fan of the colon form, but TimToady++ keeps mentioning it.  :)
17:50 masak the colon form for hashes :{ } does something completely different
17:50 masak :[ ] doesn't feel strangely consistent here, just chosen because it's available
17:51 DrForr tony-o_: Now responding with 'ANTLR4::Actions::Perl6::Shim.new(ast => {:actions([]), :content([{:action(Any), :attribute([]), :content([{:content([{:commands([]), :content([{:!complemented, :content("INT"), :!greedy, :modifier(Any), :type("nonterminal")}]), :label(Any), :options([]), :type("concatenation")}, {:commands([]), :content([{:!complemented, :content([{:content([{:!complemented, :content("INT"), :!greedy, :modifier("?"), :type("nontermi
17:51 DrForr GAH
17:51 DrForr SOrry.
17:51 pmichaud I do like that we now have a nice way to construct both  the three-element   [1, 2..5, <a b c>]  and the eight-element [flat 1, 2..5, <a b c>]
17:51 moritz fwiw NQP doesn't distinguish between flatenning and non-flattening arrays
17:52 moritz sorry, I replied to stale backlog
17:52 pmichaud technically, NQP doesn't have arrays at all.
17:52 pmichaud just lists.
17:52 DrForr tony-o_: Now responding with 'Invocant requires a 'Failure' instance, but a type object was passed.  Did you forget a .new?' in sub key at lib/Data/Dump.pm6:9 (there's much more to the stacktrace but after that boner I'm afraid to paste :) )
17:53 tony-o_ DrForr: no worries, can you tell me where/how to get whatever file you're using to test (then i can make the tests better and fix this one)?
17:53 nine pmichaud: :[] ... Larry's first rule of language design? ;)
17:53 tony-o_ timtowtdi dwim and colons
17:54 smls I gotta agree with masak the - having the colons in :[ ] and :{ } mean conceptually totally different things, does not sound nice.
17:54 smls *there
17:54 DrForr tony-o_: Sure. examples/antlr42perl6 of github.com/drforr/perl6-ANTLR4 is what I'm running, replace sub MAIN with what's in the github issue. The test file I'm using for it is corpus/Abnf.g4 from the same project.
17:54 pmichaud nine: I think it's the 2nd Law of language design.  :)
17:55 vendethiel joined #perl6
17:55 TEttinger anyone know what action methods do when they have as their last line,     make ~$/;
17:55 smls pmichaud: If syntactic sugar for flattening is needed, I think it should be  |  although then a new syntax would have to be invented for interpolating in signatures
17:56 timotimo gtodd: i think you misunderstand what ".pairs"d oes
17:56 pmichaud smls: fair enough, but you'll have to speak to the Language Redesigner to get that change in place.  :)
17:56 smls :P
17:56 gtodd timotimo: k
17:57 japhb .oO( GLR: Great Language Redesigner )
17:57 tony-o_ DrForr: i'll take a look ^ ty
17:58 nine Why is | only used for flattening in signatures anyway? Seems rather un-Perl-6y to have such a special case.
17:58 pmichaud technically, it's not "flattening"
17:58 smls well, it does something different from flattening
17:58 pmichaud what it's doing is saying "interpolate this into the argument list"
17:58 pmichaud and argument lists aren't Lists
17:59 timotimo gtodd: you're calling .pairs on a list; .pairs on a list behaves a lot like .kv on a list, but it gives you Pair objects
17:59 timotimo gtodd: i think we have something called "pairup" that does what you want here
17:59 timotimo which is take alternating values as the key and value for Pair objects
17:59 jnthn TEttinger: Sets .ast on the Match object to be the stringification of what was matched
17:59 timotimo rather than building Pair objects from the array index and the value at that position
17:59 smls m: dd (2, 4, 6, 8).pairup
17:59 camelia rakudo-moar eb3988: OUTPUT«(2 => 4, 6 => 8)␤»
18:00 pmichaud m: dd (2, 4, 6, 8).pairs   # for comparison
18:00 camelia rakudo-moar eb3988: OUTPUT«(0 => 2, 1 => 4, 2 => 6, 3 => 8)␤»
18:00 smls dd (2, 4, 6, 8).map({; $^k => $^v });   # alternative
18:00 smls m: dd (2, 4, 6, 8).map({; $^k => $^v });   # alternative
18:00 camelia rakudo-moar eb3988: OUTPUT«(2 => 4, 6 => 8)␤»
18:00 jnthn TEttinger: Note that if you want something that's going to evaluate to a string, it needs wrapping in a QAST::SVal
18:00 TEttinger jnthn: thanks, and the result of that (the action method with that line is id ), could it be used like...
18:00 TEttinger hm
18:01 TEttinger make QAST::Var.new( :name(~$<id>), :scope('lexical') );
18:01 TEttinger would id behave correctly there?
18:02 gtodd timotimo: yeah that works ... intead of another methdo I was looking for some way to for the pairs to be arrayrefs  or something [ ]
18:02 jnthn Well, that's valid, but if you're looking to access the thing you set with "make" in the action method of id then you want $<id>.ast
18:02 smls timotimo: On "camelia: m: ..." working, that's probably for the same reason   perl6 -e "m: ..."   works - the m: is parsed as a label :P
18:02 gtodd instead of another method I was looking for some way to force the pairs to be arrayrefs  or something [ ] and got distracted
18:02 gtodd timotimo: so thanks
18:03 TEttinger if id is a token that matches effectively anything that isn't a grouping symbol, reserved symbol, or starting digit, any number of times, then .ast should get the thing?
18:03 DrForr And now I'm getting "Use of uninitializd value $v ..." when I don't *have* a $v. Filing a bug report
18:03 tony-o_ DrForr: https://gist.github.com/tony-o/aa49fff84a110143aaf7
18:03 tony-o_ is there anything *not* in there that you'd expect to see?
18:03 colomon joined #perl6
18:03 DrForr Thanks, I'll file this issue first though...
18:04 jnthn TEttinger: Only if you are doing "make" in the action method for id
18:04 TEttinger hm
18:04 jnthn TEttinger: If you've a concrete example of what you're trying that you can gist, I'll take a glance at it
18:04 gtodd smls: pmichaud  timotimo: thanks all
18:04 TEttinger well I'm getting this error pretty much regardless of what I try, let me post the error and code. Unable to obtain AST from NQPMatch
18:04 _mg_ joined #perl6
18:05 jnthn Ah, OK. I know where the error comes from, but I'll need the code to see why you're getting it :)
18:05 danieli joined #perl6
18:06 smls m: dd (2, 4, 6, 8).map(* => *)
18:06 camelia rakudo-moar eb3988: OUTPUT«(2 => 4, 6 => 8)␤»
18:06 smls ^^ Makes me wonder why we even need pairup... :)
18:06 PerlJam smls: it's more human-friendly  :)
18:06 gtodd smls: that looks more perl5 brain friendly too
18:06 FROGGS m: dd (2, 4, 6, 8).map([=>] *,*)
18:06 camelia rakudo-moar eb3988: OUTPUT«Method 'count' not found for invocant of class 'Pair'␤  in block <unit> at /tmp/JZNJaHKFWW:1␤␤»
18:06 TEttinger errors, jnthn: http://pastebin.com/vRdSmsim     code: https://github.com/tommyettinger/lilikoi/blob/master/perl6/lilikoi/lilikoi.nqp
18:06 FROGGS aww
18:07 smls PerlJam: I don't know, I think the map is more self-documenting
18:07 dalek specs: 1278284 | (Stefan Seifert)++ | S07-glr-draft.pod:
18:07 dalek specs: Fix typo in S07-glr-draft.pod
18:07 dalek specs: review: https://github.com/perl6/specs/commit/1278284ca7
18:07 pmichaud I like  * => *  a bit better than .pairup also.
18:07 PerlJam smls: yeah, I can't argue that.
18:08 pmichaud although I'm sure .pairup is/can be faster than the .map
18:08 cognominal joined #perl6
18:09 mj41 joined #perl6
18:09 mj41 m: "10 20".split(" ").[0,1].reduce:{$^a + $^b}.say
18:09 camelia rakudo-moar eb3988: OUTPUT«-> ($a, $b) { #`(Block|44053488) ... }␤Type check failed in binding &with; expected 'Callable' but got 'Bool'␤  in block <unit> at /tmp/rpjYDB5clB:1␤␤»
18:09 mj41 m: say "10 20".split(" ").[0,1].reduce:{$^a + $^b}
18:09 camelia rakudo-moar eb3988: OUTPUT«30␤»
18:09 jnthn TEttinger: Ah, I see it
18:10 TEttinger oh?
18:10 jnthn Action methods are called on rule/token/regex
18:10 jnthn You have a method TOP, which calls token comp_unit.
18:10 jnthn That's fine, we do the same in the Perl 6 compiler
18:10 TEttinger ah, and no comp_unit?
18:10 jnthn But it means the action method you named TOP wants to be called comp_unit
18:11 TEttinger ohhhh
18:11 TEttinger what action method should be called TOP then?
18:11 TEttinger does it need any?
18:11 jnthn You don't need one
18:11 TEttinger sweet, will try now
18:11 jnthn Your TOP method in the grammar calls self.comp_unit;
18:11 jnthn Which just returns the Cursor that comp_unit produces
18:12 jnthn And that's where you'll have attached the .ast with "make" in the comp_unit action method
18:12 dha joined #perl6
18:12 jnthn If it helps, you can imagine each token/rule/regex as containing an implicit call to your action method at the end, provided there is one.
18:13 smls FROGGS: The comma operator stops * currying. If it didn't, cute expressions like   0, 1, *+* ... *   would not be possible.
18:13 FROGGS smls: I see
18:14 timotimo jnthn: remember that thing i nagged you about? :)
18:14 * DrForr waves dhaward.
18:18 dha Howdy DrForr
18:18 mj41 m: "10 20".words.reduce(* + *).say
18:18 camelia rakudo-moar eb3988: OUTPUT«30␤»
18:19 dha I have the feeling that S28's contention that the p6 equivalent of C<$&> is C<< $<> >> is nonsense. Is that the case?
18:20 tony-o_ DrForr: lmk what you think of that gist, not sure what else it *should* have in it.  also not sure how to handle that AST attr
18:20 Sqirrel joined #perl6
18:20 TEttinger jnthn, it seems to work, though I can't get whitespace to work as I hoped
18:21 dha Huh. It's NOT nonsense.
18:21 PerlJam m: "foo bar" ~~ /foo/; say $<>;
18:21 camelia rakudo-moar eb3988: OUTPUT«「foo」␤»
18:22 dha But, given that it looks to be the same as $/, WHY isn't it nonsense?
18:24 pmichaud m: "foo bar" ~~ /foo/;  say $<>.perl
18:24 camelia rakudo-moar eb3988: OUTPUT«Match.new(ast => Any, list => (), hash => EnumMap.new(), orig => "foo bar", to => 3, from => 0)␤»
18:24 pmichaud m: "foo bar" ~~ /foo/;  say ${}.perl
18:24 camelia rakudo-moar eb3988: OUTPUT«5===SORRY!5=== Error while compiling /tmp/6_Fgxat15W␤Unsupported use of ${}; in Perl 6 please use $()␤at /tmp/6_Fgxat15W:1␤------> 3"foo bar" ~~ /foo/;  say ${}7⏏5.perl␤»
18:24 PerlJam dha: It's probably "nonsense" in the sense that $() is really the equivalent to $&
18:24 vendethiel joined #perl6
18:25 FROGGS $() is $/.ast // ~$/, no?
18:25 dha Ah. Yes, $() does seem to be a more precise analog.
18:26 dha But I do question why we have two variables that appear to do exactly the same thing.
18:26 colomon which bigint package are we using these days?
18:26 pmichaud S05:2968
18:26 synbot6 Link: http://design.perl6.org/S05.html#line_2968
18:26 PerlJam well ... as long as .ast isn't set as FROGGS mentions
18:26 pmichaud I can't find any reference to $<>, nor have I heard of such a construct.
18:26 mj41 http://rosettacode.org/wiki/A%2BB#Perl_6 updated :-)
18:27 dha pmichaud - it's in design doc S28 as the analog to $&. It also works. :-/
18:27 PerlJam if $<> continues to exist, perhaps it should be the same as ~$/  (i.e. no .ast concerns)
18:28 pmichaud PerlJam: please, no.
18:28 telex joined #perl6
18:28 yqt joined #perl6
18:28 pmichaud to me, <> ought to retain it's qw-like and slicing meanings somehow.
18:28 dha In the meantime, should I change S28 to read C<$()> instead as the replacement for $&?
18:28 pmichaud don't overload it with yet another meaning
18:28 DrForr tony-o_: As that stands, I don't have a problem with it. I was more after a dumping of the content in $.ast but that may not have come across in my gist. Dump($p.parsefile($filename).ast);  should return a formatted version of the .ast I've generated, and that's what I'm after so I can look at the content.
18:29 pmichaud I think the replacement for $& should be  ~$/
18:29 jnthn colomon: MoarVM uses libtommath, on JVM it's whatever backs the Java BigInteger class. On Moar we also have some fast-pathing to avoid the big integer library on smaller numbers
18:30 colomon jnthn++
18:30 JimmyZ_ joined #perl6
18:31 pmichaud $() is not exactly the same as p5's  $&, and using it instead of ~$/  will likely cause confusion.
18:31 pmichaud since ~$/ is the more common (and accurate) construct.
18:31 dha Out of curiosity, how is it different?
18:31 pmichaud $() is defined as    $/.made // ~$/
18:32 pmichaud which means that if a Match object has an attached value (via 'make'), that's what gets returned instead of the string that was matched
18:32 PerlJam m: "foo bar" ~~ /foo {make "hi"}/; say $(); say ~$/;
18:32 camelia rakudo-moar eb3988: OUTPUT«hi␤foo␤»
18:32 pmichaud PerlJam++
18:33 dha Well, I certainly don't see a problem with putting this all under $/. But then again, I'm new here. :-)
18:34 pmichaud m: "foo bar" ~~ /foo { make 3}/;  say $().WHAT;  say (~$/).WHAT
18:34 camelia rakudo-moar eb3988: OUTPUT«(Int)␤(Str)␤»
18:35 dha But, as it stands, barring attached value issues, currently C<$()>, C<$/.Str>, C<~$/>, C<< $<>.Str >>, and C<< ~$<> >> all seem to do the same thing. And C<$/> and C<< $<> >> seem to be the same thing.
18:35 dha So, at the moment there seems to be a large amount of unnecessary duplication.
18:35 pmichaud dha: well, don't forget that what Rakudo implements isn't necessarily what the language requires.
18:36 pmichaud $() is different from the others, because of .made/make
18:36 dha True. So, how do we determine what the language requires?
18:36 pmichaud dha: officially, by the test suite; unofficially, by the design documents ("specs")
18:36 dha (in case you missed it, I'm trying to write more comprehensive docs for people transitioning from p5 to p6)
18:36 pmichaud (yes, I've been reviewing them :)
18:37 pmichaud I saw the FB post :)
18:37 dha Ah. thanks.
18:37 PerlJam ack didn't find $<> in my local copy of roast
18:37 pmichaud $<> is obviously doing something in Rakudo, but afaict it's not an official part of Perl 6.
18:37 pmichaud so I think it's an emergent behavior somehow, as opposed to being defined.
18:38 FROGGS m: "foo bar" ~~ /foo/; say ${''};
18:38 camelia rakudo-moar eb3988: OUTPUT«5===SORRY!5=== Error while compiling /tmp/rWnGTXGdQm␤Unsupported use of ${''}; in Perl 6 please use $('')␤at /tmp/rWnGTXGdQm:1␤------> 3"foo bar" ~~ /foo/; say ${''}7⏏5;␤»
18:38 dha It's defined in S28. (line 165)
18:38 pmichaud I mean, I know what  $<foo>  means, and I know what  $<foo bar>   means, but I'm having trouble figuring out how we're getting to $<> from those.
18:38 pmichaud dha: S28 is conjectural.
18:39 pmichaud dha: or, put another way, S28 is more of a following document than a leading one.
18:39 dha Right. Hence my question above about whether it should be changed. to, from your comments, C<~$/>?
18:39 pmichaud different synopses have different levels of "frozenness".  Some contain fossils -- things that were once conjectured but have since been abandoned.
18:40 pmichaud yes, I think S28 should be changed there, if nobody here knows where the $<> came from.
18:40 pmichaud actually, let me git blame it a second and see if I can track it down
18:40 dha I really need to learn how to use git better. I never use blame. Probably 'cause I don't like blaming people. :-)
18:40 smls I thought maybe  $  followed by postcircumfix:{} is simply compiled to  $/  followed by postcircumfix:{}, but FROGGS' example disproves that.
18:41 FROGGS smls: my example is a special case of our grammar to catch P5isms
18:41 smls oh, so my theory could be true after all
18:41 FROGGS smls: so what you think can still be true
18:41 FROGGS aye
18:41 pmichaud yeah, it looks like $<> was conjectured from the Pugs days
18:42 pmichaud https://github.com/perl6/specs/commit/47f8cd8841e391b146334d2d40e83c26979d692a
18:42 bin_005 joined #perl6
18:43 geekosaur IIRC pugs used that syntax, yeh
18:43 geekosaur and it was conjectured as an alternate official syntax
18:43 dha Ok, shall I tweak S28 to C<~$/> as things stand?
18:43 pmichaud dha: yes, please.
18:44 pmichaud and thank you :)
18:45 dha done
18:45 dalek specs: dc72cb8 | (David H. Adler)++ | S28-special-names.pod:
18:45 dalek specs: Edited S28 to make C<~$/> the p6 analog of p5's C<$&>
18:45 dalek specs: review: https://github.com/perl6/specs/commit/dc72cb896e
18:45 pmichaud std:  say $<>;
18:45 camelia std 28329a7: OUTPUT«ok 00:00 136m␤»
18:46 DrForr m: say ">$_<";
18:46 camelia rakudo-moar eb3988: OUTPUT«5===SORRY!5=== Error while compiling /tmp/bmVj98jDWR␤Unable to parse quote-words subscript; couldn't find right angle quote␤at /tmp/bmVj98jDWR:1␤------> 3say ">$_<";7⏏5<EOL>␤    expecting any of:␤        postfix␤»
18:47 DrForr It blows up even more entertainingly if you have a method declaration later on :)
18:48 pmichaud m: my %h = 1,2;  say %h<>
18:48 camelia rakudo-moar eb3988: OUTPUT«1 => 2␤»
18:48 pmichaud m: my %h = 1,2,3,4;  say %h<>
18:48 camelia rakudo-moar eb3988: OUTPUT«1 => 2, 3 => 4␤»
18:48 dha Should I assume that, with the elimination of C<$`>, C<$&>, and C<$'>, the associated performance penalties have been done away with?
18:48 vendethiel joined #perl6
18:50 pmichaud dha: yes.
18:50 dha thanks.
18:50 pmichaud I suspect that $<> is being translated into   $/.postcircumfix:<{ }>()  which is returning self.
18:51 pmichaud m: 'foo bar' ~~ /foo { make 3 }/;  say $<>.WHAT
18:51 camelia rakudo-moar eb3988: OUTPUT«(Match)␤»
18:51 pmichaud m: 'foo bar' ~~ /foo { make 3 }/;  say $<> =:= $/
18:51 camelia rakudo-moar eb3988: OUTPUT«False␤»
18:51 pmichaud m: 'foo bar' ~~ /foo { make 3 }/;  say $/.perl
18:51 camelia rakudo-moar eb3988: OUTPUT«Match.new(ast => 3, list => (), hash => EnumMap.new(), orig => "foo bar", to => 3, from => 0)␤»
18:51 pmichaud m: 'foo bar' ~~ /foo { make 3 }/;  say $<>.perl
18:51 camelia rakudo-moar eb3988: OUTPUT«Match.new(ast => 3, list => (), hash => EnumMap.new(), orig => "foo bar", to => 3, from => 0)␤»
18:52 colomon I’m not seeing any sign of $<> in roast
18:53 pmichaud I think that $<> is just the same as $/.{}
18:53 pmichaud which is improperly returning self
18:53 geekosaur that's my recollection
18:53 pmichaud well, unless that behavior was added to make the decontainerizer work.
18:53 pmichaud (which I'm hoping to eliminate)
18:54 pmichaud my $a = 3;  say $a.perl
18:54 pmichaud m: my $a = 3;  say $a.perl
18:54 camelia rakudo-moar eb3988: OUTPUT«3␤»
18:54 pmichaud m: say 3<>
18:54 camelia rakudo-moar eb3988: OUTPUT«3␤»
18:54 pmichaud m: say 3<>.perl
18:54 camelia rakudo-moar eb3988: OUTPUT«3␤»
18:54 pmichaud yeah.
18:57 mohij joined #perl6
18:57 pmichaud smls: ${}   is a prefix:<$> followed by a hash constructor, I suspect.
18:57 pmichaud i.e., it's an itemized hash
18:58 pmichaud smls:  say ${ 1, 2, 3, 4}.perl
18:58 pmichaud er
18:58 pmichaud m:  say ${ 1, 2, 3, 4}.perl
18:58 camelia rakudo-moar eb3988: OUTPUT«5===SORRY!5=== Error while compiling /tmp/V7BJEBRPQ5␤Unsupported use of ${ 1, 2, 3, 4}; in Perl 6 please use $( 1, 2, 3, 4)␤at /tmp/V7BJEBRPQ5:1␤------> 3say ${ 1, 2, 3, 4}7⏏5.perl␤»
18:58 pmichaud hmmm
18:58 pmichaud that may need to go away in GLR.
18:59 cognominal Does  $<?> exist?  https://github.com/perl6/specs/blame/master/S03-operators.pod#L2508
19:00 pmichaud that looks like a definite fossil of some sort.
19:00 pmichaud technically,   $<?> would be the same as  $/{'?'}
19:00 Khisanth joined #perl6
19:00 cognominal ya, that's a follow up to your discussion
19:01 pmichaud I really want a way to do git blame on earlier versions of docs
19:01 pmichaud (via github)
19:01 cognominal so do I :)
19:02 masak original commit is 0c334d695d965883bdfd82fc624ecdd50f9224b9
19:02 masak "tweak result object from {''} into {'?'}"
19:02 pmichaud aha.  At one point it looks like .ast/.made/make was going into $/{'?'}, and prior to that it was in $/{''}
19:03 pmichaud (yes, I found out how to do it in github :)
19:03 cognominal share it with us :)
19:04 colomon (you just check out the old version and do blame on that, right?)
19:04 pmichaud writing...
19:07 pmichaud in this case I   1. followed the path to the commit (04b44e7) from cognominal's original blame listing, 2. clicked 'view' to see S03-operators as of that commit, 3. clicked 'history' to see the history of commits to that file up to that point, 4. clicked on the <> of the commit occurring before the 04b44e7 commit, 5. clicked "blame" on that
19:07 vendethiel colomon: should work
19:08 pmichaud repeat that sequence to go even earlier in history
19:08 dalek specs: 2991e87 | (Stéphane Payrard)++ | S03-operators.pod:
19:08 dalek specs: S03:  $() definition now consistant with S05
19:08 dalek specs: review: https://github.com/perl6/specs/commit/2991e87521
19:09 pmichaud afk, walk
19:10 dha so, S28 (which I trust less and less as time goes on... :-) indicates that the information formerly embodied by C<$+> can be gotten from C<$/> in p6.  I'm probably just being dense, but I don't see an obvious way of doing this.
19:11 ugexe $/<match-name>  vs $+{match-name} ?
19:12 smls ugexe: That's %+ not $+ (in Perl 5)
19:12 ugexe huh?
19:13 dha yeah. in p5 $+ is still just a scalar. :-)
19:13 smls they're two different things
19:13 PerlJam ugexe: perldoc perlvar  #  :)
19:13 dha But that will definitely be helpful when I get to %+! ?-)
19:17 PerlJam There's less uncertainty about such things in P6.
19:17 PerlJam m: for < Revision:1 Version:23 > { /'Version:' (.*)|'Revision:' (.*)/; say $/; }
19:17 camelia rakudo-moar eb3988: OUTPUT«「Revision:1」␤ 0 => 「1」␤「Version:23」␤ 0 => 「23」␤»
19:18 PerlJam (parrotting the example given in perldoc)
19:18 PerlJam notice that in both cases it's the $0 var that has a value.
19:18 smls Yeah, example could just use $0 in Perl 6, because capture numbering resets for each branch of an alternations
19:21 dha C<$/[-1]> working would make my life easier. :-)
19:22 PerlJam dha: $/[*-1] does work
19:22 dha Aha. What's the * doing there?
19:23 dha And whatever it's doing, it's ugly. :-)
19:23 smls_ joined #perl6
19:23 PerlJam that's funny
19:24 PerlJam * is actually a Whatever
19:24 dha ...right...
19:25 PerlJam S02:1126
19:25 synbot6 Link: http://design.perl6.org/S02.html#line_1126
19:25 smls_ m: my @a = 2, 4, 6; say @a[*-1]; say @a[{ $_ - 1 }];  # <-- dha
19:25 camelia rakudo-moar eb3988: OUTPUT«6␤6␤»
19:26 colomon m:  my @a = 2, 4, 6; say @a[* / 2];
19:26 camelia rakudo-moar eb3988: OUTPUT«4␤»
19:27 ugexe i think he is asking why not just @a[-1]. Is it because the syntax -\d+ wouldnt work in ranges nicely? or was the * added for readability reason?
19:27 pmichaud I think it's to avoid accidental negative subscripts in things such as   @a[$n]
19:28 PerlJam ugexe: more like we don't want @a[$foo] to accidentally do something unintended when $foo is negative
19:28 dha Ok, I'm just going to say "Just do it this way. DON'T ASK QUESTIONS."
19:28 PerlJam heh
19:28 pmichaud dha: if it's not terribly inconvenient, add a link to the relevant synopsis documentation
19:28 pmichaud such as the one PerlJam++ gave above :)
19:29 pmichaud and let that explain the *-1 part :)
19:29 dha Yeah, I was going to add "The use of "*" here is beyond the scope of this document. See...."
19:29 pmichaud my @a = 2,4,6;   say @a[1 % *];   # curious
19:29 pmichaud m: my @a = 2,4,6;   say @a[1 % *];   # curious
19:29 camelia rakudo-moar eb3988: OUTPUT«4␤»
19:30 pmichaud m: my @a = 2,4,6;   say @a[-1 % *];   # curious
19:30 camelia rakudo-moar eb3988: OUTPUT«6␤»
19:30 pmichaud coooool
19:30 smls_ In case the documentation dha is writing is for p6doc, I think links to other p6doc pages are actually preferred over links to synopses
19:30 pmichaud m: my @a = 2,4,6;   say @a[-3 % *];   # curious
19:30 camelia rakudo-moar eb3988: OUTPUT«2␤»
19:30 dha smls_-  agreed. Is Whatever covered in any of those?
19:30 pmichaud smls_: it's separate from p6doc at the moment, but you may be right that linking to p6doc is a better choice
19:31 ugexe m: my @a = 0,1,2,3; my $i = -2; say @a[*-$i]
19:31 camelia rakudo-moar eb3988: OUTPUT«(Any)␤»
19:31 smls_ dha: http://doc.perl6.org/type/Whatever
19:31 pmichaud ugexe: - won't work because * ends up being "number of elements in @a"
19:31 dha smls_-  Ta.
19:32 ugexe yeah, im interested in the proper way to handle iterating negative indexes
19:32 pmichaud ugexe: I'd use %, as above.
19:32 pmichaud dha / smls:  I'm looking for something that explains the *-1 syntax more directly, rather than the generic link to Whatever (which is a bit overwhelming)
19:33 dha That would be nice.
19:33 dha To someone coming from p5, "-1" would be obvious, "*-1" would be "WHAT???"
19:34 pmichaud http://doc.perl6.org/routine/%5B%20%5D   might be more straightforward
19:34 pmichaud or even  http://doc.perl6.org/routine/%5B%20%5D#language_documentation_Operators
19:34 PerlJam someone could write a whole blog post on the whys of Whatever/WhateverCode
19:35 pmichaud right.  which is why the first answer should be "use *-1 to index from the end", with the second in-depth answer being "okay, how/why exactly does that work?"
19:36 dha Yep. If someone writes that blog post, I will link to it. :-)
19:36 pmichaud imo, the p6doc for [] should mention *-1 as the way to index from the end _before_ talking about Callables.
19:37 pmichaud because someone new to p6 won't realize that *-1 is a Callable (and they shouldn't have to know that to use it)
19:37 smls_ true
19:37 * colomon glances back, and is stunned he never thought of the [N % *] idiom.  pmichaud++
19:38 lichtkind joined #perl6
19:39 pmichaud nicely, the N % * idiom explicitly says what we're wanting to do :)
19:39 pmichaud i.e., we're wanting to access the elements in a modulo fashion :)
19:39 lichtkind CHEERS
19:39 lichtkind can someone please check the tablets cronjob
19:40 lichtkind it stopped working
19:40 PerlJam lichtkind: um ... where was it running?
19:41 lichtkind i dont know exactly
19:41 lichtkind i think moritz did set it up
19:45 masak the [N % *] idiom is a few years old. I can't remember who used it first.
19:48 amurf joined #perl6
19:49 muethos hello, i am new and i have a problem. i hope i can explain what the problem is.
19:49 muethos i have a question.
19:49 muethos i have two arrays, one is with one pair x and y and the second is with more x and y pairs.
19:49 muethos the wormCoords is with more pairs and build in a method
19:49 muethos the applecoord has one pair
19:49 muethos now i want to know is applecoord in wormcoord
19:49 muethos i think i can do this with @wurm.first-index(@!appleCoord);
19:49 muethos @worm is because i give the wormCoords to the method as (@worm is rw)
19:49 muethos but the result is always NIL
19:51 muethos sorry for my bad english
19:51 masak m: my $pair = 1 => 2; say [4 => 3, 1 => 2].first-index($pair)
19:51 camelia rakudo-moar eb3988: OUTPUT«Use of uninitialized value of type Any in numeric context  in block <unit> at /tmp/fAejoyxdxK:1␤1␤»
19:51 smls If applecoord has only one pair, why is it an array?
19:52 masak hm, why am I getting an undefinedness warning?
19:52 lichtkind i double checked the code is clean and generates flawless html
19:52 lichtkind so its a server side issue
19:52 pmichaud how exactly do Pairs smartmatch again...?
19:52 muethos i know that i can use only x and y but i have tryed this to see that the output is the same
19:52 lichtkind masak: greetings to the north do you know who administers the dev server?
19:53 lichtkind http://tablets.perl6.org/appendix-b-grouped.html#smartmatch
19:53 pmichaud m: say Pair ~~ Associative
19:53 camelia rakudo-moar eb3988: OUTPUT«True␤»
19:53 lichtkind looking for that?
19:53 muethos look:
19:53 muethos @!appleCoord.perl= [[:x(2), :y(2)]]<>
19:53 muethos @wurm.perl= [[:x(6), :y(10)], [:x(6), :y(9)], [:x(6), :y(8)], [:x(2), :y(2)]]<>
19:53 muethos @wurm.first-index(@!appleCoord)=
19:53 muethos Nil
19:53 muethos this is the putput
19:54 smls m: my $apple = 1 => 2; my @worms = (4 => 3, 1 => 2, 5 => 6); say @worms.first-index(* eqv $apple)
19:54 camelia rakudo-moar eb3988: OUTPUT«1␤»
19:54 smls masak: smart-matching against a pair does something special, doesn't it?
19:54 muethos ok i try ths with * eqv
19:55 pmichaud note that the way this is written the elements of the array are actually arrays with two Pair objects
19:55 pmichaud so,  :x(2) and :y(2), not   2 => 2
19:55 pmichaud (probably better this way, yes)
19:56 pmichaud m: say [:x(1), :y(1)] ~~ [:x(1), :y(1)]    # curious
19:56 camelia rakudo-moar eb3988: OUTPUT«False␤»
19:56 pmichaud m: say [:x(1), :y(1)] cmp [:x(1), :y(1)]    # curious
19:56 camelia rakudo-moar eb3988: OUTPUT«Same␤»
19:56 pmichaud m: say [:x(1), :y(1)] cmp [:x(1), :y(2)]    # curious
19:56 camelia rakudo-moar eb3988: OUTPUT«Less␤»
19:56 pmichaud m: say [:x(2), :y(1)] cmp [:x(1), :y(2)]    # curious
19:56 camelia rakudo-moar eb3988: OUTPUT«More␤»
19:57 smls m: say [:x(1), :y(1)] eqv [:x(1), :y(1)]
19:57 camelia rakudo-moar eb3988: OUTPUT«True␤»
19:57 pmichaud yeah, eqv looks like the way to go here.
19:58 pmichaud but could also use junctions
19:58 pmichaud @!appleCoords eqv any(@wormCoords)
19:58 dha How do you people think about this stuff all day. My head hurts.
19:58 atroxaper joined #perl6
19:58 pmichaud or, more precisely:
19:59 pmichaud @!appleCoords[0] eqv any(@wormCoords)
19:59 smls Junctions ftw :)
19:59 masak dha: can only speak for myself. I like Perl 6 and want it to turn out nice.
19:59 PerlJam dha: you get used to it  (at least for the majority of things; there's still some head-hurting edges though)
19:59 smls m: my $apple = 1 => 2; my @worms = (4 => 3, 1 => 2, 5 => 6); say so any(@worms) eqv $apple
19:59 camelia rakudo-moar eb3988: OUTPUT«True␤»
20:00 pmichaud dha: in this case, I'm trying to find a perl6-ism that naturally maps to the original question.
20:00 smls ^^ muethos
20:00 pmichaud the original question was "how can I find out if an x-y pair is in a list of x-y pairs", so it makes me wonder if there's a natural way to express than in Perl 6
20:00 pmichaud in this case:   $apple eqv any(@worms)
20:01 pmichaud so, how do we do this all day?  well, we have a few standard idioms that we try to follow :)
20:02 muethos hmm
20:03 dha Reality check: the fuctionality previously provided by C<@+[0]> would now be provided by C<$/.to> ?
20:04 pmichaud dha:  $[0].to
20:04 pmichaud or $0.to
20:04 smls pmichaud: Do you think the compiler can some day learn to short-circuit   so $needle op any(@haystack)
20:04 pmichaud smls: yes.
20:04 muethos @!appleCoord.perl= [[:x(2), :y(2)]]<>
20:04 muethos @wurm.perl= [[:x(6), :y(10)], [:x(6), :y(9)], [:x(6), :y(8)], [:x(2), :y(2)]]<>
20:04 muethos @!appleCoord eqv any(@wurm);=  any(False, False, False, False)
20:04 muethos last have to be true?
20:04 pmichaud muethos: you need to use @!appleCoord[0]
20:05 pmichaud dha: oh, I misread.
20:05 pmichaud yes, $/.to
20:05 pmichaud $[0].to is the end of the first capture
20:05 dha whew. You had me worried, for a second.
20:05 pmichaud $/.to is the end of the full match
20:05 muethos the same
20:05 muethos :'(
20:06 pmichaud m: my @a = [:x(2), :y(2)]; my @w = [:x(6), :y(10)], [:x(2), :y(2)], [:x(6), :y(9)];  say @a[0] eqv any(@w);
20:06 camelia rakudo-moar eb3988: OUTPUT«any(False, True, False)␤»
20:07 pmichaud m: my @a = [:x(2), :y(2)]; my @w = [:x(6), :y(10)], [:x(2), :y(2)], [:x(6), :y(9)];  say so @a[0] eqv any(@w);
20:07 camelia rakudo-moar eb3988: OUTPUT«True␤»
20:08 pmichaud dha: I suspect part of the way we do this all day is that we're not constantly trying to figure out what the p5 equivalent would be.  :)
20:10 pmichaud smls: at some point we may be able to detect when junctions are being evaluated in boolean context and short-circuit them there.
20:10 dha Aha! I KNEW it had to be MY fault!
20:10 dha memo to self: STOP TRYING TO HELP PEOPLE.
20:10 pmichaud oh no, helping people is good.
20:10 muethos the problem is somewhere else.
20:10 muethos when i look at my debug output i see that the arrays like the array here im irc but the output from my code is different
20:11 pmichaud I'm very much a fan of your p5->p6 document.
20:11 dha pmichaud - If I'm going to actually be serious for a moment, that means a lot. Thanks. :-)
20:11 dha And, FWIW, I'm definitely open to comments.
20:12 pmichaud of course.  when the FB post came across I only had time to do a quick scan of what was there, but what I saw looked good and nothing jumped out at me as needing immediate correction.
20:13 dha Thanks.
20:14 dha I'm trying to keep it fairly simple. More of a map than a full explanation.
20:14 masak sounds sane.
20:15 dha "This is what you did in p5? Ok, this is what you should look at in p6."
20:15 pmichaud +1
20:15 masak I think I'd be most helped by (a) concrete examples making up the map, complemented by (b) the minimum amount of helpful explanation to "fill in the blanks".
20:17 dha Examples are definitely a good idea. I'll try to get to that after I work out the what-goes-where parts. I think I'll need to put my brain into a different mode for examples.
20:17 colomon joined #perl6
20:17 DrForr It's also a great sanity check from people outside spotting the WTFs.
20:18 dha I think I left sanity behind a while back...
20:20 masak sanity is such a relative concept.
20:22 DrForr And overrated.
20:23 kst joined #perl6
20:29 [Sno] joined #perl6
20:30 masak overrated in most contexts. because most contexts already have an overabundance of it.
20:33 RabidGravy dha, I was also going to suggest a bit on "what you may not need modules to do any more"
20:35 RabidGravy as in some, but only some mind, of Moose, POE and Threads are in there already
20:35 dha Also a good idea. If you have some in mind, I could start a list. Although that's something I probably won't get to until I get through the variables and builtin functions.
20:35 masak dha: I bet you could find a lot of nice inspiration from the Perl 6 Advent Calendar.
20:36 dha masak -  indeed. thanks.
20:44 mr-foobar joined #perl6
20:44 vendethiel .oO( we stay sane so that you don't have to )
20:47 [ptc] \o/  MoarVM 2015.06 has been accepted into Debian unstable: https://lists.alioth.debian.org/pipermail/pkg-rakudo-devel/2015-June/000603.html
20:47 masak m: my $saneness = <sane insane>.roll; my ($g1, $g2) = <we you>.pick(*); say "$g1 stay $saneness so $g2 don't have to"
20:47 camelia rakudo-moar eb3988: OUTPUT«we stay insane so you don't have to␤»
20:48 masak :P
20:48 dha Are there p6 equivalents for C<ARGVOUT> and C<$ARGV> at this point?
20:48 masak dha: don't know about former. latter is @*ARGS[$n]
20:50 lizmat dha: $ perldoc -r ARGVOUT
20:50 lizmat No documentation found for "ARGVOUT".
20:50 lizmat is that something newish ?
20:50 lizmat (this was 5.20.0)
20:50 dha It's in perlvar, under "Variables related to filehandles"
20:51 dha And isn't @*ARGS the command line arguments? $ARGV in p5 is the current filehandle when reading from <>. Which may, of course, mean it's not relevant to p6
20:52 lizmat reading from <> is $*IN
20:52 smls or $*ARGFILES, right?
20:52 lizmat yes
20:53 tony-o_ DrForr: yea i'm trying to figure out what part of Attribute.get_value($obj) is failing - right now it returns Failure but .perl doesn't but i'm not sure what other mechanisms i have to get the contents of the .ast attribute
20:53 masak well, reading from <> can also be `get()` or `lines()`, depending
20:53 lizmat in p6 , get() and lines() work on $*ARGFILES, afaik
20:54 masak and `while (<>) { ... }` in p5 is best written `for lines() { ... }` in p6
20:54 nwc10 lizmat: ARGVOUT, it seems, dates from the big 1.0: http://perl5.git.perl.org/perl.git/blob/perl-1.0:/perl.man.1#l144
20:54 masak lizmat: so does <> in p5, no?
20:54 dha Unless I'm misunderstanding, those are filehandles, not a variable which tells you what the current filehandle is, which is what $ARGV seems to be.
20:54 DrForr tony-o_: Got it, but it's almost bedtie here.
20:54 dha If I'm reading perlvar correctly.
20:54 tony-o_ DrForr: no worries, going to keep looking at it
20:55 * masak .oO( bedties are cool )
20:55 dha ARGVOUT seems connected to the -i command line switch, so, again, it may not have any use in p6
20:55 lizmat dha: at least not at the moment, no
20:55 masak I think -i is merely NYI in Rakudo.
20:55 lizmat possibly, not sure
20:56 colomon m: say -i
20:56 camelia rakudo-moar eb3988: OUTPUT«-0-1i␤»
20:57 * colomon was worried there for a sec.  ;)
20:57 masak haha
20:58 dha ok, unless I'm losing it, current input filehandle might be C<$*IN.path.what>
20:59 dha and similarly $*OUT for output handle
20:59 tony-o_ DrForr: got a good thing going for you for .ast
20:59 lizmat dha: for all practical purposes, $*IN *is* the handle
20:59 dalek roast: e963792 | jnthn++ | S12-methods/multi.t:
20:59 dalek roast: Fudged test for RT #74646.
20:59 dalek roast: review: https://github.com/perl6/roast/commit/e963792e12
20:59 synbot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=74646
21:00 lizmat dha: that's what you use to call methods such as .get and .lines on
21:00 dha But for the maybe-not-so-practical-purpose of having an analog to $ARGV...?
21:03 lizmat perlvar says: $ARGV   Contains the name of the current file when reading from "<>".
21:03 lichtkind hai liz
21:03 lichtkind do ypi know who has acess to the dev server?
21:03 lizmat dha: perl -E 'say $ARGV'  # empty line
21:04 lizmat lichtkind: I would guess moritz and FROGGS
21:04 dha Hm. I guess this entry is going to have to read "Answer unclear. Try again."
21:04 lichtkind but neither of them is online
21:04 dha Perl 6 Via Magic 8 Ball, by dha.
21:04 mohij .tell moritz <lichtkind> can someone please check the tablets cronjob, it stopped working
21:04 yoleaux mohij: I'll pass your message to moritz.
21:05 lizmat dha: I must admit I have never had a use for $ARGV in perl 5
21:05 lichtkind thanks mohij
21:05 masak dha: actually, I hardly touch @*ARGS anymore. because `multi MAIN` is so nice.
21:05 lizmat dha: could you give a small example of its usage?
21:06 pmichaud $*IN is the handle for standard input.
21:06 dha lizmat -  probably not. :-) I'm just working my way through perlvar.
21:06 masak oh, $ARGV, is the name of the current file when reading from <>
21:06 pmichaud right
21:06 masak yeah, I've never needed that.
21:06 pmichaud we're looking for something that while using lines() can tell us which file we're currently reading from
21:06 lizmat define "current file" ?
21:06 lichtkind lizmat.virtualhug();
21:07 masak lizmat: if you pass several files to -e
21:07 masak lizmat: and then loop over then with `while (<>)`
21:07 lizmat ah...
21:07 dha Yes. so is there an equivalent? Or does the way we read files in p6 obviate the need for this. Not that we seem to have needed it much in p5 either...
21:07 pmichaud for lines() { say   <MUMBLE> }    # what do I put here to tell me which file lines() is currently reading from?
21:07 pmichaud dha: I believe there's a need for the equivalent.
21:07 pmichaud having used $ARGV in p5, I'd want there to be an equivalent in p6
21:07 masak +1
21:07 dha pmichaud -  ok, but as of now there isn't one?
21:07 pmichaud I suspect it needs to be a method on $*ARGFILES
21:08 masak what does S28 say?
21:08 pmichaud since that is where lines() reads from.
21:08 dha S28 says "TBD"
21:08 smls perl -e 'while (<>) { print "$ARGV: $_\n" }' a.txt b.txt  # for example
21:09 dha As it does for ARGVOUT. But without a working -i option, ARGVOUT may be a moot point for now.
21:09 lizmat there *is* a .filename method on IO::ArgFiles opjects
21:09 lizmat *objects
21:09 pmichaud looks to me as though $*ARGFILES.filename will do it
21:09 pmichaud lizmat beat me by a couple of seconds :)
21:09 tony-o_ .tell DrForr give Data::Dump a shot with the ABNF stuff, i think it turned out pretty well
21:09 yoleaux tony-o_: I'll pass your message to DrForr.
21:11 espadrine joined #perl6
21:11 brrt joined #perl6
21:12 pmichaud https://gist.github.com/anonymous/f7edfb72a4f1f4d9fecc
21:12 pmichaud (shows that $*ARGFILES.filename appears to dtrt)
21:12 brrt that's weird
21:13 dha Thanks.
21:13 pmichaud brrt: what's weird?
21:13 brrt your bug :-)
21:13 brrt or, isn't that a bug
21:13 dalek specs/newio: 7506482 | pmichaud++ | S07-glr-draft.pod:
21:13 dalek specs/newio: Missing example provided by mj41++ .
21:13 dalek specs/newio:
21:13 dalek specs/newio: From http://irclog.perlgeek.de/perl6/2015-06-13#i_10746280 .
21:13 dalek specs/newio: review: https://github.com/perl6/specs/commit/750648257c
21:13 pmichaud brrt: it did exactly what I expected :)
21:13 lizmat sorry dalek
21:14 dalek joined #perl6
21:14 brrt are you certain? x.p6 comes in 3 times
21:14 pmichaud because it has three lines
21:14 PerlJam dha: $*ARGFILES.ins will give you $.  (since I'm guessing you're almost there too :)
21:14 pmichaud one for each lines
21:14 pmichaud *line
21:14 brrt aha
21:14 vendethiel m: say :{}; # we have that already. looks like an angry something :)
21:14 camelia rakudo-moar eb3988: OUTPUT«␤»
21:14 brrt right.... i see
21:14 pmichaud I didn't want to do README or Makefile because the output would've been too long :)
21:14 dha PerlJam -  yep. that'll be helpful. thanks.
21:15 brrt :-)
21:17 uncleyear joined #perl6
21:18 PerlJam though IIRC, $. won't reset on each file read from @ARGV without an explicit close.  I'm not sure how to obtain the same effect with $*ARGFILES.ins
21:19 PerlJam er, I mean .ins(), like $. won't reset.  I'm not sure how to get the reset-on-each-file behavior
21:19 spider-mario joined #perl6
21:19 dha How about C<$,>? Any analog for that? A quick glance at what's in $*OUT doesn't show anything obvious.
21:19 pmichaud https://github.com/perl6/doc/issues/96   # added issue, we don't have lines() or $*ARGFILES documented, it seems.
21:21 pmichaud PerlJam: I don't think there's an existing way to get reset-on-each-file, but it seems like it'd be relatively easy to forward a method call to $!io.ins somehow.
21:21 pmichaud (Inside of the ArgFiles object)
21:22 smls dha: IO::Handle does have a .print-nl method, maybe that does what PErl 5's $, does
21:23 smls hm no. looks like it's just a flag
21:23 dha yeah. Gives me "True"
21:24 smls m: $*OUT.nl = "_"; print 2; print 4;
21:24 camelia rakudo-moar eb3988: OUTPUT«24»
21:24 smls nope, that's not it either
21:24 smls I guess .nl is only used for input then
21:25 pmichaud at the moment .nl is only mentioned for input, yes.
21:25 dalek Heuristic branch merge: pushed 50 commits to rakudo/newio by lizmat
21:26 dalek Heuristic branch merge: pushed 48 commits to roast/newio by lizmat
21:27 lizmat fwiw, I seem to recall speccing something in the newio branch of the speculatoins
21:27 dha huh. there's an instance of C<$,> in the IO::Handle docs, but I'm not sure what it's doing there.
21:27 Sqirrel joined #perl6
21:27 dha sub run(*@args ($, *@)) returns Proc::Status:D
21:28 PerlJam dha: I think $, and $" won't have direct analogs as they have been subsumed by .gist and .Str on the appropriate class
21:28 lizmat m: my ($, $a, $b) = 1,2,3; say $b; say $c
21:28 camelia rakudo-moar eb3988: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Lc2rtl2I1K␤Variable '$c' is not declared␤at /tmp/Lc2rtl2I1K:1␤------> 3my ($, $a, $b) = 1,2,3; say $b; say 7⏏5$c␤»
21:28 lizmat m: my ($, $a, $b) = 1,2,3; say $a; say $b
21:28 camelia rakudo-moar eb3988: OUTPUT«2␤3␤»
21:29 lizmat dha: $, is just an anonymous scalar with a comma
21:29 dha Ah.
21:29 lizmat m: say $,
21:29 camelia rakudo-moar eb3988: OUTPUT«(Any)␤»
21:29 PerlJam dha: yeah, that's what replaces undef in that code you mentioned on FB  :)
21:29 lizmat m: say my Bag $,
21:29 camelia rakudo-moar eb3988: OUTPUT«(Bag)␤»
21:33 dha I'm thinking S28 could use a bit of an overhaul... :-)
21:33 pmichaud I'm thinking S28 needs a huge overhaul.
21:34 pmichaud it's definitely very out-of-date, and I've seen several occurrences in the last month where people have gotten incorrect information from it
21:34 PerlJam I'm thinking dha is the perfect person to make that happen ;)
21:34 lizmat PerlJam: I agree
21:34 pmichaud at the least we should put a prominent notice that S28 is currently fossilized
21:34 PerlJam pmichaud: +!
21:34 PerlJam er +1
21:35 dha PerlJam -  Don't make me come after you...
21:35 lizmat m: my $a will init { ... };   # this should throw an NYI, but doesn't  :-(
21:35 camelia rakudo-moar eb3988: ( no output )
21:35 pmichaud also, if S28 is primarily reference/documentation, as opposed to providing specification, perhaps it should be eliminated entirely in favor of p6doc
21:36 lizmat even though the trait_mod contains just that
21:36 pmichaud s/specification/design details/
21:36 PerlJam pmichaud: when was that repo rename gonna happen? :)
21:36 pmichaud in particular, would we expect there to be a lot of tests associated with S28?  If not, it's a likely candidate for removal/obsolesence, I think.
21:36 pmichaud PerlJam: I don't want to force the rename until I'm fairly sure I'll be around to help clean up the fallout :)
21:37 pmichaud i.e., I'm okay with asking forgiveness, but not that much forgiveness
21:39 pyrimidine pmichaud: any budging on naming the new type 'Seq'?  Kinda conflicts with similar class/role names from us bioinfo types: https://metacpan.org/pod/Bio::Seq
21:39 pyrimidine Though I suppose if we use Bio::Seq that would disambiguate it :)
21:39 pmichaud pyrimidine: sure, I'm open for changes.  The notion behind the Seq type is that it's the thing that handles iterations
21:40 dha I have to admit, although it's lacking, s28 has been pretty helpful in mapping p5 variables to p6 variables in a number of cases, or at least pointing me in the right direction.
21:40 pmichaud I'd like to see the p5-to-p6 mapping be more of a p6doc thing than a design-doc sort of thing, I think.
21:40 dha pmichaud -  Working on that... :-)
21:41 pmichaud pyrimidine: "Seq" for the moment is a class of objects that are a sequence of values.  It's very much like a List, but with the expectation that elements are to be consumed (e.g. in iteration)
21:41 dha Incidentally, above you said that C<.nl> was only mentioned for input handles. It does return something for $*OUT, though. The question from my perspective, of course, is that the equivalent of C<$\> in p5?
21:42 pmichaud I'm totally open for other names, as long as they're relatively clear, since programmers will encounter them
21:42 pmichaud for example, I expect the result of a    gather/take will end up being a "Seq"
21:42 pmichaud same for lines()
21:43 pmichaud same for   1, 2, ... *
21:43 smls so... basically ListIter? :P
21:43 pmichaud er:  1, 2 ... *
21:43 pmichaud smls: not really.... ListIter is the thing that generates the elements
21:43 pmichaud I'm not sure where the *Iter classes will end up.  But I don't want them to be user-facing, at any rate.
21:44 pyrimidine pmichaud: makes sense.  ok, will think about it.  I'm actually fairly neutral on it (I would know the differenct), just possibly over-worried about user confusion
21:44 pmichaud i.e.,   I wouldn't want   lines().WHAT to give me back "ListIter"
21:45 jnthn Gen (for Generator) may give the right semantic idea to some, depending on background.
21:45 pmichaud I might be able to go with Gen
21:45 pmichaud anyway, these thoughts will be in tonight's S07 update :)
21:45 jnthn yay, I'll have breakfast reading :)
21:46 lizmat would a generic Iter not be better ?
21:46 pmichaud Over the weekend I managed to break (I think) the linkage between ListIter and populating Lists and Arrays...
21:46 pmichaud lizmat: well, I really want the term to reflect the results of the iteration, not the iterator itself.
21:46 pmichaud "Iter" might represent that, but it's not as "clean" to me as "Seq"
21:47 atroxaper joined #perl6
21:47 pmichaud i.e.,  I like that    1, 1, *+* ... *   gives me back a Seq object
21:47 lizmat pmichaud: will ponder
21:47 dha S28 indicates that $| is replaced by an .autoflush method, but it's not in the docs for IO::Handle. Does it exist?
21:47 pmichaud and gather/take gives me back a Seq object
21:47 dha Incidentally, please tell me if I'm becoming a nuisance...
21:47 pmichaud anyway, the name is open for bikeshedding, yes.
21:48 pmichaud dha: you're not annoying me :)
21:48 dha oh good. :-)
21:48 masak dha: thank you for helping us clean up S28! :)
21:48 pmichaud I don't recall seeing a .autoflush for quite some time, so I'm doubtful it exists in any implemented sense.
21:49 pmichaud perhaps there needs to be one, but that's a design discussion
21:49 smls m: say IO::Handle.^methods(:all)».name.grep(/flush/)
21:49 camelia rakudo-moar eb3988: OUTPUT«␤»
21:49 smls hm, locally it prints "flush"
21:49 smls but no "autoflush"
21:50 lizmat autoflush could be implemented relatively easily
21:51 lizmat but maybe it should be done at the nqp / PIO level
21:51 masak 'night, #perl6
21:52 lizmat good night, masak
21:52 frobisher joined #perl6
21:54 dha You know, now that I'm doing this, I'm finding a whole bunch of variables I never knew existed.
21:54 lizmat dha: ARGVOUT was new to me  :-)
21:55 ruoso joined #perl6
21:55 dha I'm about to encounter ${^LAST_FH}
21:56 dha I know I never used that.
21:56 dha So, while I was disconnected did I get an answer about autoflush?
21:57 lizmat dha: http://irclog.perlgeek.de/perl6/today
21:57 dha Ah. thanks.
22:02 dha I'm going to take a leap of faith and assume that there's no equivalent of C<${^LAST_FH}> in Perl 6 at the moment.
22:03 pmichaud that's a reasonable leap.
22:07 lizmat dha: indeed
22:08 dha OH GOOD LORD. Variables related to formats are next.
22:08 dha Please tell me formats are dead?
22:08 lizmat there is no format in P6
22:08 yqt joined #perl6
22:08 dha YAY!
22:09 lizmat something tells me that it could be removed from P5 also for 5.24 perhaps ?
22:09 lizmat .oO( waiting for [Tux] to scream :-)
22:10 smls I think Perl 5 uses longer deprecation periods than that :)
22:10 RabidGravy I'm not sure the last time I used a format
22:11 muethos joined #perl6
22:11 RabidGravy they had their charm, especially at the time I was dealling with report generation languages like RPG and Informix ACE
22:13 geekosaur I still use them occasionally
22:13 RabidGravy okay twenty years ago
22:13 geekosaur that said, I always end up using hackery to make them do what I want, and well.
22:13 geekosaur ...ace, hadn't heard of that in decades
22:14 pmichaud http://perl6.org/archive/doc/design/exe/E07.pod
22:14 geekosaur I think most of my Informer knowledge has finally paged out to the bitbucked >.>
22:14 geekosaur *bitbucket
22:15 b2gills joined #perl6
22:17 dha So, I think I'm going to say for p5's C<$!>, C<$?>, C<$@>, and C<$^E>, they've all been eaten by p6's C<$!>. For stuff like C<${^CHILD_ERROR_NATIVE}>, I'm going to assume they might be in $!, but your guess is as good as mine.
22:20 dha Hm... the documentation for C<$!> is... sparse.
22:20 pmichaud yes, it is.
22:20 dalek rakudo/nom: 75307d0 | lizmat++ | src/core/Deprecations.pm:
22:20 dalek rakudo/nom: Make sure deprecations are listed in fixed order
22:20 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/75307d0339
22:21 dha Sorely tempted to say "Errors are now contained in C<$!>. How it actually works is anybody's guess. Next!"
22:21 pmichaud works for me :)
22:22 dalek roast: e6ec6ac | lizmat++ | S02-types/deprecations.t:
22:22 dalek roast: Test deprecations in correct order
22:22 dalek roast:
22:22 dalek roast: This fixes a test error on the JVM
22:22 dalek roast: review: https://github.com/perl6/roast/commit/e6ec6ac6c2
22:26 lizmat good night, #perl6!
22:32 dha good night lizmat
22:32 jnthn o/ lizmat
22:33 dha so, regardless of what S28 indicates, shall I assume that C<$^C> and C<$^D> do not currently have p6 equivalents?
22:34 pmichaud I'm not aware of equivalents.
22:35 ilogger2 joined #perl6
22:36 dha And p5 C<${^ENCODING}> does not seem to be equivalent to <$*ENC>...
22:36 dha And, *sigh* C<${^GLOBAL_PHASE}>? Anything like that?
22:37 pmichaud I'm not aware of a GLOBAL_PHASE equivalent.
22:38 dha And, fortunately the next few are internal anyway, and no one should be messing with them...
22:40 geekosaur I don't think ^GLOBAL_PHASE is applicable? p6 has more principled mechanisms
22:41 geekosaur and any perl 5 script using ${^GLOBAL_PHASE} is going to need a bit more thinking to convert
22:41 dha And C<$^P>? Does the debugger even resemble the p5 debugger?
22:41 dha IS there a debugger?
22:43 jnthn There's a debugger, but given it's built out of architectural things that don't exist in Perl 5 by somebody who never used the Perl 5 debugger, a resemblence is highly unlikely. :)
22:45 amurf joined #perl6
22:46 pmichaud afk, dinner
22:46 dha ta.
22:54 jnthn sleep &
22:58 dha Hallelujah. I have finished going through perlvar.
23:00 gtbjj joined #perl6
23:01 gtbjj left #perl6
23:01 gtbjj joined #perl6
23:03 skids joined #perl6
23:07 gtbjj Hello, '
23:07 gtbjj I'm looking to contribute to the perl6.org website, could I request a commit bit for github?
23:11 vendethiel joined #perl6
23:22 leont joined #perl6
23:22 b2gills joined #perl6
23:48 dayangkun joined #perl6
23:59 vendethiel joined #perl6
23:59 cognominal joined #perl6

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

Perl 6 | Reference Documentation | Rakudo