Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2015-05-16

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:05 eli-se joined #perl6
00:29 rjbs How can I (probably with throws-like?) test that the exception message from some code matches a regex?
00:30 rjbs I tried: throws-like(sub { ... }, /foo/) but that's no good.
00:30 timotimo why would you ever want to match the message with a regex?
00:31 japhb timotimo: Testing that the exception class message method is correct?
00:31 rjbs What japhb said.
00:32 rjbs Let me state my real goal, and you can tell me what you think.
00:32 rjbs I have a class, and it has a bunch of error conditions that die("foo")
00:33 rjbs Creating a hierarchy of exception classes seems like overkill.
00:33 timotimo hm
00:33 timotimo fair enough
00:33 rjbs I want to see "did I get the right error in this case"?
00:33 rjbs Normally, I do something like:  my $error = exception { some_code }; like($@, qr/too many chefs/);
00:33 rjbs er, s/$@/$error/
00:34 timotimo hmm
00:37 rjbs Hm.  The web page says:
00:37 rjbs throws-like($code, $ex_type, $description?)
00:37 rjbs but the source of Test.pm says:
00:37 rjbs sub throws-like($code, $ex_type, $reason?, *%matcher) is export {
00:37 rjbs that %matcher thing seems plausibly important?
00:39 TimToady put message => on teh //
00:39 rjbs Okay.  Do I want X::AdHoc for $ex_Type or anything?  Or just *?  I'll go try!
00:40 TimToady m: use Test; throws-like(EVAL '1e0 / 0', message => /division/,"oops")
00:40 camelia rakudo-moar 55ed38: OUTPUT«Too many positionals passed; expected 1 argument but got 2␤  in block <unit> at /tmp/C_ZVq31Tw6:1␤␤»
00:40 rjbs I got a weirder error.
00:40 TimToady m: use Test; throws-like(EVAL( '1e0 / 0' ), message => /division/,"oops")
00:40 camelia rakudo-moar 55ed38: OUTPUT«    1..3␤    ok 1 - Use of uninitialized value <element> of type Any in string context  in sub proclaim at lib/Test.pm:504␤␤    not ok 2 - right exception type (Str)␤    ␤# Failed test 'right exception type (Str)'␤# at /home/camelia/rakudo-inst…»
00:40 rjbs I'll gist it.
00:40 TimToady hmm
00:41 rjbs https://gist.github.com/rjbs/7aa7adfc92c68cb6217a
00:41 TimToady anyway, there's lots of examples in roast
00:42 TimToady m: use Test; throws-like(EVAL( '1e0 / 0' ), Exception, message => /division/,"oops")
00:42 camelia rakudo-moar 55ed38: OUTPUT«    1..3␤    ok 1 - Use of uninitialized value <element> of type Any in string context  in sub proclaim at lib/Test.pm:504␤␤    ok 2 - right exception type (Exception)␤    not ok 3 - .message matches ␤    ␤# Failed test '.message matches '␤# …»
00:42 TimToady m: use Test; throws-like(EVAL( '1e0 / 0' ), Exception, message => /zero/,"oops")
00:42 camelia rakudo-moar 55ed38: OUTPUT«    1..3␤    ok 1 - Use of uninitialized value <element> of type Any in string context  in sub proclaim at lib/Test.pm:504␤␤    ok 2 - right exception type (Exception)␤    ok 3 - .message matches ␤ok 1 - oops␤»
00:42 rjbs I ack'd for throws-like in rakudo checkout and found nearly nothing.  Roast another repo?
00:43 TimToady m: use Test; throws-like(EVAL( '1e0 / 0' ), *, message => /zero/,"oops")
00:43 camelia rakudo-moar 55ed38: OUTPUT«    1..3␤    ok 1 - Use of uninitialized value <element> of type Any in string context  in sub proclaim at lib/Test.pm:504␤␤    ok 2 - right exception type (Whatever)␤    ok 3 - .message matches ␤ok 1 - oops␤»
00:43 rjbs Found it.
00:43 TimToady m: use Test; throws-like({ '1e0 / 0' }, *, message => /zero/,"oops")
00:43 camelia rakudo-moar 55ed38: OUTPUT«    1..3␤    not ok 1 - code dies␤    ␤# Failed test 'code dies'␤# at /tmp/Ey7sRY6xTB line 1␤    ok 2 - # SKIP Code did not die, can not check exception␤    ok 3 - # SKIP Code did not die, can not check exception␤    # Looks like you failed 1…»
00:44 TimToady m: use Test; throws-like('1e0 / 0', *, message => /zero/,"oops")
00:44 camelia rakudo-moar 55ed38: OUTPUT«    1..3␤    ok 1 - '1e0 / 0' died␤    ok 2 - right exception type (Whatever)␤    ok 3 - .message matches ␤ok 1 - oops␤»
00:44 rjbs Funny, in roast they're all throws_like.
00:44 rjbs (low line, not hyphen minus)
00:44 TimToady for old times' sake :)
00:44 TimToady m: use Test; throws-like('1e0 / 0', *.say, message => /zero/,"oops")
00:44 camelia rakudo-moar 55ed38: OUTPUT«    1..3␤    ok 1 - '1e0 / 0' died␤Divide by zero␤  in block <unit> at EVAL_0:1␤  in any <unit-outer> at EVAL_0:1␤  in block  at lib/Test.pm:443␤  in sub subtest at lib/Test.pm:272␤  in sub throws-like at lib/Test.pm:470␤  in block <unit> a…»
00:46 TimToady m: constant x = 1,2,3,x;
00:46 camelia rakudo-moar 55ed38: OUTPUT«Unhandled exception: No exception handler located for warn␤   at <unknown>:1  (/home/camelia/rakudo-inst-1/share/perl6/runtime/CORE.setting.moarvm:print_exception:4294967295)␤ from src/gen/m-CORE.setting:14919  (/home/camelia/rakudo-inst-1/share/perl6/…»
00:47 TimToady .tell jnthn see warning failure at http://irclog.perlgeek.de/perl6/2015-05-16#i_10612721
00:47 yoleaux TimToady: I'll pass your message to jnthn.
00:48 TimToady m: my \x = 1,2,3,x;
00:48 camelia rakudo-moar 55ed38: OUTPUT«5===SORRY!5=== Error while compiling /tmp/jHHkJVI2eX␤Variable '&x' is not declared␤at /tmp/jHHkJVI2eX:1␤------> 3my \x = 1,2,3,7⏏5x;␤»
00:48 TimToady that one is also not quite right...
00:55 vendethiel why is unit need there? https://github.com/perl6/roast/commit/1c4b217809#diff-7dc2415355e13ce26d0ee5f9a5b5855fR114
01:01 timotimo vendethiel: we just changed how the "semicolon form" of classes works
01:01 timotimo we now require a "unit" in front
01:02 timotimo because that's harder to confuse people with who expect "class Foo;" to be a stub declaration
01:09 rjbs Hm, so I can pass (message => 'exact string') but not (so far): (message => /act str/)
01:09 rjbs or => * ~~ /act str/
01:12 rjbs Odd, because Test.pm has $got ~~ $v
01:22 TimToady rjbs: I just demonstrated using a pattern above
01:23 TimToady with message => /zero/
01:23 rjbs Sorry, I must have missed it, looking up.
01:24 TimToady maybe you put parens around it, causing it to not be a named arg?
01:24 rjbs Hm.  Hm hm hm.
01:24 rjbs no...
01:25 rjbs I'll update my gist.
01:25 rjbs https://gist.github.com/rjbs/7aa7adfc92c68cb6217a
01:26 TimToady I thought throws-like wants a string to eval
01:26 rjbs So, I think I'm matching your example's use of message=>/.../
01:26 rjbs throws-like:$code (specified as either something Callable, or as a something to be EVALled)
01:26 rjbs the passing of a sub is definitely okay, it works if I replace the /..../ with the exact string
01:28 vendethiel joined #perl6
01:28 rjbs "Code object coerced to string" is a bit odd to me, too
01:28 TimToady oh, heh, remember that /x is default now, except it's actually mandatory, so your space disappears unless you :s
01:29 TimToady so try /'terminated early'/
01:29 TimToady or /:s terminated early/
01:30 TimToady or /terminated.early/
01:30 rjbs Okay!  I wondered if that was related, actually, but the output of the test was so weird that I discounted it. :(
01:30 rjbs TimToady++ # knows his perl!  that was it
01:31 rjbs so you can put modifiers to the regex right inside the opening /?
01:31 rjbs Anyway, great, thank.  That error message is kind of a mess, though.
01:31 TimToady in fact, you may not put them at the end anymore
01:31 TimToady that's Too Late
01:31 rjbs I would've expected:    s:/.../
01:31 rjbs but I guess that would be a s//// with nomodifiers?
01:31 TimToady well, it'd have to be rx:s or so
01:32 rjbs rx is the new qr?
01:32 TimToady m: use Test; throws-like('1e0 / 0', *.say, message => rx:s/by zero/,"oops")
01:32 camelia rakudo-moar 55ed38: OUTPUT«    1..3␤    ok 1 - '1e0 / 0' died␤Divide by zero␤  in block <unit> at EVAL_0:1␤  in any <unit-outer> at EVAL_0:1␤  in block  at lib/Test.pm:443␤  in sub subtest at lib/Test.pm:272␤  in sub throws-like at lib/Test.pm:470␤  in block <unit> a…»
01:32 TimToady m: use Test; throws-like('1e0 / 0', *, message => rx:s/by zero/,"oops")
01:32 camelia rakudo-moar 55ed38: OUTPUT«    1..3␤    ok 1 - '1e0 / 0' died␤    ok 2 - right exception type (Whatever)␤    ok 3 - .message matches ␤ok 1 - oops␤»
01:32 TimToady yes, rx:s works
01:33 rjbs Cool.  Thanks, again, I really appreciate your and #perl6's patience as I putz around blindly.
01:33 TimToady but for :s you can also put it inside, like (?x:...) in Perl 5
01:33 rjbs Ah, ok.
01:33 rjbs I'm going to stick to outside, as otherwise I don't trust myself to see it.
01:34 TimToady just remember that m// is different, and evaluates immediately, so you have to use // or rx// to produce a Regex object
01:34 TimToady m: use Test; throws-like('1e0 / 0', *, message => rule { by zero },"oops")
01:34 camelia rakudo-moar 55ed38: OUTPUT«    1..3␤    ok 1 - '1e0 / 0' died␤    ok 2 - right exception type (Whatever)␤    ok 3 - .message matches ␤ok 1 - oops␤»
01:34 TimToady or use rule {}, which implies sigspace
01:36 TimToady it's sort of unfortunate that rule implies :s, but token implies :r
01:42 TimToady yes
01:47 TimToady rx is the new qr
01:47 TimToady we don't call it qr because regexes are strings, so it's wrongish to say it's "quoted"
01:47 TimToady *aren't
01:47 TimToady my n't key is going haywire again...
01:47 TimToady dinner &
01:47 rjbs Enjoy!
01:47 TimToady likewise ;)
01:48 ilbot3 joined #perl6
01:48 Topic for #perl6 is now »ö« Welcome to Perl 6! | http://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, std:, or /msg camelia p6: ... | irclog: http://irc.perl6.org | UTF-8 is our friend!
01:49 raydiak I think something important just got accidnetally deleted from an ext4 fs.  besides the backups, any advice anyone?
01:52 geekosaur http://unix.stackexchange.com/questions/122305/undelete-a-just-deleted-file-on-ext4-with-extundelete
01:52 geekosaur but you have to be able to unmount the fs
01:53 raydiak thanks, will read...proably shut down and flash a recovery distro to thumbdrive :P
01:54 raydiak (from another machine)
01:54 * raydiak was *in the process* of putting it in git so this didn't happen :P
01:57 raydiak shutting down for damage control &
02:03 noganex_ joined #perl6
02:13 xinming joined #perl6
02:24 aborazmeh joined #perl6
02:24 aborazmeh joined #perl6
02:29 rmgk_ joined #perl6
02:29 cognominal joined #perl6
02:51 rjbs oh, man. my buzz killed by the realization that $a2-19 is not a valid identifier
03:08 rjbs I have finished translating this library in its entirety!
03:14 danaj joined #perl6
03:14 jdv79 what does it mean?
03:14 adu joined #perl6
03:14 rjbs Well, it means I can stop trying to translate it, if nothing else.
03:16 rjbs Next up, I will probably ask for input on how my code is not being very perl6ish.  I'll point out where stuff seemed really weird and find out whether it's bugs in perl6, missing implementations, or my expectations being wrong.
03:16 rjbs the main part of the code is https://github.com/rjbs/ZMachine-Whiz/blob/master/lib/ZMachine/ZSCII.pm
03:16 rjbs but now, time to sleep
03:20 isBEKaml joined #perl6
03:21 jdv79 happy zzz'ing
03:40 skids https://abrij.org/~bri/perl6_big_nfa.svg # biofabric-style map of one of the large NFAs in perl6.  Use firefox for mouseovers.  Also you'll have to zoom in a lot.
03:40 yoleaux 15 May 2015 12:20Z <jepeway> skids: re: subclassing DateTime -- .utc and .local seem fundamental enough that they belong in DateTime proper and so the timezone slicing they do (where what they return is forced to have an Int timezone) feels to me like it should be fixed, rather than overridden
03:40 yoleaux 15 May 2015 13:05Z <jepeway> skids: see https://github.com/cjepeway/p6-tz for what I'm trying to do.
03:45 FROGGS_ joined #perl6
04:08 jack_rabbit joined #perl6
04:24 koo6 joined #perl6
04:42 kaare_ joined #perl6
04:45 isBEKaml joined #perl6
05:01 xinming joined #perl6
05:25 isBEKaml joined #perl6
05:41 Sqirrel joined #perl6
05:45 Psyche^ joined #perl6
05:53 spintronic joined #perl6
05:53 spintronic wow how late do you guys work on this stuff?
06:02 diana_olhovik_ joined #perl6
06:24 raydiak geekosaur++ # I got it *all* back with extundelete, after long hassling trying to get one iso or another properly written to usb from my windows partition and booting with enough functionality
06:25 * raydiak considers creating his own version of a rescue partition like you find on commercially prebuilt computers these days...and a proper emergency usb stick...and more stringent backup policies...
06:29 raydiak though for now at least the thing I orignally lost now exists on two servers, one usb stick, and four times across two partitions on this laptop :)
06:29 domidumont joined #perl6
06:34 domidumont joined #perl6
06:35 TimToady .tell jnthn the remaining problem on restart-concurrent looks like this: https://gist.github.com/anonymous/c733890dc297680e5ed3
06:35 yoleaux TimToady: I'll pass your message to jnthn.
06:47 raydiak and now on github too...anyway, g'night #perl6 o/
06:51 isBEKaml joined #perl6
07:01 koo6 joined #perl6
07:01 diana_olhovik_ joined #perl6
07:02 RabidGravy joined #perl6
07:19 stux|RC-only joined #perl6
07:22 domidumont1 joined #perl6
07:24 isBEKaml joined #perl6
07:30 rindolf joined #perl6
07:38 FROGGS[mobile] morning #perl6
07:42 [Tux] Inline::Perl5 fails after the unit changes
07:43 FROGGS[mobile] do you have a paste?
07:43 FROGGS[mobile] a precomp test failed yesterday
07:47 berekuk joined #perl6
08:02 bjz joined #perl6
08:02 espadrine joined #perl6
08:05 bjz joined #perl6
08:16 brrt joined #perl6
08:17 FROGGS jnthn / lizmat: after installing 230 dists `perl6 -e1` is unchanged startup time wise, but a single use statement makes the startup time grow from .13s to .83s
08:19 FROGGS jnthn / lizmat: uff, using MIME::Base64 takes 1.46s all in all
08:20 darutoko joined #perl6
08:21 FROGGS jnthn / lizmat: but tbf, the code in CURLI.candidates is far from ideal performance wise...
08:28 telex joined #perl6
08:28 berekuk joined #perl6
08:41 gfldex joined #perl6
08:45 masak good antenoon, #perl6
08:55 eli-se joined #perl6
09:00 aborazmeh joined #perl6
09:00 aborazmeh joined #perl6
09:03 jnthn FROGGS: Is that dramatically worse than before? And, is it good enough that we can consider shipping a Star this month if all else is well?
09:03 yoleaux 00:47Z <TimToady> jnthn: see warning failure at http://irclog.perlgeek.de/perl6/2015-05-16#i_10612721
09:03 yoleaux 06:35Z <TimToady> jnthn: the remaining problem on restart-concurrent looks like this: https://gist.github.com/anonymous/c733890dc297680e5ed3
09:04 FROGGS jnthn: it is way better then before... before it took >5s
09:05 FROGGS jnthn: problem is that we need proper fixes to panda and rakudo
09:05 FROGGS the 'we put string into @*INC' is nothing panda can work with
09:06 jnthn FROGGS: I meant "before we had the module databsae at all" rather than "when the module database was JSON" :)
09:06 jnthn (But maybe that's what you answered :))
09:08 FROGGS no, I was talking about JSON
09:08 FROGGS I can test that to a CURLF later
09:08 jnthn ok
09:09 jnthn FROGGS++
09:14 vendethiel joined #perl6
09:16 tardisx` joined #perl6
09:16 pmichaud_ joined #perl6
09:16 smash__ joined #perl6
09:17 [particle]1 joined #perl6
09:17 Timbus joined #perl6
09:17 coffee` joined #perl6
09:25 rindolf joined #perl6
09:28 vendethiel o/, #perl6!
09:29 vendethiel timotimo: yes, I know it was changed, but it seems to me in https://github.com/perl6/roast/commit/1c4b217809#diff-7dc2415355e13ce26d0ee5f9a5b5855fR114 the unit is unnecessary
09:31 vendethiel timotimo: ah,I just didn't see the fix https://github.com/perl6/roast/commit/6e5dbebb32c3561aa19586804bc514db41bf562e
09:32 telex joined #perl6
09:33 Peter__R joined #perl6
09:33 TimToady_ joined #perl6
09:33 raydiak_ joined #perl6
09:34 mls_ joined #perl6
09:36 mephinet- joined #perl6
09:36 jack_rabbit_ joined #perl6
09:37 yakudzo joined #perl6
09:37 rhr joined #perl6
09:39 salva joined #perl6
09:40 Bucciarati joined #perl6
09:41 [Tux] FROGGS, https://gist.github.com/Tux/91961f13fc1dd35eb08c
09:41 revdiablo joined #perl6
09:44 Timbus joined #perl6
09:44 LordV joined #perl6
09:46 mst joined #perl6
09:47 isBEKaml joined #perl6
09:57 jnthn star: constant x = (1,x);
09:57 camelia star-m 2015.03: OUTPUT«===SORRY!===␤Cannot invoke this object (REPR: Null, cs = 0)␤»
09:58 jnthn star: constant x = 1,x;
09:58 camelia star-m 2015.03: OUTPUT«===SORRY!===␤Cannot invoke this object (REPR: Null, cs = 0)␤»
10:07 [Tux] File::Temp also very noisy, but it does install and work
10:07 [Tux] https://gist.github.com/Tux/8a1ceb0def1560fa2622
10:08 lizmat good *, #perl6!
10:08 FROGGS hi lizmat
10:08 FROGGS [Tux]: I've seen the same I::P5 issue yesterday when testing CURLI
10:08 lizmat FROGGS: at the hackathon after the OSDC.no, I discussed this briefly with pmichaud
10:09 lizmat he came up with the idea of not having a single CURLI "database"
10:09 lizmat but rather a master index, (always read at CURLI init)
10:09 lizmat and another "database" for each installed distribution
10:10 lizmat I'm warming up to that idea more and more
10:10 FROGGS I was under the impression that you have CURLIs per location
10:10 FROGGS so, one for site, one for home etc
10:11 lizmat yes, you would
10:11 lizmat and then per location, per distribution, another database
10:11 FROGGS so every location has its database and CURLI object
10:11 lizmat yes
10:11 FROGGS per dist?
10:11 FROGGS installed dist?
10:12 lizmat and each installed distribution inside that would have a "database" as well
10:12 FROGGS why that?
10:12 lizmat well, a handy accessible version of META6.json (not necessarily in JSON )
10:12 lizmat I see the following advantages:
10:13 lizmat 1. the init time for a CURLI would decrease significantly, as it would not have to load all of the installed dist data
10:13 FROGGS 1) does not hold
10:13 lizmat 2. only modules that you actually use, would get loaded: CPU win and memory win
10:13 FROGGS that is also not true
10:14 lizmat ??
10:14 FROGGS because to know what dists you have to care about you have to know what these dists provide
10:14 FROGGS and you dont know what dists provide without looking at their information
10:16 lizmat well, maybe the master index should contain only the "provides" information, aka the keys you'd expect in a -use- statement
10:16 FROGGS so the MANIFEST file we have now is basically what you called master index, but we don't have duplicate information for that stored in extra databases
10:16 FROGGS ahh
10:16 FROGGS we could have a provides and files index (which maps to .candidates and .files)
10:16 lizmat which would punycoded point to the info *that* needs
10:16 lizmat yes
10:17 FROGGS that sounds sensible
10:18 lizmat and I would also think that you would only need the provides, as the files are secondary *after* a module is loaded, no ?
10:19 FROGGS lizmat: if you run a script 'foo' from path, you need files first
10:19 FROGGS or if dist Font::Awesome just provides a .ttf file, and you app wants to get that shared resource only
10:20 lizmat wouldn't you have to "use Font::Awesome" first ?
10:21 FROGGS depends on how we expose %?RESOURCE I guess
10:21 FROGGS I mean, the scripts do: CompUnitRepo.files('foobar', :name, :auth, :ver)
10:21 lizmat I would think you need to have *some* Perl hook to expose the .ttf
10:22 FROGGS and you can do that with font files too
10:22 lizmat to have a %?RESOURCE, implies a package in which that lives
10:23 lizmat and that implies loading a module to me
10:23 FROGGS yes yes
10:23 FROGGS but you get your hands at the files via CUR.files
10:24 dalek rakudo/nom: 652c245 | jnthn++ | src/core/Exception.pm:
10:24 dalek rakudo/nom: Ignore warnings when printing exception.
10:24 dalek rakudo/nom:
10:24 dalek rakudo/nom: Not a prefect solution, but actually getting an exception message out
10:24 dalek rakudo/nom: is better than choking over warnings issues while producing it.
10:24 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/652c24525a
10:25 jnthn .tell TimToady did something about the warning while printing exception bug
10:25 yoleaux jnthn: I'll pass your message to TimToady.
10:26 lizmat FROGGS: I'm not sure having to access CUR.files is long term a good solution
10:26 lizmat I would need to think about that some more
10:27 FROGGS lizmat: IMO that this is a very good way to query the repositories
10:27 lizmat I would be afraid of false positives
10:27 FROGGS lizmat: you need to keep in mind that there is also panda that needs to get its hands on information
10:27 dalek doc: b53d3e0 | (Steve Mynott)++ | lib/ (2 files):
10:27 dalek doc: fix 3 typos
10:27 dalek doc: review: https://github.com/perl6/doc/commit/b53d3e0dc1
10:28 lizmat FROGGS: yes, I know too well, recently  :-)
10:28 FROGGS lizmat: there can't be any since that is the only way to query our repositories that we also use internally
10:28 lizmat in any case, are you happy with the current state of CURLI to have a rakudo* after next week's release
10:29 lizmat ?
10:30 FROGGS if I fix panda properly, yes, I think so
10:30 lizmat cool!
10:30 lizmat FROGGS++
11:04 cygx joined #perl6
11:10 cygx I re-submitted my IO::Handle.open pull request so the commit gets an updated commit message: https://github.com/rakudo/rakudo/pull/430
11:10 cygx the parameters remain as dicussed in the previous PR
11:11 rindolf joined #perl6
11:17 domidumont joined #perl6
11:17 dalek Heuristic branch merge: pushed 120 commits to rakudo/newio by lizmat
11:17 eli-se joined #perl6
11:25 coffee` joined #perl6
11:25 chenryn joined #perl6
11:37 Peter_R joined #perl6
11:59 diana_olhovik_ joined #perl6
12:03 spider-mario joined #perl6
12:10 Alina-malina joined #perl6
12:17 cygx m: say <\<\<> <<=><< <\<\<>
12:17 camelia rakudo-moar 652c24: OUTPUT«<< => <<␤»
12:19 timotimo that can be expressed less confusingly :)
12:21 cygx it started with a legitimate use case for <<=><<
12:21 cygx m: say() <== <\<\<> <<=><< <\<\< \<\<>
12:21 camelia rakudo-moar 652c24: OUTPUT«<< => << << => <<␤»
12:21 timotimo i'd spell that «=>« fwiw :)
12:23 dalek roast: d773322 | usev6++ | S04-statements/lazy.t:
12:23 dalek roast: Update tests for 'lazy'
12:23 dalek roast:
12:23 dalek roast: 'lazy' NYI -- currently works like 'do'
12:23 dalek roast: review: https://github.com/perl6/roast/commit/d773322ce6
12:30 aborazmeh joined #perl6
12:30 aborazmeh joined #perl6
12:33 timotimo i only now saw jnthn++ blogged a few hours ago :)
12:34 cygx bye o/
12:34 cygx left #perl6
12:40 sue__ joined #perl6
12:42 FROGGS wasnt there a way for a method to alias several named params to one?
12:42 FROGGS ohh, probably found it
12:45 FROGGS m: class Foo { has $.auth; submethod BUILD(:author(:$!auth)) { } }; say Foo.new( :auth(42) )
12:45 camelia rakudo-moar 652c24: OUTPUT«Foo.new(auth => 42)␤»
12:45 FROGGS m: class Foo { has $.auth; submethod BUILD(:author(:$!auth)) { } }; say Foo.new( :author(42) )
12:45 camelia rakudo-moar 652c24: OUTPUT«Foo.new(auth => 42)␤»
12:45 FROGGS if anybody is curious
12:46 timotimo FROGGS: i'm glad the serialization stuff is working out at last :)
12:47 FROGGS timotimo: yes, seems so :o)
12:49 koo6 joined #perl6
12:55 itz_ I couldn't see an obvious way of doing a DNS lookup .. is it necessary to wrap gethostbyname with NativeCall?
12:58 FROGGS itz_: we could/should make this available as a sub or method me thinks
13:00 chenryn joined #perl6
13:01 timotimo i had a little thing built while working on UDP sockets
13:01 timotimo (sadly, i didn't work on that very much)
13:05 brrt joined #perl6
13:05 chenryn joined #perl6
13:21 vendethiel m: sub bar (|args = \(1,2,3)) {...}
13:21 camelia rakudo-moar 652c24: OUTPUT«===SORRY!===␤At Frame 2, Instruction 4, op 'param_sp' has invalid number (3) of operands; needs 2.␤»
13:30 airdisa joined #perl6
13:52 FROGGS lizmat: does CompUnit.load work?
13:54 raiph joined #perl6
13:54 rjbs Unhandled exception: No exception handler located for warn
13:54 rjbs O_o
13:54 * jnthn fixed something that gave exactly that error this morning
13:55 rjbs Seems to tbe the result of too many )'s.
13:56 jnthn Around a BEGIN or constant by any chance?
13:56 DrForr rjbs: Or repeating 'returns...' as well, I've gotten that twice.
13:56 jnthn DrForr: Example?
13:57 * vendethiel went to the "rust 1.0 paris meetup" last night...
13:57 vendethiel (and promoted perl6!)
13:57 rjbs vendethiel: How was it?
13:57 DrForr m: sub foo() returns Int returns Int { }
13:57 camelia rakudo-moar 652c24: OUTPUT«Code object coerced to string (please use .gist or .perl to do that)  in any  at src/Perl6/World.nqp:2467␤5===SORRY!5=== Error while compiling /tmp/vBsGs5SkEH␤Redeclaration of return type for foo (previous return type was Int)␤at /tmp/vBsGs5SkEH:…»
13:57 vendethiel well, it was really a "meetup" as there were no formal talks, only a few people projects introduced, and tons and tons of talking
13:57 DrForr Must've gotten fixed.
13:57 vendethiel so I talked about perl6 here and there :-)
13:59 chenryn joined #perl6
14:00 rjbs I was looking for info on declaring the return type of a routine, but only found some ancient notes about using -->
14:00 rjbs Is this still a thing?
14:01 jnthn Yes
14:01 rjbs Yes, works... sometimes!
14:01 jnthn You get a choice.
14:01 rjbs a choice?
14:01 jnthn You can use --> *or* returns
14:01 DrForr Hadn't realized they were equivalent.
14:02 jnthn Well, --> is meant to also let you declare a variable to assign into that will become the return value, by spec.
14:02 jnthn However, we don't do that bit yet, so they're equivalent.
14:02 jnthn Heh, and I probably meant "by design" since I'll bet we've know spec tests for the variable thing... :)
14:03 rjbs Hm...
14:03 arnsholt I think people have mostly settled on using the returns trait for top-level stuff, but for embedded signatures (like callbacks) you have to use -->
14:03 rjbs Aha, my test wasn't exercising the thingy I wanted.
14:03 rjbs that's why it didn't appear to work properly
14:04 rjbs jnthn++ thanks
14:08 * DrForr looks at FD_SET and wonders where this is enshrined in perl6.
14:13 * rjbs gets some type checks passing just before the kid explodes.  "We need to make a music video now, dad!"  Off Ig o...
14:23 pochi_ joined #perl6
14:38 sue_ joined #perl6
14:39 itz_ Text::VimColor seems nicer than pygmentize
14:41 itz_ does anyone know if examples.perl.org has vim 7.4
14:44 lizmat FROGGS: sadly not
14:46 FROGGS lizmat: yeah, I figured I'll keep it delegating to the old module loader
14:46 lizmat yeah  :-(
14:46 lizmat afk again until later &
14:46 FROGGS that's no problem, I clean up a lot already without that
14:48 skids joined #perl6
14:50 timotimo itz_: VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Mar 31 2015 23:36:03)
14:51 timotimo are you interested in any specific compilation flags?
14:51 timotimo (i'm expecting examples.perl6.org gets built and uploaded from hack.p6c.org
14:51 timotimo itz_: -perl this might be problematic perhaps? is that flag needed for Text::VimColor?
14:52 itz_ timotimo: I don't think so .. I just used it with a self built vim and I'm not embedding perl5
14:55 baest joined #perl6
14:56 airdisa_ joined #perl6
14:58 krakan joined #perl6
14:58 * skids thought --> and returns differed in some subtle way involving where/when typechecking happens
15:02 dalek joined #perl6
15:03 diana_olhovik_ joined #perl6
15:13 atweiden joined #perl6
15:20 telex joined #perl6
15:24 atweiden m: my Regex $r = / \w ** 3 123 /; my Str $w = "abc123"; say "both regex and string work" if "abc123" ~~ $r && "abc123" ~~ $w
15:24 camelia rakudo-moar 652c24: OUTPUT«both regex and string work␤»
15:25 atweiden ^am slightly confused why this commit was needed https://github.com/atweiden/nightscape/commit/2cc59dddface63452be498c53460acb3dc2a022e
15:25 atweiden had to go from passing Regex $r to passing Str $w essentially
15:27 skids Well,how did it exhibit failure?
15:28 atweiden Method 'match' not found for invocant of class 'Any'
15:38 diana_olhovik_ joined #perl6
15:39 skids I can't get a golfed version of _ls_entries to fail like that.
15:40 atweiden m: my Regex $r = / \w ** 3 123 /; say "this is why i needed sleep" if $r
15:40 camelia rakudo-moar 652c24: OUTPUT«Method 'match' not found for invocant of class 'Any'␤  in block <unit> at /tmp/oZn2EwixCw:1␤␤»
15:40 atweiden this error message appears to be from https://github.com/atweiden/nightscape/blob/develop/lib/Nightscape.pm#L48
15:40 atweiden how do you check if a Regex stored in a variable exists?
15:40 jnthn if defined $r
15:40 jnthn if $r tries to evaluate the regex against $_
15:41 jnthn Which holds Any
15:42 atweiden works now, ty jnthn
15:48 domidumont joined #perl6
15:49 domidumont joined #perl6
16:02 mst joined #perl6
16:02 kaare_ joined #perl6
16:06 brrt joined #perl6
16:06 airdisa joined #perl6
16:09 TimToady_ hmm, I wonder if we could warn somehow on /two words/ and no sigspace
16:10 molaf joined #perl6
16:15 TimToady_ alternately, always take a space between two \w as literal
16:16 FROGGS :S
16:16 FROGGS "whitespace is not significant, unless..."
16:17 koo6 joined #perl6
16:17 TimToady_ yes, but the failure mode currently can be *very* frustrating to people who forget we're /x
16:19 TimToady joined #perl6
16:20 TimToady and we don't want to frustrate people like rjbs++
16:20 yoleaux 10:25Z <jnthn> TimToady: did something about the warning while printing exception bug
16:20 TimToady I will not always be around to spot the issue
16:24 TimToady basically, we can either disallow /two words/, or dwim it, but the current situation is not friendly
16:25 FROGGS yeah...
16:25 TimToady how often to people put spaces into alnums with the express intention of NOT matching a space there?
16:25 TimToady maybe matching hex: /aaaa bbbb ccc/
16:26 TimToady but it seems like a rare thing to want to do
16:26 TimToady if it's a warning, we need a way of disabling it
16:26 jnthn I'd lean towards disallow (or maybe warning); the dwim's behavior is confusing when there's also sigspace which allows it but with a different behavior.
16:27 TimToady well, it could be dwimmed with same behavior, \s+
16:28 jnthn I fear that'll create more confusion that it solves...
16:28 TimToady "Fear is the mindkiller."
16:30 TimToady if a warning, how to disable...  there #OK, and maybe explicit :!s
16:30 TimToady both ucky
16:31 rjbs To be fair, the thing that frustrated me was the error message, not the behavior.
16:32 rjbs I didn't get "<message string> doesn't match /regexp thing/" but some totally weird other thing that made it unclear that I'd even got the syntax of the test right, let alone the semantics.
16:32 rjbs But I cede that plenty of people may get confused by the /x-ness.  But that might be just fine.
16:32 TimToady I thought that error was from the 1st sub argument
16:33 TimToady so an independent failure mode
16:33 TimToady (which also needs fixing)
16:33 skids Hrm, some recent change seems to allow Failures to escape from throws-like and hit DESTROY.
16:35 TimToady well, that's why I put the DESTROY message in, to catch those failure leaks :)
16:35 TimToady the biggest one turned out to be multidim subscripts, but I know there are others
16:37 TimToady some of them are probably places that should be sunk, but aren't, but this does seem like that kind of leak, offhand
16:38 TimToady *n'5
16:38 TimToady *n't
16:38 TimToady gotta get that n't key fixed...
16:40 rjbs TimToady: I'll try to reproduce this error...
16:41 rjbs TimToady: https://gist.github.com/rjbs/08c27a2152f428d3c5b8
16:41 brrt left #perl6
16:42 rjbs If that had said "Expected: string matching /your face/" I would've worked it out.  I think.  I at least would've not immediately panicked. :)
16:44 TimToady okay, it's trying to stringify the regex there and flubbing the message
16:44 TimToady m: say ~/your face/
16:44 camelia rakudo-moar 652c24: OUTPUT«Code object coerced to string (please use .gist or .perl to do that)  in block <unit> at /tmp/4cSn4yj7Ur:1␤␤»
16:44 rjbs Aha, that makes sense!
16:44 TimToady m: say /your face/
16:44 camelia rakudo-moar 652c24: OUTPUT«␤»
16:45 TimToady but that's the gist, which is not terribly helpful either
16:45 TimToady m: say /your face/.perl
16:45 camelia rakudo-moar 652c24: OUTPUT«Use of Nil in string context  in block <unit> at /tmp/yn9upIKehL:1␤regex ($: *%_) { #`(Regex|59431952) ... }␤»
16:45 TimToady nor is that...
16:46 rjbs The more I accidentally run perl instead of perl6, the more mortified I am by how many p6 programs are valid non-strict p5 programs, most of which do nothing.
16:47 rjbs Or maybe less mortified and more amused.  Or possibly both.
16:49 TimToady well, the new 'unit' thing should help with that, at least for modules
16:49 TimToady doesn't help scripts though
16:59 rindolf TimToady: hi, sup?
17:05 espadrine joined #perl6
17:09 eli-se joined #perl6
17:10 koo6 joined #perl6
17:10 dalek rakudo/nom: 1c4a70e | TimToady++ | lib/Test.pm:
17:10 dalek rakudo/nom: at least use .perl if "Expected" not a string
17:10 dalek rakudo/nom:
17:10 dalek rakudo/nom: Still not ideal, but at least it says it's a regex now.
17:10 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/1c4a70e4c2
17:11 yqt joined #perl6
17:16 ugexe is there a way to use a ::($rulename) in a regex where if $rulename fails it just moves on to the next match instead of dying?
17:18 zakharyas joined #perl6
17:20 TimToady I don't understand what you mean by ::($rulename), can you give an example?
17:20 TimToady within a regex, / <$rulename> || <otherrule> / oughta be close to what you want
17:21 TimToady well, might need to be <$::($rulename)> or so
17:22 TimToady <$rule> probably requires a hard ref
17:23 ugexe i want to use the result of a match as a rule
17:24 ugexe so if <address=alpha> matched abcd, then <::($address)> would act like <abcd>
17:26 ugexe $<name>=["Connection"]        ':' <.OWS> <Connection> <- this is the type of thing im trying to refactor (the rulename = the previous match)
17:26 ugexe having 'Connection' twice feels wrong
17:27 ugexe (elsewhere there is a token Connection {})
17:29 ugexe s05 says a leading :: indicates a indirect subrule, and lists / <::($somename)> / as an example
17:29 cognominal joined #perl6
17:29 TimToady you might need a ~ in there somewhere to stringify the old match
17:30 TimToady m: my $somename = 'alpha'; say 'abc' ~~ /<::($somename)>+/
17:30 camelia rakudo-moar 652c24: OUTPUT«「abc」␤»
17:31 TimToady the mechanism seems to work, at least with a built-in method
17:31 TimToady are you doing this in a grammar, or trying to do it with lexical scopes?
17:32 ugexe in a grammar
17:32 TimToady have you tried <::(~$somename)> ?
17:33 ugexe not yet, but im about to :)
17:33 TimToady or stringified the earlier match somehow?
17:33 ugexe no... i think in my head i assumed that since im matching a literal string that the match was a string for some reason
17:33 TimToady you'd think a symbolic ref would stringify by default...
17:34 raiph joined #perl6
17:35 TimToady m: "rand" ~~ /(\w+)/; say ::($0)
17:35 camelia rakudo-moar 652c24: OUTPUT«===SORRY!===␤No such symbol 'rand'␤»
17:35 TimToady m: "pi" ~~ /(\w+)/; say ::($0)
17:35 camelia rakudo-moar 652c24: OUTPUT«3.14159265358979␤»
17:36 TimToady seems to stringify automatically there
17:37 TimToady m: "alpha" ~~ /(\w+)/; my $alpha = $0; say 'foo' ~~ /<::($alpha)>/
17:37 camelia rakudo-moar 652c24: OUTPUT«「f」␤»
17:37 TimToady seems to stringify there too, so dunno where you're going rwong
17:38 TimToady you're not trying to use $<thatthing> inside as a reference to a previous regex, are you?
17:38 TimToady you have to save it in a temporary if you want to do that, like I did with $alpha, since $0 would refer to the current regex, not the previous
17:39 TimToady p6 regex don't rely on string interpolation like p5 regex do
17:40 TimToady or use ::($oldmatch<thatthing>) if you saved the previous match in $oldmatch
17:40 ugexe i get Method '' not found for invocant of class 'Zef::Grammars::HTTP::RFC7230'. The <::($rulename)> is from an inherited rule, but i dont think that would affect it. Running with grammar::tracer/debugger dies with the same message too so ive lost the easy way to step through it :(
17:41 TimToady how are you loading $rulename, and is it in an appropriate scope to be visible?
17:42 TimToady well, it must be visible or it would give a compile-time error
17:42 TimToady so must be a lifetime/dynamic issue
17:42 ugexe its inherited from another class (a role really). 'is ExtendedRules'
17:42 ugexe if i hard code the rule in its fine
17:42 ugexe hard code the rule as in <Rule>
17:42 TimToady you can't inherit a variable, so I don't know what you mean by the variable $rulename is inherited
17:43 TimToady is your code literally <::($rulename)>?
17:43 ugexe but <$rulename> is a token that is inherited
17:43 TimToady what sets $rulename?
17:43 ugexe in $<name>=["Accept"] ':' <::($<name>)>, $rulename is $<name>
17:44 ugexe in $<name>=["Accept"] ':' <Accept>, this works. token Accept is inherited
17:46 TimToady m: say "alpha:foo" ~~ /$<name>="alpha" ':' <::($<name>)>/
17:46 camelia rakudo-moar 652c24: OUTPUT«Use of Nil in string context  in block <unit> at /tmp/nPHFuHrFYp:1␤Method '' not found for invocant of class 'Cursor'␤  in block <unit> at /tmp/nPHFuHrFYp:1␤␤»
17:46 TimToady okay, I think I've reproduced it there
17:47 TimToady ah, I think this is a known bug
17:47 ugexe yeah that looks like what ive experienced
17:47 TimToady m: say "alpha:foo" ~~ /$<name>="alpha" ':' {} <::($<name>)>/
17:47 camelia rakudo-moar 652c24: OUTPUT«「alpha:f」␤ name => 「alpha」␤»
17:47 TimToady yes, known bug
17:47 TimToady rakudo doesn't set up $/ unless you poke an extraneous {} in there
17:47 ugexe how does {} work around it?
17:47 ugexe ah
17:48 ugexe thanks, id have never figured that out
17:48 TimToady everyone keeps hoping someone else will fix this :)
17:48 TimToady so I guess I'd better put it on my personal todo list
17:50 TimToady I suspect the actual solution is to not really use a Match object for refs to $/ inside a regex, but fake access into the current Cursor instead, rather like STD does
17:51 ugexe and here i thought it had to do with :: discarding the previous match or something. must have been thinking of :::
17:52 TimToady that :: has nothing to do with backtracking, just symreffing
17:52 TimToady same as ::($foo) outside in normal p6
17:52 TimToady on top of which, :: and ::: aren't implemented yet in rakudo...
17:54 FROGGS I was thinking about implementing ::, but I dunno where to start
17:55 TimToady well, all such cuts have to basically throw out some of the bstack
17:55 FROGGS m: say "alpha:foo" ~~ /$<name>="alpha" ':' <{ say $<name> }> /
17:55 camelia rakudo-moar 1c4a70: OUTPUT«「alpha」␤Nil␤»
17:55 FROGGS m: say "alpha:foo" ~~ /$<name>="alpha" ':' <{ say $.CURSOR.caps<name> }> /
17:55 camelia rakudo-moar 1c4a70: OUTPUT«5===SORRY!5=== Error while compiling /tmp/346AuGzq6w␤Variable $.CURSOR used where no 'self' is available␤at /tmp/346AuGzq6w:1␤------> 3 ~~ /$<name>="alpha" ':' <{ say $.CURSOR7⏏5.caps<name> }> /␤    expecting any of:␤        argument li…»
17:55 FROGGS m: say "alpha:foo" ~~ /$<name>="alpha" ':' <{ say self.CURSOR.caps<name> }> /
17:55 camelia rakudo-moar 1c4a70: OUTPUT«5===SORRY!5=== Error while compiling /tmp/FUMD6pwjnu␤'self' used where no object is available␤at /tmp/FUMD6pwjnu:1␤------> 3pha:foo" ~~ /$<name>="alpha" ':' <{ say 7⏏5self.CURSOR.caps<name> }> /␤    expecting any of:␤        argument li…»
17:55 FROGGS m: say "alpha:foo" ~~ /$<name>="alpha" ':' <{ say $/.CURSOR.caps<name> }> /
17:55 camelia rakudo-moar 1c4a70: OUTPUT«Method 'caps' not found for invocant of class 'Cursor'␤  in block <unit> at /tmp/unXZs2mM3d:1␤␤»
17:59 TimToady whether trimming the bstack will automatically manage the cstack correctly is something I don't know offhand
17:59 koo6 joined #perl6
18:01 ugexe is <sym> constructed at a different point that named matches?
18:01 ugexe s/that/than/
18:02 FROGGS ugexe: yes
18:03 ugexe m: grammar X { TOP { <header> }; proto token header {*}; token header:sym<Accept> { ':' <.ws> {} <::($<sym>)> }; multi token Accept { <alpha> }; }; X.parse("Accept: asdf"); # just foolin around, but this is why i asked
18:03 FROGGS nqp/src/QRegex/P6Regex/Actions.nqp:568:            my $loc := nqp::index(%*RX<name>, ':sym<');
18:03 camelia rakudo-moar 1c4a70: OUTPUT«Error while constructing error object:Could not locate compile-time value for symbol Undeclared::Symbols␤===SORRY!===␤Error while compiling, type X::Undeclared::Symbols␤  routine_suggestion: (unstringifiable object)␤  post_types: (unstringifiable o…»
18:04 FROGGS m: grammar X { TOP { <header> }; proto token header {*}; token header:sym<Accept> { ':' <.ws> {} <::('&' ~ $<sym>)> }; multi token Accept { <alpha> }; }; X.parse("Accept: asdf");
18:04 camelia rakudo-moar 1c4a70: OUTPUT«Error while constructing error object:Could not locate compile-time value for symbol Undeclared::Symbols␤===SORRY!===␤Error while compiling, type X::Undeclared::Symbols␤  routine_suggestion: (unstringifiable object)␤  post_types: (unstringifiable o…»
18:04 FROGGS m: grammar X { TOP { <header> }; proto token header {*}; token header:sym<Accept> { ':' <.ws> {} <{ say $<sym>; '' }> <::($<sym>)> }; multi token Accept { <alpha> }; }; X.parse("Accept: asdf");
18:04 camelia rakudo-moar 1c4a70: OUTPUT«Error while constructing error object:Could not locate compile-time value for symbol Undeclared::Symbols␤===SORRY!===␤Error while compiling, type X::Undeclared::Symbols␤  routine_suggestion: (unstringifiable object)␤  post_types: (unstringifiable o…»
18:05 zakharyas joined #perl6
18:05 FROGGS ewww
18:06 FROGGS ugexe: 1) don't use X as package name
18:06 FROGGS ugexe: 2) 'TOP' need to be a token or rule or regex
18:07 FROGGS m: grammar G { token TOP { <header> }; proto token header {*}; token header:sym<Accept> { <sym> ':' <.ws> {} <::($<sym>)> }; multi token Accept { <alpha> }; }; say G.subparse("Accept: asdf");
18:07 camelia rakudo-moar 1c4a70: OUTPUT«「Accept: a」␤ header => 「Accept: a」␤  sym => 「Accept」␤»
18:07 ugexe why does this compiler keep assuming i have any clue what im doing??
18:08 FROGGS :P
18:08 FROGGS m: grammar G { token TOP { <header> }; proto token header {*}; token header:sym<Accept> { <sym> ':' <.ws> {} <::($<sym>)> }; multi token Accept { <alpha>+ }; }; say G.subparse("Accept: asdf");
18:08 camelia rakudo-moar 1c4a70: OUTPUT«「Accept: asdf」␤ header => 「Accept: asdf」␤  sym => 「Accept」␤»
18:08 FROGGS m: grammar G { token TOP { <header> }; proto token header {*}; token header:sym<Accept> { <sym> ':' <.ws> <::($<sym>)> }; multi token Accept { <alpha>+ }; }; say G.subparse("Accept: asdf");
18:08 camelia rakudo-moar 1c4a70: OUTPUT«Use of Nil in string context  in regex header:sym<Accept> at /tmp/MNzsykzoZl:1␤Method '' not found for invocant of class 'G'␤  in regex header:sym<Accept> at /tmp/MNzsykzoZl:1␤  in regex header at /tmp/MNzsykzoZl:1␤  in regex TOP at /tmp/MNzsykzoZl…»
18:09 FROGGS so, $<sym> also needs a proper $/
18:15 raiph joined #perl6
18:15 DrForr Gotta experiment with the 'proto token' declaration.
18:22 yqt joined #perl6
18:40 TimToady hah, put in a non-sigspace warning, and found errors in S32-exceptions/misc.t :D
18:45 FROGGS :D
18:49 xfix joined #perl6
18:49 xfix joined #perl6
18:52 dalek roast: 6117739 | TimToady++ | S32-exceptions/ (2 files):
18:52 dalek roast: we accidentally some sigspace
18:52 dalek roast: review: https://github.com/perl6/roast/commit/6117739ed0
18:52 rjbs TimToady: It's always fun when new warnings find core bugs.  We've seen that a lot in the last couple years, too.
18:52 dalek nqp: 1036654 | TimToady++ | src/QRegex/P6Regex/Grammar.nqp:
18:52 dalek nqp: warn on nonsig space between alnums
18:52 dalek nqp: review: https://github.com/perl6/nqp/commit/10366545ca
18:52 rjbs My favorite were "return foo() or die" which turned up all over.
18:53 TimToady "That trick never works!"
18:53 FROGGS rjbs: I also found bugs in P5's test suite when working on the v5 slang... since v5's grammar was stricter
18:53 araujo joined #perl6
18:56 FROGGS like that one:
18:56 FROGGS splice @Foo::ISA, 0, 0, 'Bar';
18:56 FROGGS -ok( !oo->isa('Bar'), 'splice @ISA and make Foo a Bar');
18:56 FROGGS +ok( Foo->isa('Bar'), 'splice @ISA and make Foo a Bar');
18:56 FROGGS from t/op/splice.t
18:57 TimToady oo!
18:57 travis-ci joined #perl6
18:57 travis-ci NQP build failed. TimToady 'warn on nonsig space between alnums'
18:57 travis-ci http://travis-ci.org/perl6/nqp/builds/62842572 https://github.com/perl6/nqp/compare/f2f8128e1c4c...10366545ca12
18:57 travis-ci left #perl6
18:58 geekosaur oo-bleck :p
18:58 FROGGS wow, my CURLI stuff does not give any spectest fallout... and Inline::Perl5 works too (except that precomp.t fail which happens with nom too)
18:58 FROGGS t/qregex/01-qregex.t                (Wstat: 0 Tests: 767 Failed: 6)
18:58 FROGGS Failed tests:  722-727
18:59 TimToady oo, I dint run the nqp tests :)
19:00 FROGGS I tend to forget 'oo
19:00 raydiak_ ood
19:00 TimToady and apparently .worry is fatal in nqp...
19:01 TimToady maybe there's a .be-happy method I can use
19:01 * FROGGS groans
19:01 * rjbs searches for information on .worry
19:01 * rjbs finds article from 2004, "I'm worried about Perl 6."
19:01 FROGGS hehe
19:01 * rjbs will have to let that guy know that it's doing fine.
19:02 FROGGS rjbs++
19:03 airdisa joined #perl6
19:06 araujo joined #perl6
19:15 dalek nqp: 6aeeff1 | TimToady++ | t/qregex/rx_modifiers:
19:15 dalek nqp: work around new non-sigspace warning
19:15 dalek nqp: review: https://github.com/perl6/nqp/commit/6aeeff16f7
19:16 * masak tries to reproduce rjbs++' search, but only finds people being worried about JavaScript, and the future of Python
19:17 TimToady FROGGS++ for spotting nqp test failure, TimToady-- for not
19:20 FROGGS travis++ for telling me :o)
19:27 travis-ci joined #perl6
19:27 travis-ci NQP build passed. TimToady 'work around new non-sigspace warning'
19:27 travis-ci http://travis-ci.org/perl6/nqp/builds/62844296 https://github.com/perl6/nqp/compare/10366545ca12...6aeeff16f7bf
19:27 travis-ci left #perl6
19:29 dalek nqp/curly: 8dab64c | FROGGS++ | src/vm/moar/QAST/QASTOperationsMAST.nqp:
19:29 dalek nqp/curly: map new scdisclaim op on moar
19:29 dalek nqp/curly: review: https://github.com/perl6/nqp/commit/8dab64cbc6
19:32 dalek rakudo/curly: 1633ebb | FROGGS++ | src/core/Distribution.pm:
19:32 dalek rakudo/curly: restructure Distribution; do work once
19:32 dalek rakudo/curly: review: https://github.com/rakudo/rakudo/commit/1633ebbf2f
19:38 eli-se joined #perl6
19:41 dalek rakudo/nom: 580ede2 | TimToady++ | tools/build/NQP_REVISION:
19:41 dalek rakudo/nom: bump NQP to get new warning
19:41 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/580ede28a9
19:42 dalek rakudo/curly: 038589a | FROGGS++ | src/core/CompUnitRepo/Locally.pm:
19:42 dalek rakudo/curly: do no create CURL directories "automagically"
19:42 dalek rakudo/curly:
19:42 dalek rakudo/curly: We will ever only create dirs when asked to place files there. This solves
19:42 dalek rakudo/curly: RT #125141. This also implies that we cannot skip CURLs just because their
19:42 dalek rakudo/curly: directory does not exist yet.
19:42 dalek rakudo/curly: review: https://github.com/rakudo/rakudo/commit/038589ac0b
19:43 dalek rakudo/curly: 66a5ab0 | FROGGS++ | src/core/CompUnitRepo/Locally.pm:
19:43 dalek rakudo/curly: use # instead of : for path-spec/include-spec
19:43 dalek rakudo/curly: review: https://github.com/rakudo/rakudo/commit/66a5ab001a
19:46 dalek rakudo/curly: 233f299 | FROGGS++ | src/core/CompUnit.pm:
19:46 dalek rakudo/curly: add :ver/:auth to CompUnit so it matches "use" statements
19:46 dalek rakudo/curly: review: https://github.com/rakudo/rakudo/commit/233f299d40
19:50 dalek rakudo/curly: b10fc74 | FROGGS++ | src/core/Inc.pm:
19:50 dalek rakudo/curly: put CUR object into %*CUSTOM_LIB for panda
19:50 dalek rakudo/curly:
19:50 dalek rakudo/curly: Panda needs to check whether site or home are under control of a CUR,
19:50 dalek rakudo/curly: and therefore manage theirself.
19:50 dalek rakudo/curly: review: https://github.com/rakudo/rakudo/commit/b10fc74895
19:53 TimToady re <<=><< I'd probably spell it X=> instead
19:55 TimToady or maybe 𒆨
19:56 brrt joined #perl6
19:57 dalek rakudo/curly: 173258a | FROGGS++ | src/core/CompUnit (4 files):
19:57 dalek rakudo/curly: serialize CURLI database to "bytecode" instead of json
19:57 dalek rakudo/curly:
19:57 dalek rakudo/curly: This has several reasons. The most important one is that this let use get
19:57 dalek rakudo/curly: rid of the performance penalty which json gave us. When hundreds of dists
19:57 dalek rakudo/curly: were installed the startup time increased to over 5s easily.
19:57 dalek rakudo/curly: Now the startup time for -e1 is unchanged (lazy deserialization ftw), and
19:57 dalek rakudo/curly: using (and therefore locating) modules is more effective. Also a benefit
19:57 dalek rakudo/curly: of not having to deal with json is that we can stick Distribution and
19:57 dalek rakudo/curly: CompUnit objects in our database, which reduces our CURL code a lot.
19:57 dalek rakudo/curly: review: https://github.com/rakudo/rakudo/commit/173258a324
19:58 jnthn hah, I'd never quite imagined lazy deserialization would end up being useful *here* also :D
19:58 jnthn FROGGS++
19:58 FROGGS :o)
19:58 jnthn It was a darn nuisance to implement, so I'm kinda glad. :P
19:59 FROGGS jnthn: now I'm going to clean up MoarVM so it is pushable, and then I'll care about jvm
19:59 FROGGS jnthn++ # aye
20:00 FROGGS there is one issue though, when the MANIFEST is invalid (outdated), I cannot catch the exception thrown by nqp::deserialize
20:00 FROGGS it explodes in GC_WORKLIST_ADD or so
20:00 raydiak_ m: say ''
20:00 camelia rakudo-moar 1c4a70: OUTPUT«␤»
20:00 jnthn o.O
20:00 jnthn I'd appreciate a compact test case
20:00 FROGGS jnthn: I think it is unhappy with the string heap it is never going to use or so
20:01 TimToady m: say()
20:01 camelia rakudo-moar 1c4a70: OUTPUT«␤»
20:01 jnthn OK
20:01 raydiak_ anyone else seen this today? ==> Fetching Shell::Command␤extend/trunc NYI␤  in sub find at @targets:626␤  in sub rm_rf at lib/Shell/Command.pm:28␤...
20:01 FROGGS jnthn: we usually never carry on after failing there, but I want/need to
20:02 FROGGS raydiak_: no
20:02 jnthn FROGGS: Yeah, I suspect it's fixable
20:02 jnthn Without too much pain
20:02 FROGGS ==> Successfully installed Shell::Command
20:02 FROGGS jnthn: that's why I want to care about that later
20:02 eli-se joined #perl6
20:03 jnthn FROGGS: OK. Well, I should really rest rather than code this evening, but I'll happily take a look in the next couple of days.
20:04 FROGGS jnthn: sure :o)
20:04 FROGGS jnthn: have a nice evening/rest
20:05 fhelmberger joined #perl6
20:06 raydiak wow getting all kinds of interesting stuff trying to rebootstrap panda, now a "Bytecode validation error" about "register operand index out of range"...maybe rakduobrew and bootstrap panda fresh from scratch or something
20:06 FROGGS yeah, sounds like moar/rakudo mismatch or so
20:06 * TimToady pretty much always prefers --> over returns
20:07 jnthn TimToady: Odd, I more naturally reach for the latter. :)
20:07 TimToady I noticed that, which is why I said that :)
20:07 raydiak FROGGS: but whenever I get this sorted out...it's my first stab at making panda search show multiple projects by the same name :)
20:07 eli-se --> is weird as it's inside the parentheses
20:08 TimToady it's not weird there as it's part of the API
20:08 FROGGS \o/
20:08 FROGGS ++raydiak
20:08 raydiak FROGGS++ # always helpful and encouraging :)
20:09 FROGGS *g*
20:09 FROGGS raydiak: it is more fun this way :o)
20:09 raydiak huh, fresh rakudobrew gives same bytecode error when trying to bootstrap it's own panda even...will gist
20:09 FROGGS :S
20:10 TimToady considering the signature to be only input API is sort of an implementation-oriented point of view, or at least dispatch-oriented, in my opinion
20:10 raydiak https://gist.github.com/raydiak/4052b5cc235b37be6772
20:11 masak --> is one of the things not making sense on the binding side of the signatures/binding unification.
20:11 raydiak (the command was 'rakudobrew build moar' and all the output before the gist looked like always)
20:12 raydiak argh scratch that, sorry getting too many windows open, mixed them up :P
20:12 DrForr I just replaced some CPointers with callbacks, it'd be nice to know how to typedef the callbacks like you do in C, but I assume there's a new Perl mechanism.
20:14 TimToady masak: it's not about bindings, it's about functions
20:14 FROGGS sub foo(&cb :(int32 --> Str)) is native { * } # DrForr
20:15 masak TimToady: right.
20:15 masak m: say \($x).WHAT
20:15 camelia rakudo-moar 1c4a70: OUTPUT«5===SORRY!5=== Error while compiling /tmp/NB2m5NN7wv␤Variable '$x' is not declared␤at /tmp/NB2m5NN7wv:1␤------> 3say \(7⏏5$x).WHAT␤»
20:15 masak m: say :($x).WHAT
20:15 camelia rakudo-moar 1c4a70: OUTPUT«(Signature)␤»
20:15 masak m: my :($x) := 4; say $x
20:15 camelia rakudo-moar 1c4a70: OUTPUT«5===SORRY!5=== Error while compiling /tmp/224SoODavW␤Malformed my␤at /tmp/224SoODavW:1␤------> 3my7⏏5 :($x) := 4; say $x␤»
20:15 DrForr FROGGS: I understand the mechanism, I'd just like to be able to package (int32 --> Str) as a type in its own right.
20:15 masak m: my $x; :($x) := 4; say $x
20:15 camelia rakudo-moar 1c4a70: OUTPUT«Too few positionals passed; expected 1 argument but got 0␤  in block <unit> at /tmp/JF1hL5H_mR:1␤␤»
20:16 masak m: my $x; :($x) := (4,); say $x
20:16 camelia rakudo-moar 1c4a70: OUTPUT«4␤»
20:16 masak m: my $x; :($x --> Int) := (4,); say $x
20:16 camelia rakudo-moar 1c4a70: OUTPUT«4␤»
20:16 masak TimToady: my point is that in that binding above, the `--> Int` is nonsensical.
20:17 TimToady well, the space isn't supposed to be allowed before the colon there anyway...
20:17 FROGGS DrForr: IMO it is not designed to work that way...
20:17 TimToady but it's a constraint on what function you can bind, even if it's not currently enforced
20:18 DrForr FROGGS: No worries, I'll suss it out.
20:19 TimToady the constraint becomes more important when binding to &cb:(int32 --> Str) and such
20:21 dalek rakudo/curly: 9791ed5 | FROGGS++ | src/core/CompUnit.pm:
20:21 dalek rakudo/curly: initialize :aut/:ver to avoid warnings
20:21 dalek rakudo/curly: review: https://github.com/rakudo/rakudo/commit/9791ed5fa7
20:26 FROGGS fwiw, I pushed to panda/curly
20:26 dalek rakudo-star-daily: 7c137cb | coke++ | log/ (2 files):
20:26 dalek rakudo-star-daily: today (automated commit)
20:26 dalek rakudo-star-daily: review: https://github.com/coke/rakudo-star-daily/commit/7c137cb7b8
20:26 dalek rakudo-star-daily: 068a2d9 | coke++ | log/ (2 files):
20:26 dalek rakudo-star-daily: today (automated commit)
20:26 dalek rakudo-star-daily: review: https://github.com/coke/rakudo-star-daily/commit/068a2d9fe0
20:26 dalek perl6-roast-data: 8f9c91f | coke++ | / (9 files):
20:26 dalek perl6-roast-data: today (automated commit)
20:26 dalek perl6-roast-data: review: https://github.com/coke/perl6-roast-data/commit/8f9c91f292
20:28 eli-se I haven't written Perl 6 code since a long time. Might write a bra*nfuck compiler in it and read the changelog (if there is one).
20:29 TimToady m: /foo bar/
20:29 camelia rakudo-moar 580ede: OUTPUT«Potential difficulties:␤    Space is not signficant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing)␤    at /tmp/4kh26Mv_J4:1␤    ------> 3/foo7⏏5 bar/␤»
20:32 FROGGS m: /foo  bar/
20:32 camelia rakudo-moar 580ede: ( no output )
20:32 FROGGS m: /foo␤bar/
20:33 camelia rakudo-moar 580ede: ( no output )
20:33 TimToady it checks only for a single space
20:33 FROGGS yeah, I guessed it is intentional
20:37 zakharyas joined #perl6
20:40 raydiak FROGGS: https://github.com/raydiak/panda/compare/master...raydiak:plural seems enough to get both Foos to show up from panda search without obviously breaking anything else
20:40 raydiak tadzik++ did a nice job on the encapsulation here
20:41 FROGGS raydiak: wow, I expected more changes...
20:41 raydiak FROGGS: me too :)
20:42 FROGGS raydiak: now we need a way to pick...
20:42 raydiak but it passes all it's tests, and even "panda look Foo" works (just pulls the last one in the list, obviously, no way to...
20:42 raydiak yeah that :)
20:42 FROGGS like filtering with --auth and --ver, and when it is still ambiguous it should prompt or so
20:43 bartolin m: say '3e4d5'.Int
20:43 camelia rakudo-moar 580ede: OUTPUT«Cannot convert string to number: trailing characters after number in '3e4⏏d5' (indicated by ⏏)␤  in block <unit> at /tmp/D7PawNJp0i:1␤␤»
20:43 bartolin ^^ it is correct that this fails, isn't it?
20:43 FROGGS bartolin: aye
20:44 * bartolin will change two bogus tests in S32-num/int.t; FROGGS++
20:44 TimToady it ain'ta gonna magically turn into hex for you
20:44 bartolin *g*
20:44 FROGGS m: try +'3e4d5'; say 'alive'
20:44 camelia rakudo-moar 580ede: OUTPUT«alive␤»
20:45 FROGGS that was broken for a long time though, and jnthn++ fixed it just recently
20:46 TimToady darn his hide, he keeps making the rest of us look like slackers... :)
20:46 FROGGS :P
20:46 dolmen joined #perl6
20:46 raydiak FROGGS: I'll have a look at --ver and --auth next then :)  though I'll be leaving relatively soonish for a few errands and to visit my mother, so might not have anything to show for that until at least this PDT evening
20:46 dalek roast: 5afa999 | usev6++ | S32-num/int.t:
20:46 dalek roast: Fix two skipped tests
20:46 dalek roast: review: https://github.com/perl6/roast/commit/5afa99971e
20:46 FROGGS raydiak: np, have fun :o)
20:47 FROGGS I pushed all my curly stuff today... and need to port nqp::scdisclaim to jvm tomorrow *shudder*
20:47 raydiak of course, if it goes like the first step did, it could be done before I leave :)
20:48 FROGGS raydiak: just pass it around and smartmatch against it, if it was supplied
20:49 FROGGS raydiak: like here: https://github.com/rakudo/rakudo/blob/curly/src/core/CompUnitRepo/Local/Installation.pm#L221
20:50 FROGGS you need to turn both sides into a Version though
20:50 FROGGS rule is: nothing or Whatever means v0
20:50 FROGGS like seen here: https://github.com/rakudo/rakudo/blob/curly/src/core/Distribution.pm#L23
20:51 TimToady maybe I'll try to tackle cursors pretending to be pseudo-match objects soon, to solve both the need-{} problem and maybe gain some performance through procrastinating actual Match construction till it's no longer needed
20:51 FROGGS yeah
20:51 TimToady but speaking of procrastinating...
20:51 TimToady slacker nap &
20:51 FROGGS *g*
20:51 FROGGS TimToady: nap well :o)
20:52 FROGGS gnight #perl6
20:52 masak 'night, FROGGS
20:52 bartolin o/
20:54 eli-se goodbye frog
20:55 raydiak FROGGS: I see, makes sense...g'night o/
21:03 brrt left #perl6
21:03 dalek perl6-examples: aacc2a9 | paultcochrane++ | t/categories/cookbook/17sockets.t:
21:03 dalek perl6-examples: [cookbook] add test for 17sockets subcategory
21:03 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/aacc2a9d16
21:03 dalek perl6-examples: 22f1c61 | paultcochrane++ | categories/ (3 files):
21:03 dalek perl6-examples: Merge branch 'master' of github.com:perl6/perl6-examples
21:03 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/22f1c615dd
21:03 dalek perl6-examples: f0c2694 | paultcochrane++ | categories/euler/prob105-shlomif.p6:
21:04 dalek perl6-examples: [euler] progress info now printed with --verbose option
21:04 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/f0c2694ba7
21:04 dalek perl6-examples: 0a0b8b5 | paultcochrane++ | categories/euler/prob105-shlomif.p6:
21:04 dalek perl6-examples: [euler] document solution to problem 105
21:04 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/0a0b8b5b83
21:04 dalek perl6-examples: a99a9d4 | paultcochrane++ | categories/euler/prob105-shlomif.p6:
21:04 dalek perl6-examples: [euler] set input file location independently to run location
21:04 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/a99a9d4706
21:04 dalek perl6-examples: fb2fa40 | paultcochrane++ | t/categories/euler.t:
21:04 dalek perl6-examples: Handle script files ending in .p6
21:04 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/fb2fa407e5
21:04 dalek perl6-examples: 7f4b99d | paultcochrane++ | t/categories/euler.t:
21:04 dalek perl6-examples: [euler] Add test for solution to problem 105
21:04 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/7f4b99ddfb
21:06 dalek doc: 272df19 | paultcochrane++ | lib/Language/unicode_entry.pod:
21:06 dalek doc: Mention how to produce super/subscripts
21:06 dalek doc: review: https://github.com/perl6/doc/commit/272df19b84
21:06 dalek doc: 8d609da | paultcochrane++ | / (6 files):
21:06 dalek doc: Merge branch 'master' of github.com:perl6/doc
21:06 dalek doc: review: https://github.com/perl6/doc/commit/8d609da223
21:12 masak [ptc]: `git pull --rebase` will avoid merges such as the above one.
21:13 77CAAWGJB joined #perl6
21:13 masak also, [ptc]++ # commits
21:13 [ptc] masak: k, thanks
21:13 [ptc] sorry for the merge commits, they annoy me too...
21:14 masak git is confusing until it isn't :)
21:16 FROGGS joined #perl6
21:17 [ptc] heh :-)
21:18 [ptc] I've just stumbled across an interesting issue: if a module can't be found, perl6 returns 0 back to the shell
21:18 [ptc] shouldn't it return non-zero?
21:18 masak I'd assume so.
21:18 [ptc] maybe it's been fixed since 2015.04
21:19 [ptc] however, I'm updating the travis build scripts for Rakudo and I happened to notice that although a module wasn't found, the script returned everything ok
21:19 * masak tries locally
21:19 masak I'm getting 1 here.
21:19 [ptc] hrm, maybe it has been fixed more recently
21:21 [ptc] hrm, I'm getting 0 here (Debian Linux, This is perl6 version 2015.04-229-ga7cf7ce built on MoarVM version 2015.04-103-g65c89e7)
21:22 masak what exactly is it that you're running?
21:22 [ptc] it's not a major issue which has to be fixed quickly, just thought it might be good for someone to know about it
21:22 masak I tried `perl6 -MFoo -e 'say 42'` without a Foo.pm
21:23 [ptc] I'm using `perl6 -Ilib t/*.t; echo $?` and the module IO::Capture::Simple doesn't exist in perl6's search path
21:23 [ptc] although your example gives me an exit code of 1
21:24 masak ok, now we're talking :)
21:24 masak [ptc]: I task you with finding out why yours returns 0 and mine 1 ;)
21:24 masak what's the significant difference?
21:25 [ptc] well, mine is running a file directly
21:25 masak nope.
21:25 masak [ptc]: I put `use Foo;` in a file and ran it. still 1.
21:26 [ptc] um, the wildcard?
21:26 masak that's shell, not perl6
21:26 [ptc] that's what I thought...
21:26 masak also, I don't think you can run several *.t files like that.
21:27 [ptc] masak: `perl6` is only looking in -Ilib?
21:27 [ptc] ah
21:27 masak only the first argument to `perl6` is the script file.
21:27 masak but this should all be unrelated to the issue you're seeing.
21:27 masak still haven't found out why.
21:27 [ptc] at least it's an interesting problem :-)
21:28 masak yes. good luck :)
21:29 [ptc] thanks for the tip about multiple files, that should stop me tripping up again later :-)
21:31 masak sometimes I feel that bash is very antiquated.
21:32 masak its quoting, escaping and glob expansion all feel like they have fundamental design flaws that trip people up.
21:34 Sqirrel joined #perl6
21:36 [ptc] g'night masak :-);   g'night #perl6
21:36 geekosaur it's also trying to maintain compatibility with a standard based on an antiquated shell that had design flaws
21:36 geekosaur and sadly there are scripts that depend on its idiosyncrasies
21:38 spider-mario I can’t stand bash
21:38 ugexe powershell is great
21:38 spider-mario when I have to write a shell script, I’ll generally write a fish script, or a perl script if it’s somewhat complex
21:39 spider-mario I think most of the bash I write is for arch linux PKGBUILDs
21:39 spider-mario and even then… :D
21:40 spider-mario https://aur.archlinux.org/packages/ru/rust-git/PKGBUILD
21:40 spider-mario look at `prepare()` :p
21:42 FROGGS joined #perl6
21:52 quester joined #perl6
22:00 andreoss joined #perl6
22:01 andreoss m: <1/2>.denominator.say
22:01 camelia rakudo-moar 580ede: OUTPUT«2␤»
22:02 andreoss m: Rat.new(numerator => 1, denominator => 3).denominator.say
22:02 camelia rakudo-moar 580ede: OUTPUT«1␤»
22:03 andreoss m: Rat.new(:numerator(1), :denominator(3)).numerator.say
22:03 camelia rakudo-moar 580ede: OUTPUT«0␤»
22:08 cognominal joined #perl6
22:10 raydiak m: my $r = rx/foo/; say ?$r
22:10 camelia rakudo-moar 580ede: OUTPUT«Method 'match' not found for invocant of class 'Any'␤  in block <unit> at /tmp/tVcGRB2OJY:1␤␤»
22:10 raydiak is that what it's supposed to do?
22:18 ugexe m: my $r = rx/foo/; say .$r
22:18 camelia rakudo-moar 580ede: OUTPUT«Method '!cursor_start' not found for invocant of class 'Any'␤  in block <unit> at /tmp/iIhpvU6X1s:1␤␤»
22:18 * lizmat is too tired too look at backlog now, will do so tomorrow
22:35 raydiak if it wasn't clear what I'm trying to do, I just want to know if the thing in $r boolifies to true...I figured this would always be true for regex objects except for the Regex class object, but I guess boolifying them triggers a match attempt of some sort instead
22:37 * raydiak ended up with $r ~~ Regex || ?$r for now
22:38 raydiak since I don't actually care about the undef (Regex) case in this instance
22:45 TimToady m: Rat.new(numerator => 1, denominator => 3).nude.say
22:45 camelia rakudo-moar 580ede: OUTPUT«0 1␤»
22:45 TimToady m: Rat.new(1, 3).nude.say
22:45 camelia rakudo-moar 580ede: OUTPUT«1 3␤»
22:46 TimToady m: Rat.new(numerator => 21, denominator => 3).nude.say
22:46 camelia rakudo-moar 580ede: OUTPUT«0 1␤»
22:46 TimToady odd
22:46 TimToady m: Rat.new().nude.say
22:46 camelia rakudo-moar 580ede: OUTPUT«0 1␤»
22:47 TimToady strange default
22:47 TimToady and another call for "unused named parameter" warning
22:47 TimToady er, argument
22:48 masak wouldn't such a warning kind of spoil the hoops we jump through in the name of S12 "Interface Consistency"?
22:50 TimToady well, it'd only complain if there were no candidate that wants that name, I presume
22:50 andreoss m: <1/2>.denominator.say
22:50 camelia rakudo-moar 580ede: OUTPUT«2␤»
22:51 TimToady andreoss: it's easier to type .nude and get both of them
22:51 andreoss why those are not passed to thhe constructor?
22:52 TimToady same reason Int.new(:value(42)) doesn't work
22:52 TimToady it's not necessarily a good reason
22:52 andreoss m: Rat.new(nu => 1, de => 3).denominator.say
22:52 camelia rakudo-moar 580ede: OUTPUT«1␤»
22:52 masak m: class C { method foo { say "C" } }; class D is C { method foo(:$bar) { say "D ($bar)" } }; say .foo(:bar(42)) for C.new, D.new
22:52 camelia rakudo-moar 580ede: OUTPUT«C␤True␤D (42)␤True␤»
22:52 TimToady no, it's just ignoring our args
22:52 masak m: class C { method foo { say "C" } }; class D is C { method foo(:$bar) { say "D ($bar)" } }; .foo(:bar(42)) for C.new, D.new
22:52 camelia rakudo-moar 580ede: OUTPUT«C␤D (42)␤»
22:53 masak TimToady: in the above code, should it warn that C's .foo doesn't expect a :bar ?
22:53 TimToady we have only a constructor that takes up to two positionals for Rat
22:53 andreoss left #perl6
22:53 TimToady masak: once we actually have a list of candidates for a known type, we can compute the set of wanted names, as long as nobody has explicitly referenced %_
22:54 labster There are a lot of Parrot related PRs in the Rakudo repo.  Should I just close them, or is there a branch somewhere that I can put Parrot commits in?
22:55 andreoss joined #perl6
22:55 andreoss m: &(Rat.new).perl.say
22:55 camelia rakudo-moar 580ede: OUTPUT«0.0␤»
22:55 TimToady it defaults to 0/1
22:55 andreoss how can i see the signature here?
22:55 skids TimToady: I would assume callsame/nextsame counts as explcitly referencing %_?
22:55 TimToady m: say Rat.new(1,2,3)
22:55 camelia rakudo-moar 580ede: OUTPUT«Too many positionals passed; expected 1 to 3 arguments but got 4␤  in block <unit> at /tmp/fPR65tjznN:1␤␤»
22:56 TimToady m: say Rat.can('new')
22:56 camelia rakudo-moar 580ede: OUTPUT«new new␤»
22:56 TimToady m: say .signature for Rat.can('new')
22:56 camelia rakudo-moar 580ede: OUTPUT«Use of Nil in string context  in block  at /tmp/_SgYLcofrx:1␤(Rat: Int \nu = { ... }, Int \de = { ... }, *%_)␤($: Any |)␤»
22:57 TimToady hum, where's the Nil from?
22:58 TimToady m: say Rat.can('new')[0].signature
22:58 camelia rakudo-moar 580ede: OUTPUT«Use of Nil in string context  in block <unit> at /tmp/XYgMtaVvR4:1␤(Rat: Int \nu = { ... }, Int \de = { ... }, *%_)␤»
22:58 TimToady m: say Rat.can('new')[1].signature
22:58 camelia rakudo-moar 580ede: OUTPUT«($: Any |)␤»
23:03 japhb Can't install Inline::Python right now on a fresh build ... known?
23:04 raydiak maybe I don't fully comprehend the semantics involved, but I never really got the whole interface consistency excuse...I for one wouldn't expect nextsame et al to accept and magically shunt args through that I didn't declare params for. naievely before knowing the real rules, if they pass a named that I didn't explicitly declare, I wouldn't expect multidispatch to even call a routine in the first place if the
23:04 raydiak signature doesn't match the args without special *%_ magic
23:04 japhb Looks to be not finding its .so: "unable to find Inline/pyhelper.so IN @*INC"
23:06 japhb raydiak: You have an array of things that are either Foo or Bar, where Bar inherits from Foo.  You want to call a method (defined in Foo, enhanced in Bar) on all elements of the array, and for Bar elements to use its extra settings.  How do you do that cleanly?
23:07 japhb (And if your answer is a type test on each element, assume the array is filled with 56 different types all inheriting from a common base, and try again.)
23:07 masak japhb++ # good explanation
23:07 TimToady plus, assume some of the arguments are aimed at a single layer, while others are aimed at most or all of them
23:08 japhb .? allows automatically ignoring if an object doesn't have a method, but it is the named argument magic that allows us to do it if the method exists, but subtypes have more settings
23:08 raydiak japhb++ quite illustrative :)  will ponder...
23:08 masak I've come to think of it as "base class method must assume unknown named arguments are for deriving classes' methods"
23:08 japhb nodnod
23:09 BenGoldberg joined #perl6
23:10 masak 'night, #perl6
23:10 raydiak g'night masak o/
23:10 japhb o/ masak
23:10 raydiak off the top of my head I'd try to arrange things so the Bar method is responsible for calling the Foo method instead of the other way around
23:11 jdv79 kinda like a big blowtorch - meh'cur" work broke it...
23:11 japhb raydiak: If it is an outside iterator that is calling the same method on all elements, how does that work?
23:11 jdv79 uh, no
23:11 raydiak shouldn't multidispatch select Bar in preference to Foo anyway?
23:11 jdv79 japhb: rumor is the recent "cur" work broke it Inline::Python
23:11 japhb raydiak: named arguments aren't engaged in multidispatch
23:12 japhb jdv79: Awww
23:12 jdv79 i also would like to install it; someday
23:12 japhb raydiak: Also, my argument applies to regular methods as well, not just multimethods
23:12 raydiak japhb: the last statement is specifically refering to multidispatch on the invocant's type
23:13 raydiak hm
23:13 japhb raydiak: It sounds like you're looking for multimethods and .? instead of . for your method dispatch method
23:14 raydiak wait what does nextsame have to do with non-multis?
23:15 raydiak oh, right, b/c there can be one per level of inheritance even if it's not a multi
23:16 raydiak japhb: thanks for helping me make sure I fully understand the problem...will ponder more :)
23:22 dalek rakudo/nom: 8eb18e8 | TimToady++ | src/core/Parameter.pm:
23:22 dalek rakudo/nom: don't do ~Nil in Param.perl
23:22 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/8eb18e88c4
23:27 jack_rabbit_ joined #perl6
23:29 raydiak would it be a more reasonable compromise to tell people to add explicit *% when they require it for nextsame?
23:29 jack_rabbit joined #perl6
23:31 raydiak rather than compromise the integrity of parameter-checking on every single method call on anything anywhere?
23:33 TimToady that only works one direction, and probably the wrong direction
23:34 TimToady a parent class cannot predict what a child class will want, so every parent would have to add *%
23:34 TimToady which is equivalent to what we have
23:38 raydiak /o\
23:40 raydiak ah well, I'll let it percolate in my mind until it settles or another question bubbles up (later)
23:51 redhands joined #perl6
23:55 raiph joined #perl6

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

Perl 6 | Reference Documentation | Rakudo