Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6-dev, 2017-05-16

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

All times shown according to UTC.

Time Nick Message
00:31 lizmat_ joined #perl6-dev
01:49 ilbot3 joined #perl6-dev
01:49 Topic for #perl6-dev is now Perl 6 language and compiler development 2.0 | Logs at http://irclog.perlgeek.de/perl6-dev/today | For toolchain/installation stuff see #perl6-toolchain | For MoarVM see #moarvm
05:06 geekosaur joined #perl6-dev
06:09 sasheto joined #perl6-dev
06:34 [Tux] This is Rakudo version 2017.04.3-249-gd18a3332e built on MoarVM version 2017.04-64-g6d5ea042
06:34 [Tux] csv-ip5xs        2.595
06:34 [Tux] test            12.717
06:35 [Tux] test-t           4.194 - 4.222
06:35 [Tux] csv-parser      12.865
07:29 [Tux] This is Rakudo version 2017.04.3-272-gd76206e74 built on MoarVM version 2017.04-64-g6d5ea042
07:29 [Tux] csv-ip5xs        2.531
07:29 [Tux] test            12.516
07:29 [Tux] test-t           4.337 - 4.350
07:29 [Tux] csv-parser      12.919
08:02 pmurias joined #perl6-dev
08:03 Geth ¦ nqp: 4bd35f9b62 | pmurias++ | src/vm/js/nqp-runtime/code-ref.js
08:03 Geth ¦ nqp: [js] Better creation of missing outer scopes
08:03 Geth ¦ nqp: review: https://github.com/perl6/nqp/commit/4bd35f9b62
08:03 Geth ¦ rakudo/js: 6 commits pushed by pmurias++
08:03 Geth ¦ rakudo/js: a2ddab8948 | [js] Remove the js- prefix in generated .nqp files
08:03 Geth ¦ rakudo/js: 8e818ed6ae | [js] Remove old commented out code
08:03 Geth ¦ rakudo/js: f000dff36b | [js] Concatenate the CORE.setting together at make time
08:03 Geth ¦ rakudo/js: 32756b20cf | [js] Disable constant folding in the optimizer as it's causing trouble
08:03 Geth ¦ rakudo/js: 2b99afeb5c | [js] Update .gitignore
08:03 Geth ¦ rakudo/js: ab85d0a9d7 | [js] Add building the setting to the Makefile
08:03 Geth ¦ rakudo/js: review: https://github.com/rakudo/rakudo/compare/d7fb541e77...ab85d0a9d7
08:08 lizmat_ And a new Perl 6 Weekly hits the Net: https://p6weekly.wordpress.com/2017/05/16/2017-20-crossing-the-alps/
08:42 cognominal lizmat++
09:32 [TuxCM] joined #perl6-dev
09:58 Zoffix lizmat: shoudl System::Info be added to ecosystem?
09:58 yoleaux 01:23Z <samcv> Zoffix: merged and version bumped :) thank you
10:09 Zoffix lizmat++ good weekly
10:09 |Tux| joined #perl6-dev
10:10 nine Zoffix: lizmat++ could just upload it to CPAN ;)
10:11 Zoffix nine: but then what? I guess that's one part I'm not clear about. I could upload Perl 6 dists to CPAN a year ago, but there was no way to see them. Did that change? How can I see what Perl 6 dists are available on CPAN?
10:13 Zoffix There's System::Info, but it's Perl 5 version: https://metacpan.org/pod/System::Info
10:14 moritz Zoffix: at the moment, it's just a CDN for us, and we have to use our own infrastructure to find the modules on CPAN
10:16 Zoffix ok
10:16 nine Zoffix: it can then be installed with zef --cpan install System::Info
10:17 Zoffix nine: I can also install anything with zef install https://perl6.party/My::Module.zip, but it's pointless if no one knows it's there and My::Module exists
10:18 Zoffix So saying lizmat could "just" upload to CPAN is a bit misleading
10:23 nine Zoffix: "zef --cpan update && zef --cpan --/p6c --/cached list" to see what's available on CPAN
10:25 nine https://github.com/ugexe/Perl6-ecosystems/blob/master/cpan.json is the index regenerated every 30 or so minutes.
10:32 nine I guess the next steps will be to move this cpan.json to a more official location and use it on modules.perl6.org.
10:35 Zoffix huggable: cpan
10:35 huggable Zoffix, http://www.cpan.org/authors/id/P/PS/PSIXDISTS/Perl6/
10:38 Zoffix neat
10:39 Zoffix Is the mechanism for deleting modules known? For example, I see at least one of my modules I long deleted, but it's still in the PSIXDISTS's dir...
10:39 Zoffix huggable: cpan zef
10:39 huggable Zoffix, nothing found
10:39 Zoffix huggable: cpan zef :is: view Perl 6 modules available on CPAN: zef --cpan update && zef --cpan --/p6c --/cached list
10:39 huggable Zoffix, Added cpan zef as view Perl 6 modules available on CPAN: zef --cpan update && zef --cpan --/p6c --/cached list
10:40 Zoffix huggable: cpan json :is: Perl 6 modules on CPAN: https://github.com/ugexe/Perl6-ecosystems/blob/master/cpan.json
10:40 huggable Zoffix, Added cpan json as Perl 6 modules on CPAN: https://github.com/ugexe/Perl6-ecosystems/blob/master/cpan.json
10:41 nine Zoffix: it's the same as for Perl 5 dists, i.e. go to https://pause.perl.org log into your account and select "Delete Files" from the menu. For deleting from PSIXDISTS, you'll have to ask ranguard as it's his account.
10:45 Zoffix .ask ranguard how can I delete all my modules from http://www.cpan.org/authors/id/P/PS/PSIXDISTS/Perl6/ and prevent anything new from me uploaded again (github username zoffixznet)? I'm gonna be uploading my dists on my own and I see some of the stuff in PSIXDISTS are modules are long deleted entirely..
10:45 yoleaux Zoffix: I'll pass your message to ranguard.
10:47 Zoffix I should rake through the sauce of http://github.com/bingos/gumbypan/tree/master and make one of hour bots report Perl 6 dist uploads to CPAN, like GumbyPAN does :)
10:48 nine ++Zoffix
11:27 Zoffix .tell lizmat just remembered, it was samcv++ that fixed the +> op in MoarVM. I just removed a kludge from rakudo
11:27 yoleaux Zoffix: I'll pass your message to lizmat.
12:51 Geth ¦ roast/6.c-errata: 5c703c355d | (Zoffix Znet)++ | S16-io/words.t
12:51 Geth ¦ roast/6.c-errata: Simply plan number
12:51 Geth ¦ roast/6.c-errata: review: https://github.com/perl6/roast/commit/5c703c355d
12:52 Zoffix sorry, was on the wrong branch -_-
12:53 * Zoffix adds the "git branch in your bash line" thing to this box
12:55 [Coke] Zoffix: yes, that's very helpful.
12:55 Zoffix namely this: https://gist.github.com/zoffixznet/4fc6c4628e50af70d2c90032372c6c33
12:59 [Coke] I had a standalone at some point, and then started leaving a copy of git checked out somewhere so I could use the version "in core"
13:00 [Coke] ... I think. I'm in the middle of moving off that machine, and brain cells ain't what they used to be.
13:30 ugexe Zoffix:(or anyone) we could also use another mirror of that cpan file so that we don't still get owned when github goes down
13:31 ugexe you could even apply your own filters so it only lists what you think it should
13:33 Zoffix ugexe: btw was it you who had a list of most popular modules? I need that list to test a bunch of modules with releases.
13:34 ugexe Zoffix: no, haven't heard of that yet
13:34 Zoffix moritz: was it you?
13:41 moritz Zoffix: somebody sent an analysis to me years ago
13:42 Zoffix oh :( I want recent. I guess going by github stars is good enough for my purpose.
14:14 ugexe btw - tadzik removed panda from rakudobrew so a bunch of .travis.yml will be broken right now (all the ones that use rakudobrew build-panda)
14:14 ugexe good candidate for automated PRs probably
14:14 tadzik ...whoops
14:15 ugexe tadzik: its for the best anyway... its not like there is an issue tracker to file against :)
14:15 tadzik :>
14:15 tadzik yeah, I took care of that too :P
14:16 tadzik well, rakudobrew still has one
14:16 tadzik I guess I could've handled that more gracefully
14:17 tadzik but hey, if you rely on master being always stable and working and without changes...
14:18 * Zoffix ponders an alert.perl6.org
14:18 jnthn Yeah, that rakudobrew change bit my $dayjob project. I'd totally forgotten its .travis.yml was still was using Panda...probably 'cus I'd just copy-pasted it from somewhere. :)
14:19 Zoffix Some tips and bits that are too small to warrant a whole post on rakudo.org but still something we'd want to dissiminate to users in some way. So alert.perl6.org could be an RSS feed or bloglet or something that also automatically tweets any new updates
14:19 Zoffix Like "still using panda in your .travis.yml? Swap to zef"
14:19 Zoffix It's also still listed here: https://docs.travis-ci.com/user/languages/perl6
14:20 jnthn ah, that's probably where I copy/pasted from ;)
14:20 Zoffix "rakudobrew build-panda 2015.07" heh :)
14:20 tadzik I could add that as a check for modules.perl6.org/todo
14:25 ugexe the more checks the better
14:34 nine Things like this are exactly why I want as little "how" and as much "what" as possible in our module's build info.
14:38 perlpilot joined #perl6-dev
14:49 Zoffix c: HEAD with "/tmp/foo42".IO -> $f { $f.spurt: "a\nb\nc"; my @a; for $f.open.lines(2, :close) { @a.push: $_ }; dd @a }
14:49 committable6 Zoffix, ¦HEAD(d76206e): «Array @a = ["a"]»
14:50 Zoffix c: 2017.04  with "/tmp/foo42".IO -> $f { $f.spurt: "a\nb\nc"; my @a; for $f.open.lines(2, :close) { @a.push: $_ }; dd @a }
14:50 committable6 Zoffix, ¦2017.04: «Array @a = ["a"]»
14:50 Zoffix c: 2017.03  with "/tmp/foo42".IO -> $f { $f.spurt: "a\nb\nc"; my @a; for $f.open.lines(2, :close) { @a.push: $_ }; dd @a }
14:50 committable6 Zoffix, ¦2017.03: «Array @a = ["a", "b"]»
14:50 Zoffix Zoffix--
14:50 Zoffix ZofBot: nead moar tests \o/
14:50 ZofBot Zoffix, This class will then be composed, with any conflicts indicated
14:51 Zoffix Almost got this bug into .words too but my new tests for words caught it
15:02 Zoffix ZOFVM: Files=1242, Tests=135580, 114 wallclock secs (21.59 usr  3.02 sys + 2313.20 cusr 165.24 csys = 2503.05 CPU)
15:05 Geth ¦ rakudo/nom: bf399380c1 | (Zoffix Znet)++ | src/core/Rakudo/Iterator.pm
15:05 Geth ¦ rakudo/nom: Fix off-by-one in Rakudo::Iterator.FirstNThenSinkAll
15:05 Geth ¦ rakudo/nom:
15:05 Geth ¦ rakudo/nom: Introduced[^1] to implement close-with-limit feature in
15:05 Geth ¦ rakudo/nom: IO::Handle.lines/IO::Path.lines/&lines and causes returned
15:05 Geth ¦ rakudo/nom: Seq for this arg combination for those routine to be missing
15:05 Geth ¦ rakudo/nom: last item.
15:05 Geth ¦ rakudo/nom:
15:05 Geth ¦ rakudo/nom: [1] https://github.com/rakudo/rakudo/commit/90da80f6202d4b44e2bf6b
15:05 Geth ¦ rakudo/nom: review: https://github.com/rakudo/rakudo/commit/bf399380c1
15:05 Geth ¦ rakudo/nom: 8065d544f1 | (Zoffix Znet)++ | src/core/Rakudo/Iterator.pm
15:05 Geth ¦ rakudo/nom: Remove copy-pastoed unused attribute
15:05 Geth ¦ rakudo/nom: review: https://github.com/rakudo/rakudo/commit/8065d544f1
15:07 Geth ¦ rakudo/nom: 84502dc200 | (Zoffix Znet)++ | src/core/IO/Handle.pm
15:07 Geth ¦ rakudo/nom: [io grant] Implement $limit arg for IO::Handle.words
15:07 Geth ¦ rakudo/nom:
15:07 Geth ¦ rakudo/nom: - Makes interface consistent with Str.words
15:07 Geth ¦ rakudo/nom: - If :close is given, will close handle after reaching limit
15:07 Geth ¦ rakudo/nom:     (or if iterator got exhausted before reaching it)
15:07 Geth ¦ rakudo/nom: - Lets &words/IO::Path.words to read a $limit number of words
15:07 Geth ¦ rakudo/nom:     and close the internally used handle, avoiding the open
15:07 Geth ¦ rakudo/nom:     handle leakage issue.
15:07 Geth ¦ rakudo/nom: review: https://github.com/rakudo/rakudo/commit/84502dc200
15:09 Geth ¦ roast: b0c4a7a37c | (Zoffix Znet)++ | S16-io/words.t
15:09 Geth ¦ roast: [io grant] Test &words, IO::Handle.words, and IO::Path.words
15:09 Geth ¦ roast:
15:09 Geth ¦ roast: - Toss old tests; they didn't test any routine args and only two
15:09 Geth ¦ roast:   whitespace types of whitespace, and used inappropriate `is`
15:09 Geth ¦ roast: - Test: with all currently-available Zs chars, all the args,
15:09 Geth ¦ roast:   and all three routines ($*ARGFILES.words tests will come with IO::CatHandle)
15:09 Geth ¦ roast: - Include heuristic test for IO::Path.words failing to close the handle
15:09 Geth ¦ roast:     after iterator has been exhausted/limit reached
15:09 Geth ¦ roast: review: https://github.com/perl6/roast/commit/b0c4a7a37c
15:14 Geth ¦ roast: 25cf5a58bb | (Zoffix Znet)++ | S16-io/words.t
15:14 Geth ¦ roast: Add indicator to is_run test's code
15:14 Geth ¦ roast:
15:14 Geth ¦ roast: That will guarantee the loop in the code actually got run.
15:14 Geth ¦ roast: review: https://github.com/perl6/roast/commit/25cf5a58bb
15:25 Geth ¦ roast: f3d1f67988 | (Zoffix Znet)++ | S16-io/lines.t
15:25 Geth ¦ roast: [io grant] Test $limit arg with &lines/IO::*.lines
15:25 Geth ¦ roast:
15:25 Geth ¦ roast: Rakudo fix: https://github.com/rakudo/rakudo/commit/bf399380c1
15:25 Geth ¦ roast: review: https://github.com/perl6/roast/commit/f3d1f67988
15:46 [Coke] Zoffix: did you remove the dep in perl6/doc on the bigpage stuff?
15:47 Zoffix Don't think so
15:47 [Coke] ah, no, it's still in the META
15:47 [Coke] "make" is currently failing for me.
16:24 Zoffix m: my @a; with "/tmp/foo42".IO -> $f { $f.spurt: "a\nb\nc"; for ^15000 { @a.push: $f.open; } }
16:24 camelia rakudo-moar 84502d: ( no output )
16:24 Zoffix Why doesn't this reach the max-open-files thing?
16:26 Zoffix oh doh. Failures
16:28 Zoffix m: my @a; with "/tmp/foo42".IO -> $f { $f.spurt: "a\nb\nc"; for ^15000 { use fatal; @a.push: $f.open; } }
16:28 camelia rakudo-moar 84502d: OUTPUT: «Failed to open file /tmp/foo42: too many open files␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
16:38 Geth ¦ roast: 4f5589b274 | (Zoffix Znet)++ | S16-io/lines.t
16:38 Geth ¦ roast: [io grant] Add test for handle leak in IO::Path.lines
16:38 Geth ¦ roast: review: https://github.com/perl6/roast/commit/4f5589b274
16:39 Geth ¦ roast: 7b592f5e12 | (Zoffix Znet)++ | S16-io/lines.t
16:39 Geth ¦ roast: Fix re-declaration warnings
16:39 Geth ¦ roast: review: https://github.com/perl6/roast/commit/7b592f5e12
16:39 Zoffix .oO( why is redeclaration a warning and not a fatal error... )
16:39 Zoffix Another bit of Perl 5 that should've been left where it was found.
16:53 [Coke] Zoffix: Maybe add that to to the 6.d doc? I'd be fine with it being a compile time error.
16:53 [Coke] (as a proposal)
16:53 Zoffix huggable: 6.d
16:53 huggable Zoffix, Proposals for 6.d language: https://github.com/perl6/specs/blob/master/v6d.pod
16:58 Zoffix [Coke]: I guess that would break doc xtest?
17:21 AlexDaniel joined #perl6-dev
17:23 samcv joined #perl6-dev
17:27 [Coke] Zoffix: which would?
17:28 [Coke] oh, the redec. I'd update the xtest to deal with it.
17:28 Zoffix [Coke]: the code checker
17:28 Zoffix OK
17:28 [Coke] (or the docs)
17:46 AlexDaniel Zoffix: I love your IO work
17:48 Zoffix Why?
17:49 AlexDaniel should there be some clearly defined reason to love something? :)
17:49 AlexDaniel I'm just happy that somebody is working on all of these issues
17:50 AlexDaniel (and doing it well)
17:50 Zoffix Cool
17:50 geekosaur somewhere lizmat is sighing...
17:51 Zoffix hah, true :)
17:54 Zoffix I rember getting annoyed of just going through pages and pages of "merge nom" commits to newio; I can't imagine what it was like to actually be doing them.
17:58 geekosaur "frustrating"
18:16 Zoffix .
18:16 yoleaux 18:15Z <haxmeister> Zoffix: DOM::Tiny seems to work fine, installs ok and parses without error. When I get some time I'll dig more and try to understand the data structure it produces and how to get at it.
18:29 japhb joined #perl6-dev
18:57 Ven joined #perl6-dev
19:09 [Coke] ah, my doc issue was a rakudobrew rehash.
19:11 Zoffix :)
19:14 Zoffix oops. I just now realized that all the people who received my patch renaming META.info to META6.json received it in a form of a commit with a single 340-char line :(
19:14 Zoffix ZofBot: that's what happen when you rely on JavaScript to do your work for you!
19:14 ZofBot Zoffix, But I'm not sure what exactly you're after
19:15 Zoffix ZofBot: I was after 72-char or less commit messages, but it all put it in one line
19:15 ZofBot Zoffix, The exceptions will be noted as we go
19:17 geekosaur forget a blank line?
19:17 [Coke] need json pretty printer.
19:18 [Coke] oh. You mean message, not content. oooops
19:19 Zoffix No, I just had a JS script paste the text into the "Commit message" text area and apparently the site wraps the text even if it's doesn't actually have newlines in it :/
19:38 Geth ¦ nqp/master: 4 commits pushed by pmurias++
19:38 Geth ¦ nqp/master: e0cd8a51a6 | [js] Fix creation of missing outer scopes
19:38 Geth ¦ nqp/master: f58bb710d3 | Improve test descriptions
19:38 Geth ¦ nqp/master: 9c67f1d980 | [js] Add type object support to some boolification modes
19:38 Geth ¦ nqp/master: 0a67b5ce3e | Test boolification of type objects
19:38 Geth ¦ nqp/master: review: https://github.com/perl6/nqp/compare/4bd35f9b62...0a67b5ce3e
19:42 Ven_ joined #perl6-dev
19:43 sasheto joined #perl6-dev
19:52 robertle joined #perl6-dev
19:54 [TuxCM] joined #perl6-dev
19:58 Ven joined #perl6-dev
20:27 Ven_ joined #perl6-dev
20:32 dogbert17 commit: 2016.06 say "zofbot" # test
20:32 committable6 dogbert17, ¦2016.06: «zofbot»
20:33 AlexDaniel “zoffixznet assigned zoffixznet and unassigned zoffixznet an hour ago” … Schrödinger's Zoffix?
20:33 dogbert17 commit: 2016.06 my @a = [1,[2,3],4]; dd @a.duckmap({ $_ ~~ Int ?? $_++ !! Any });
20:33 committable6 dogbert17, ¦2016.06: «(1, (2, 3), 4)»
20:33 dogbert17 m: my @a = [1,[2,3],4]; dd @a.duckmap({ $_ ~~ Int ?? $_++ !! Any });
20:33 camelia rakudo-moar 84502d: OUTPUT: «[1, Any, 4]␤»
20:34 dogbert17 when did this change?
20:34 AlexDaniel there's a bot for that
20:34 AlexDaniel bisect: my @a = [1,[2,3],4]; dd @a.duckmap({ $_ ~~ Int ?? $_++ !! Any });
20:34 bisectable6 AlexDaniel, Bisecting by output (old=2015.12 new=84502dc) because on both starting points the exit code is 0
20:34 dogbert17 don't know about it :)
20:34 bisectable6 AlexDaniel, bisect log: https://gist.github.com/6628de27aaf7039000387b4a3a059774
20:34 bisectable6 AlexDaniel, (2016-09-26) https://github.com/rakudo/rakudo/commit/ca93ac9084d74a4e2e4bf7d247c230e8b1e39330
20:34 AlexDaniel looks like your commit
20:34 dogbert17 oops
20:35 AlexDaniel c: ca93ac90^,ca93ac90 my @a = [1,[2,3],4]; dd @a.duckmap({ $_ ~~ Int ?? $_++ !! Any });
20:35 committable6 AlexDaniel, ¦ca93ac90^: «(1, (2, 3), 4)» ¦ca93ac9: «(1, Any, 4)»
20:35 AlexDaniel yep, definitely this commit
20:35 Zoffix AlexDaniel: no, just clicked assign to self button instead of labels by accident
20:35 dogbert17 mebbe it's correct bahaviour
20:36 perlpilot dogbert17: looks right to me, but I'm not very familiar with duckmap
20:36 dogbert17 looking at Any.pod6 atm, trying to adjust incorrect examples, spelling and formatting error etc
20:37 dogbert17 this was one of the examples, which I will adjust unless someone screams :)
20:39 * AlexDaniel screams “what the f☆∞⌛ is duckmap???”
20:40 Zoffix it's a map that maps by type
20:40 Zoffix what quacks like a duck is a duck and all that
20:41 AlexDaniel what is “by type”?
20:42 Zoffix You give it a typed block and it only runs for stuff that matches the type. Basically examples above are the wrong way to use it
20:42 Zoffix I'd type some but I'm on my phone
20:43 AlexDaniel oooh
20:43 Zoffix m: <a b c d e f g>.duckmap(-> $ where <c d e>.any { .uc }).say
20:43 camelia rakudo-moar 84502d: OUTPUT: «(a b c d e f g)␤»
20:43 Zoffix booo
20:43 dogbert17 Zoffix: write some cooler examples later if you get bored with the IO stuff
20:44 AlexDaniel m: <a b c d e f g>.duckmap($ where <c d e>.any -> { .uc }).say
20:44 camelia rakudo-moar 84502d: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in argument list; couldn't find final ')' ␤at <tmp>:1␤------> 3<a b c d e f g>.duckmap($7⏏5 where <c d e>.any -> { .uc }).say␤    expecting any of:␤        infix␤…»
20:44 Zoffix m: (478, 'foobar', 'meow', 1234).duckmap(-> Str { .flip }).say
20:44 camelia rakudo-moar 84502d: OUTPUT: «(478 foobar meow 1234)␤»
20:44 AlexDaniel no, it was right…
20:45 * Zoffix shrugs
20:45 Zoffix I thought that was it
20:45 AlexDaniel c: all (478, 'foobar', 'meow', 1234).duckmap(-> Str { .flip }).say
20:45 Zoffix Ohhj
20:45 Zoffix doh, I'm not assigning to $_ doh
20:45 Zoffix m: (478, 'foobar', 'meow', 1234).duckmap(-> Str $_ { .flip }).say
20:45 camelia rakudo-moar 84502d: OUTPUT: «(478 raboof woem 1234)␤»
20:45 Zoffix there we go
20:46 AlexDaniel right
20:46 Zoffix m: <a b c d e f g>.duckmap(-> $_ where <c d e>.any { .uc }).say
20:46 camelia rakudo-moar 84502d: OUTPUT: «(a b C D E f g)␤»
20:46 Zoffix and it descends into iterables
20:46 AlexDaniel ok, so that's a thing where you pass a multi sub or something
20:46 Zoffix probably
20:46 AlexDaniel m: <a b c d e f g>.deepmap(-> $_ where <c d e>.any { .uc }).say
20:46 camelia rakudo-moar 84502d: OUTPUT: «Constraint type check failed in binding to parameter '$_'; expected anonymous constraint to be met but got Str ("a")␤  in block <unit> at <tmp> line 1␤␤»
20:46 AlexDaniel ah-ha
20:47 jnthn Actually it's implemented just by catching an exception
20:47 AlexDaniel :|
20:48 jnthn So it's like "map with this operation if it succeeds"
20:48 Zoffix Ah, cool
20:48 jnthn Except it will also try to descend
20:48 committable6 joined #perl6-dev
20:48 Zoffix m: <a b c d e f g>.duckmap(-> $_ where <c d e>.any { die when 'd'; .uc }).tsay
20:48 camelia rakudo-moar 84502d: OUTPUT: «No such method 'tsay' for invocant of type 'List'␤  in block <unit> at <tmp> line 1␤␤»
20:48 Zoffix m: <a b c d e f g>.duckmap(-> $_ where <c d e>.any { die when 'd'; .uc }).say
20:48 camelia rakudo-moar 84502d: OUTPUT: «(a b C d E f g)␤»
20:48 Ven_ joined #perl6-dev
20:48 Zoffix awesome
20:49 jnthn Like `try`, it's both really useful and a huge thick blanket :)
20:49 * dogbert17 considers stealing these examples and add them to the pod
20:50 jnthn (In that, both are good when you just want to try and don't care otherwise, but you'd better be doing something small that can't fail in many ways)
21:02 perlpilot dogbert17: you totally should  :)
21:03 perlpilot (that die thing was new to me and could use a paragraph or so of explanation)
21:18 dogbert17 perlpilot: that one I didn't steal but perhaps I should
21:22 Zoffix Could be a filter for successfull transactions
21:23 Zoffix "Say this data is good: {@data.duckmap({$stuff.add: $_; $something.post: $_; $whatever.whatever: $_; $_})}"
21:23 Zoffix Oh wait never mind
21:23 Zoffix hehe :)
21:24 Zoffix ('cause it returns all the data)
21:26 AlexDaniel m: say <25 abc 88>.any.duckmap({$_ + 1})
21:26 camelia rakudo-moar 84502d: OUTPUT: «any((26), (abc), (89))␤»
21:28 Zoffix : say <25 abc 88>.any.duckmap({$_ == 25 or die})
21:28 Zoffix m: say so <25 abc 88>.any.duckmap({$_ == 25 or die})
21:28 camelia rakudo-moar 84502d: OUTPUT: «True␤»
21:28 Zoffix m: say so <27 abc 88>.any.duckmap({$_ == 25 or die})
21:28 camelia rakudo-moar 84502d: OUTPUT: «True␤»
21:28 Zoffix oh right
21:28 Zoffix I think it's clear duckmap isn't for me :)
21:40 pmurias_ joined #perl6-dev
22:19 MasterDuke_ joined #perl6-dev
22:42 Zoffix m: say words(2, 2, 3)
22:42 camelia rakudo-moar 84502d: OUTPUT: «Cannot resolve caller words(Str: Int, Int); none of these signatures match:␤    (Str:D $: :$autoderef!, *%_)␤    (Str:D $: $limit, *%_)␤    (Str:D $: *%_)␤  in block <unit> at <tmp> line 1␤␤»
22:42 Zoffix $autoderef???
22:42 Zoffix m: say words(2, 2)
22:42 camelia rakudo-moar 84502d: OUTPUT: «(2 Nil)␤»
22:42 Zoffix m: say words(2, 5)
22:42 camelia rakudo-moar 84502d: OUTPUT: «(2 Nil Nil Nil Nil)␤»
22:42 Zoffix crap
22:42 Zoffix m: say words(2)
22:42 camelia rakudo-moar 84502d: OUTPUT: «(2)␤»
22:43 Zoffix That's not how I implemented limit on IO::Handle
22:43 Zoffix m: say lines 2, 2
22:43 camelia rakudo-moar 84502d: OUTPUT: «(2)␤»
22:43 Zoffix m: say comb 2, 2
22:43 camelia rakudo-moar 84502d: OUTPUT: «(2)␤»
22:43 Zoffix m: say comb 2, 2, 2
22:43 camelia rakudo-moar 84502d: OUTPUT: «(2)␤»
22:43 Zoffix k, simple fix it looks
22:45 Zoffix 1-word fix... for words :)
22:45 Zoffix ZofBot: BADUMPTS!
22:45 ZofBot Zoffix, I was thinking like I do with map/grep, and now that you mention it those instances are using ({ }), not { } `No such method 'e' for invocant of type 'Distribution::Resource'` when doing %?RESOURCES<
22:45 AlexDaniel hmmm I wanted to try something…
22:46 Zoffix m: try something
22:46 camelia rakudo-moar 84502d: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    something used at line 1␤␤»
22:46 AlexDaniel aa, I remember
22:48 AlexDaniel well, nevermind
22:48 AlexDaniel I just remembered
22:49 AlexDaniel m: <25 55 88>.grep({say $++})
22:49 camelia rakudo-moar 84502d: OUTPUT: «0␤1␤2␤»
22:49 AlexDaniel m: <25 55 88>.grep(/{say $++}/)
22:49 camelia rakudo-moar 84502d: OUTPUT: «0␤0␤0␤»
22:49 AlexDaniel I'd just never remember the difference here
22:50 AlexDaniel or understand it, even
22:50 AlexDaniel m: <25 55 88>.grep({ {say $++} })
22:50 camelia rakudo-moar 84502d: OUTPUT: «0␤0␤0␤»
22:51 AlexDaniel this ↑ is kinda it, but still
23:39 TimToady a state variable is like a 'my' variable that is implicit one scope out
23:40 TimToady if there is more than one lexical scope (as is the case above), then each time the outer lexical scope is renewed, so is the state var
23:41 TimToady otoh, regex scopes are a bit funny...
23:41 TimToady m: <25 55 88>.grep(/:my $var; {say $var++}/)
23:41 camelia rakudo-moar 84502d: OUTPUT: «0␤1␤2␤»
23:42 TimToady m: <25 55 88>.grep(my regex { :my $var; {say $var++} })
23:42 camelia rakudo-moar 84502d: OUTPUT: «0␤0␤0␤»
23:48 * AlexDaniel squints
23:50 TimToady though by rights all of those should be failing from a null regex...
23:51 timotimo wow, the http 500 page of github is pretty
23:51 timotimo https://gist.github.com/tadzik/80060834fa015f7938cd4153cfcbe94e - i get it for this

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