Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6-dev, 2017-01-22

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

All times shown according to UTC.

Time Nick Message
00:10 TimToady m: printf "%3d", 42
00:10 camelia rakudo-moar 7f245f: OUTPUT« 42»
00:10 TimToady m: printf "%3.0d", 42
00:10 camelia rakudo-moar 7f245f: OUTPUT«   »
00:10 TimToady ^^^ bug
00:11 TimToady is supposed to suppress output only if the value is 0
00:44 * brokenchicken clicks "Take"
00:53 brokenchicken m: dd sprintf "%.3d", 55
00:53 camelia rakudo-moar 7f245f: OUTPUT«"55"␤»
00:54 brokenchicken TimToady: that's broken too, innit ^? It's supposed to pad with zeros?
00:54 brokenchicken and give "055"
00:56 MasterDuke m: dd sprintf "%03d", 55
00:56 camelia rakudo-moar 7f245f: OUTPUT«"055"␤»
00:58 TimToady you need explicit 0 to pad there, I think
00:58 brokenchicken m: say "|{sprintf "%10.5d", 42}
00:58 camelia rakudo-moar 7f245f: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in double quotes; couldn't find final '"' ␤at <tmp>:1␤------> 3say "|{sprintf "%10.5d", 42}7⏏5<EOL>␤»
00:58 brokenchicken m: say "|{sprintf "%10.5d", 42}"
00:58 camelia rakudo-moar 7f245f: OUTPUT«|        42␤»
00:58 brokenchicken $ perl -wlE 'say "|" . sprintf("%10.5d", 42) . "|"'
00:58 brokenchicken |     00042|
00:59 brokenchicken $ perl -wlE 'say "|" . sprintf("%.5d", 42) . "|"'
00:59 brokenchicken |00042|
00:59 brokenchicken Are we following what Perl 5 does?
01:00 TimToady huh
01:00 brokenchicken from perldoc: "For integer conversions, specifying a precision implies that the output of the number itself should be zero-padded to this width, where the 0 flag is ignored:"
01:00 geekosaur that's also ANSI C
01:01 geekosaur replacing K&R's 0 flag
01:02 brokenchicken m: dd sprintf "%.3d", 123456789
01:02 camelia rakudo-moar 7f245f: OUTPUT«"123"␤»
01:02 brokenchicken heh :)
01:03 TimToady that's also wrong
01:03 TimToady should be minimum for d
01:04 brokenchicken will fix
01:04 TimToady it can be inferred from the system sprintf docs that a %.3d should have minimum 3 digits, so obviously those extra digits would have to be 0
01:58 Geth nqp: 92bf17d5f8 | (Zoffix Znet)++ | t/hll/06-sprintf.t
01:58 Geth nqp: Remove outdated comment
01:58 Geth nqp:
01:58 Geth nqp: The file is already in t/hll
01:58 Geth nqp: review: https://github.com/perl6/nqp/commit/92bf17d5f8
02:08 Geth nqp: 1de45e4a3d | (Zoffix Znet)++ | 2 files
02:08 Geth nqp: Fix sprintf precision parameter for `d`
02:08 Geth nqp:
02:08 Geth nqp: Currently, it just chops the number to $precision digits, producing
02:08 Geth nqp: wrong results. The correct behaviour is for the precision to signify
02:08 Geth nqp: how many digits long the number should be, prefixing it with zeros if
02:08 Geth nqp: needed. This also results in an empty string if precision is zero and
02:08 Geth nqp: the number is zero too.
02:08 Geth nqp:
02:08 Geth nqp: Bug find: https://irclog.perlgeek.de/perl6-dev/2017-01-22#i_13966753
02:08 Geth nqp: review: https://github.com/perl6/nqp/commit/1de45e4a3d
02:14 Ven joined #perl6-dev
02:18 MasterDuke m: dd sprintf "%0۳d", 55
02:18 camelia rakudo-moar 7f245f: OUTPUT«Directive d not applicable for type Int␤␤»
02:21 kalkin- joined #perl6-dev
02:22 Geth nqp: ed1b835a7a | (Zoffix Znet)++ | t/hll/06-sprintf.t
02:22 Geth nqp: Add tests to sprintf "%d" precision when given as "*"
02:22 Geth nqp: review: https://github.com/perl6/nqp/commit/ed1b835a7a
02:22 MasterDuke m: dd sprintf "%03d", 55
02:22 camelia rakudo-moar 7f245f: OUTPUT«"055"␤»
02:23 MasterDuke TimToady, brokenchicken: ^^^ should Nd's be allowed in sprintf format strings?
02:24 * brokenchicken shrugs
02:34 Geth rakudo/nom: a1c7d01502 | (Zoffix Znet)++ | tools/build/NQP_REVISION
02:34 Geth rakudo/nom: (nqp bump) Fix precision for "%d" in sprintf
02:34 Geth rakudo/nom:
02:34 Geth rakudo/nom: Fixed in https://github.com/perl6/nqp/commit/1de45e4a3dcd8a9ce2bbe0
02:34 Geth rakudo/nom: review: https://github.com/rakudo/rakudo/commit/a1c7d01502
02:34 Geth rakudo/nom: version bump brought these changes: https://github.com/perl6/nqp/compare/2017.01...2017.01-10-ged1b835
02:38 Geth roast: 4e3fd00b26 | (Zoffix Znet)++ | S32-str/sprintf.t
02:38 Geth roast: Test sprintf "%d" precision parameter
02:38 Geth roast:
02:38 Geth roast: Rakudo fix: https://github.com/rakudo/rakudo/commit/a1c7d01502
02:38 Geth roast: NQP fix: https://github.com/perl6/nqp/commit/1de45e4a3dcd8a9ce
02:38 Geth roast: review: https://github.com/perl6/roast/commit/4e3fd00b26
02:49 ilbot3 joined #perl6-dev
02:49 Topic for #perl6-dev is now Perl 6 language and compiler development 2.0 | Logs at http://irclog.perlgeek.de/perl6-dev/today
03:31 Ven joined #perl6-dev
04:07 Ven joined #perl6-dev
04:15 Ven joined #perl6-dev
04:23 Ven_ joined #perl6-dev
06:10 Ven joined #perl6-dev
07:13 Ven joined #perl6-dev
07:37 Ven joined #perl6-dev
07:38 AlexDaniel joined #perl6-dev
07:59 FROGGS joined #perl6-dev
09:46 RabidGravy joined #perl6-dev
10:09 [Tux] This is Rakudo version 2017.01-7-ga1c7d0150 built on MoarVM version 2017.01-10-g76872dbe
10:09 [Tux] csv-ip5xs        2.960
10:09 [Tux] test            12.644
10:09 [Tux] test-t           5.062
10:09 [Tux] csv-parser      13.419
11:52 Geth rakudo: usev6++ created pull request #1002: Don't mention *CORE.setting in error message
11:52 Geth rakudo: review: https://github.com/rakudo/rakudo/pull/1002
11:53 Geth rakudo/nom: 10bcec2865 | usev6++ | src/core/Backtrace.pm
11:53 Geth rakudo/nom: Don't mention *CORE.setting in error message
11:53 Geth rakudo/nom:
11:53 Geth rakudo/nom: References to CORE.setting.moarvm where removed with 4ae08e0b24,
11:53 Geth rakudo/nom: but rakudo-j points to gen/jvm/CORE.setting (no .jar there).
11:53 Geth rakudo/nom:
11:53 Geth rakudo/nom: Fixes RT #130509 and RT #124767 on JVM
11:53 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=130509
11:53 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=124767
11:53 Geth rakudo/nom: review: https://github.com/rakudo/rakudo/commit/10bcec2865
11:53 Geth rakudo/nom: a56a895808 | lizmat++ | src/core/Backtrace.pm
11:53 Geth rakudo/nom: Merge pull request #1002 from usev6/rt130509_jvm
11:54 Geth rakudo/nom:
11:54 Geth rakudo/nom: Don't mention *CORE.setting in error message
11:54 Geth rakudo/nom: review: https://github.com/rakudo/rakudo/commit/a56a895808
12:09 cognominal joined #perl6-dev
12:17 Geth rakudo/nom: c3c86dcf51 | (Elizabeth Mattijsen)++ | src/core/Backtrace.pm
12:17 Geth rakudo/nom: Emphasize this is JVM backend specific behaviour
12:17 Geth rakudo/nom: review: https://github.com/rakudo/rakudo/commit/c3c86dcf51
12:21 bartolin thanks :-)
12:30 lizmat bartolin++  # for chasing JVM issues!
12:41 dogbert17 lizmat: is https://gist.github.com/dogbert17/b052a9da0457916c5f8300990cdad35f affected by the grep deopt made recently? Runs twice as slowly on head compared to 2016.12 and older
12:41 lizmat dogbert17: yeah, I saw it
12:41 lizmat but if we want to support redo in a grep, there is no way around it that I can see at the moment
12:42 dogbert17 just wanted to make sure it wasn't something else, i.e. something unintended
12:42 lizmat it sucks, since redo is dynamic, so we can't even inspect the block in the optimizer for use of redo
12:43 lizmat the only way that jnthn pointed out, was to have goto working :-)
12:43 lizmat then we wouldn't need to penalize all greps for the use of redo
12:43 dogbert17 so it might be fixed in time then?
12:44 lizmat yes, once we have goto
12:44 dogbert17 cool
12:44 lizmat fwiw, this would benefit *all* map processing, not just grep
12:44 lizmat because everywhere we need to support redo, we need to build another layer of loop around everything to support it
12:45 lizmat $redo = 1; while $redo { $redo = 0; call block }
12:45 dogbert17 will it go back to the speed it had in 2016.12 ot will it be even faster with goto
12:45 lizmat it should go back to the speed we had, not faster
12:47 timotimo did you see how i built redo for whenever blocks?
12:47 lizmat timotimo: not yet
12:47 timotimo i put the loop in separately, only to be entered once we actually hit the redo handler once
12:47 timotimo perhaps that could be done here as well
12:48 timotimo i.e. { call block; CONTROL { when 'redo' { $redo = 1; while $redo { $redo = 0; call block } } } }
12:48 timotimo i *think* we only pay if redo was actually used if the code is like that
12:48 timotimo but i haven't measured
12:58 dogbert17 timotimo lizmat: should this snippet hang?
12:58 dogbert17 m:   m: class SQLString { }; my $stringy = Str.^find_method("Stringy"); my $handler = $stringy.wrap(method () { SQLString.new(:str(callsame)) }); say "foo".Stringy # should this loop indefinitely?
12:59 dogbert17 m: class SQLString { }; my $stringy = Str.^find_method("Stringy"); my $handler = $stringy.wrap(method () { SQLString.new(:str(callsame)) }); say "foo".Stringy # should this loop indefinitely?
12:59 camelia rakudo-moar c3c86d: OUTPUT«(timeout)»
12:59 camelia rakudo-moar c3c86d: OUTPUT«(timeout)»
12:59 timotimo Stringy has always had a tendency to cause endless loops
13:00 lizmat perhaps we need to look at what you're trying to achieve ?
13:01 dogbert17 nothing :) took it from a MoarVM bug report, it used to crash before jnthn made a callsame fix
13:02 dogbert17 if the snippet is supposed to loop endlessly I think the original bug can be cinsidered fixed
13:02 dogbert17 *considered
13:05 dogbert17 it's from https://github.com/MoarVM/MoarVM/issues/412
13:18 lizmat https://www.bleepingcomputer.com/news/security/oracle-to-block-jar-files-signed-with-md5-starting-with-april-2017/  # does this affect our use of the JVM backend ?
13:22 timotimo i'm not sure we sign our .jar files at all?
13:24 * lizmat has no idea
13:25 timotimo but i expect it's a trivial matter to use a different hash there. like, changing a commandline flag or something
13:49 Geth rakudo/nom: d71bf1e90c | (Elizabeth Mattijsen)++ | src/core/Supply.pm
13:49 Geth rakudo/nom: Implement Supply.skip()
13:49 Geth rakudo/nom: review: https://github.com/rakudo/rakudo/commit/d71bf1e90c
14:40 geekosaur joined #perl6-dev
14:42 moritz http://stackoverflow.com/questions/41791602/should-perl-6-be-able-to-untangle-the-inclusion-of-the-same-role-from-different that looks like a bug to me
14:43 timotimo moritz: i think you'd have to use "role Either is Alpha is Digit"
14:45 moritz timotimo: why? then you lose all the advantages that role semantics bring
14:45 timotimo i just think you have to use derivation rather than composition?
14:45 timotimo but ... *shrug*
14:45 timotimo not a thing i've been doing so far
16:48 cognominal joined #perl6-dev
18:16 brokenchicken m: say (Empty xx 4)[0]
18:16 camelia rakudo-moar d71bf1: OUTPUT«()␤»
18:16 brokenchicken m: dd (Empty xx 4)[0]
18:16 camelia rakudo-moar d71bf1: OUTPUT«Empty␤»
18:16 brokenchicken m: dd (Slip.new() xx 4)[0]
18:16 camelia rakudo-moar d71bf1: OUTPUT«Nil␤»
18:17 brokenchicken m: dd (Slip.new(42, 44) xx 4)[0]
18:17 camelia rakudo-moar d71bf1: OUTPUT«Int <element> = 42␤»
18:17 brokenchicken Seems Empty is being mishandled here?
18:26 brokenchicken :S make t/spec/S16-io/newline.t fails but prove -e './perl6' -vlr t/spec/S16-io/newline.t succeeds
18:26 brokenchicken and t/spec/S10-packages/precompilation.t consistently fails
18:26 brokenchicken mm.. and same thing with t/spec/integration/advent2011-day03.t  make fails but prove succeeds :S
18:27 * brokenchicken git resets and tries another run
18:36 brokenchicken ah, k. Prolly something with precomp. My VM froze mid one spectest run and I just ran the second one. I now rebuilt and all seems peachy
18:38 MasterDuke i just cleaned out the .precomp directory in my rakudo/t/spec/packages earlier this morning, it was >400Mb, with files/directories >6m old
18:45 brokenchicken yeah, once I ran `rm -fr rakudo` and it ran for several minutes...
18:50 Geth rakudo/nom: 4e49ec135d | (Zoffix Znet)++ | src/core/List.pm
18:50 Geth rakudo/nom: Fix infix:<xx>(..., *) for empty Slips
18:50 Geth rakudo/nom:
18:50 Geth rakudo/nom: The current code makes the assumption that when a Slip is encountered,
18:50 Geth rakudo/nom: it is non-empty, and it saves it in an Array and shifts from that array,
18:50 Geth rakudo/nom: to obtain next value. This causes a Failure when the Slip is empty and
18:50 Geth rakudo/nom: there is nothing to shift.
18:50 Geth rakudo/nom:
18:50 Geth rakudo/nom: Fix by checking whether we can shift and returning IterationEnd if can't.
18:50 Geth rakudo/nom:
18:50 Geth rakudo/nom: Fixes RT#130619: https://rt.perl.org/Ticket/Display.html?id=130619
18:50 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=130619
18:50 Geth rakudo/nom: review: https://github.com/rakudo/rakudo/commit/4e49ec135d
18:53 Geth roast: 75e15bbb2a | (Zoffix Znet)++ | S03-operators/repeat.t
18:53 Geth roast: Test empty slip with xx * works
18:53 Geth roast:
18:53 Geth roast: RT#130619: https://rt.perl.org/Ticket/Display.html?id=130619
18:53 Geth roast: Rakudo fix: https://github.com/rakudo/rakudo/commit/4e49ec135d
18:53 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=130619
18:53 Geth roast: review: https://github.com/perl6/roast/commit/75e15bbb2a
18:58 brokenchicken m: dd (Empty.new xx 4)[0]
18:58 camelia rakudo-moar d71bf1: OUTPUT«Nil␤»
18:58 brokenchicken m: dd (Empty xx 4)[0]
18:58 camelia rakudo-moar d71bf1: OUTPUT«Empty␤»
18:58 brokenchicken (one's thunked the other isn't)
18:59 brokenchicken prolly makes sense...
19:11 Geth rakudo/nom: 15753fd3c3 | (Elizabeth Mattijsen)++ | src/core/Supply.pm
19:11 Geth rakudo/nom: Fix scoping issue with Supply.skip, spotted by jnthn++
19:11 Geth rakudo/nom: review: https://github.com/rakudo/rakudo/commit/15753fd3c3
19:34 Geth roast: 943b3ad515 | (Elizabeth Mattijsen)++ | S32-list/skip.t
19:34 Geth roast: Add tests for Any.skip
19:34 Geth roast: review: https://github.com/perl6/roast/commit/943b3ad515
19:37 Geth rakudo/nom: cbb7130038 | (Elizabeth Mattijsen)++ | t/spectest.data
19:37 Geth rakudo/nom: Make sure we run Any.skip tests
19:37 Geth rakudo/nom: review: https://github.com/rakudo/rakudo/commit/cbb7130038
19:41 Geth roast: 24af69c6ca | (Elizabeth Mattijsen)++ | S17-supply/skip.t
19:41 Geth roast: Add basic Supply.skip tests
19:41 Geth roast: review: https://github.com/perl6/roast/commit/24af69c6ca
19:42 Geth rakudo/nom: 8a448d4c63 | (Elizabeth Mattijsen)++ | t/spectest.data
19:42 Geth rakudo/nom: Make sure we run Supply.skip tests
19:42 Geth rakudo/nom: review: https://github.com/rakudo/rakudo/commit/8a448d4c63
19:51 Geth rakudo/nom: e0201f15df | (Elizabeth Mattijsen)++ | src/core/Any-iterable-methods.pm
19:51 Geth rakudo/nom: Introducing Any.batch(n)
19:51 Geth rakudo/nom:
19:51 Geth rakudo/nom: Since Supply has a .batch, I figured we should probably also have an
19:51 Geth rakudo/nom: Any.batch, just to keep the balance  :-)
19:51 Geth rakudo/nom: review: https://github.com/rakudo/rakudo/commit/e0201f15df
20:07 Geth roast: ca42a37505 | (Elizabeth Mattijsen)++ | S32-list/batch.t
20:07 Geth roast: Add some basic Any.batch tests
20:07 Geth roast: review: https://github.com/perl6/roast/commit/ca42a37505
20:07 Geth rakudo/nom: ce76f4c5a0 | (Elizabeth Mattijsen)++ | t/spectest.data
20:07 Geth rakudo/nom: Make sure we run the Any.batch tests
20:07 Geth rakudo/nom: review: https://github.com/rakudo/rakudo/commit/ce76f4c5a0
20:34 buggable joined #perl6-dev
20:41 buggable joined #perl6-dev
20:44 buggable_ joined #perl6-dev
20:45 ggoebel joined #perl6-dev
20:46 buggable joined #perl6-dev
20:46 huggable joined #perl6-dev
20:49 MasterDuke is anyone else getting `Argument "3.36_01" isn't numeric in numeric gt (>) at t/harness5 line 118.` when running `make m-spectest`?
20:50 MasterDuke This is perl 5, version 24, subversion 1 (v5.24.1) built for x86_64-linux-thread-multi
20:52 * moritz rebuilds rakudo to reproduce
20:55 MasterDuke i don't think it's a rakudo thing
20:55 MasterDuke pretty sure perl5 was updated on my machine a day or two ago
20:56 Geth rakudo: MasterDuke17++ created pull request #1003: Speedup postincrement and postdecrement by ~5%
20:56 Geth rakudo: review: https://github.com/rakudo/rakudo/pull/1003
20:57 Geth rakudo/nom: fd74c91791 | (Daniel Green)++ | src/core/Int.pm
20:57 Geth rakudo/nom: Speedup postincrement and postdecrement by ~5%
20:57 Geth rakudo/nom:
20:57 Geth rakudo/nom: Change an assign into a bind.
20:57 Geth rakudo/nom: review: https://github.com/rakudo/rakudo/commit/fd74c91791
20:57 Geth rakudo/nom: 8729048c3f | lizmat++ | src/core/Int.pm
20:57 Geth rakudo/nom: Merge pull request #1003 from MasterDuke17/speedup_postinc_and_postdec
20:57 Geth rakudo/nom:
20:57 Geth rakudo/nom: Speedup postincrement and postdecrement by ~5%
20:57 Geth rakudo/nom: review: https://github.com/rakudo/rakudo/commit/8729048c3f
20:58 MasterDuke lizmat++ that was fast
20:58 lizmat I actually had been looking at that one just minutes before your PR  :-)
20:59 MasterDuke heh. i also tried wrapping the lines in a nqp::stmts(), but i measured no difference
21:00 lizmat did you try doing the binding of b inside the nqp::add_i ?
21:01 MasterDuke nope
21:01 lizmat that *may* help as well  :-)
21:02 lizmat it's something I would try :-)
21:02 MasterDuke i'll run some more tests
21:02 lizmat MasterDuke++
21:09 Geth rakudo/nom: 3a4b26283b | (Zoffix Znet)++ | t/harness5
21:09 Geth rakudo/nom: Avoid warning when TAP::Harness's version ain't numeric
21:09 Geth rakudo/nom: review: https://github.com/rakudo/rakudo/commit/3a4b26283b
21:23 ggoebel joined #perl6-dev
21:26 MasterDuke lizmat: no noticeable difference
21:26 lizmat ok, I guess the optimizer / spesh / JIT are doing their work then  :-)
21:36 MasterDuke in rakudo/src there are 158 `{*}` and 337 `{ * }`. anybody have strong opinions about whether we should be consistent? and if so, which way?
21:37 * brokenchicken has no opinion
21:37 timotimo fewer spaces to make parsing faster!!!!!!k ;)
21:37 brokenchicken :)
21:38 Geth rakudo/nom: 0fdb9e4e40 | (Elizabeth Mattijsen)++ | 2 files
21:38 Geth rakudo/nom: nativeshaped.pairs returns Pair.value that is a LHS
21:38 Geth rakudo/nom:
21:38 Geth rakudo/nom: Before this, (my int @a[2;2]).pairs[0].value++ would fail with:
21:38 Geth rakudo/nom:   Cannot resolve caller postfix:<++>(Int)
21:38 Geth rakudo/nom: review: https://github.com/rakudo/rakudo/commit/0fdb9e4e40
21:38 MasterDuke not entirely a bad idea: https://gist.github.com/MasterDuke17/7723025658833476d5f312805c3274b5#file-compile_profile_20170115_results-csv-L8
21:39 timotimo We can make this file beautiful and searchable if this error is corrected: It looks like row 97 should actually have 1 column, instead of 2.
21:39 timotimo oh?
21:39 MasterDuke _ws and ws are #8 and #18 by exclusive time for profile-compile of a rakudo build
21:40 MasterDuke github thinks it's a csv, so the infix<,> messes it up
21:40 timotimo ah, hehehe
21:40 timotimo pretty good
21:40 * MasterDuke is partially to blame for naming the file .csv
21:41 timotimo tsv would be better, because i'm pretty sure we don't have an operator \t so far :D
21:41 moritz not YET :-)
21:42 timotimo is probably possible to put in already
21:47 RabidGravy I keep meaning to post this with regard to the performance thing as it seemed pertinent http://jamesclear.com/marginal-gains
21:47 yoleaux2 21 Jan 2017 21:35Z <MasterDuke> RabidGravy: yep, https://github.com/MoarVM/MoarVM/pull/501
21:48 RabidGravy MasterDuke++ # nice one
21:49 Geth rakudo/nom: 1181afec40 | (Elizabeth Mattijsen)++ | 2 files
21:49 Geth rakudo/nom: Make sure my int @a[2].kv gives LHS valueo
21:49 Geth rakudo/nom:
21:49 Geth rakudo/nom: Before this, (my int @a[2]).kv[1]++ would fail with:
21:49 Geth rakudo/nom:   Cannot resolve caller postfix:<++>(Int)
21:49 Geth rakudo/nom: review: https://github.com/rakudo/rakudo/commit/1181afec40
22:04 Geth rakudo/nom: e195e5f990 | (Elizabeth Mattijsen)++ | 2 files
22:04 Geth rakudo/nom: Make sure my int @a[2].values gives LHS values
22:04 Geth rakudo/nom:
22:04 Geth rakudo/nom: Before this, (my int @a[2]).values[0]++ would fail with:
22:04 Geth rakudo/nom:   Cannot resolve caller postfix:<++>(Int)
22:04 Geth rakudo/nom: review: https://github.com/rakudo/rakudo/commit/e195e5f990
22:31 lizmat m: my int @a[3] = (0,1,2); @a = (); dd @a   # perhaps unexpected behaviour of 1dim shaped arrays ?
22:31 camelia rakudo-moar e195e5: OUTPUT«array[int].new(:shape(3,), [0, 1, 2])␤»
22:32 lizmat m: my int @a = (0,1,2); @a = (); dd @a   # perhaps unexpected behaviour of 1dim shaped arrays ?
22:32 camelia rakudo-moar e195e5: OUTPUT«array[int].new()␤»
22:32 timotimo m: my int @a[3] = 0, 1, 2; @a = (1,); dd @a
22:32 camelia rakudo-moar e195e5: OUTPUT«array[int].new(:shape(3,), [1, 1, 2])␤»
22:32 timotimo at least it's consistent with that?
22:33 lizmat yes, it is
22:33 lizmat but I'm thinking, suppose we pass an array to a module somewhere, and that module does = () thinking it initializes it
22:34 lizmat m: sub a(@a) { @a = () }; a(my @a[3] = (42,66,666)); dd @a
22:34 camelia rakudo-moar e195e5: OUTPUT«Array.new(:shape(3,), [42, 66, 666])␤»
22:35 lizmat m: sub a(@a) { @a = () }; a(my @a = (42,66,666)); dd @a
22:35 camelia rakudo-moar e195e5: OUTPUT«Array @a = []␤»
22:35 lizmat feels a bit like a footgun to me
22:36 lizmat unless we can actually have something in a signature to match shaped arrays
22:37 lizmat I came across this while investigating the native shaped array coverage, which is minimal atm
22:37 timotimo m: my int @a[3] = 9, 9, 9; @a = Empty; dd @a
22:37 camelia rakudo-moar e195e5: OUTPUT«array[int].new(:shape(3,), [9, 9, 9])␤»
22:37 timotimo to me, that's more footgunny, as it explicitly says "empty"
22:37 lizmat yup
22:37 timotimo but i really need sleep now
22:37 lizmat timotimo: good night, sleep tight!
22:37 timotimo i'll do my best! :)
23:12 jsimonet joined #perl6-dev
23:13 jnthn At the same time, `@shaped-array = @replace-first-elems-with-this` working fine then exploding when the second array contains zero elems would be a nasty discontinuity.
23:14 jnthn Not sure we should break a useful thing's boundary case for the sake of a footgun.
23:14 lizmat well, I'm working on adding a warning, would that be ok ?
23:15 jnthn Not really :(
23:15 lizmat also for the () case ?
23:15 jnthn I mean, I guess you could put quietly but it's still a discontinuity
23:15 jnthn Can we distinguish Empty?
23:15 jnthn I can go with warning on Empty
23:15 jnthn m: say |()
23:15 camelia rakudo-moar e195e5: OUTPUT«␤»
23:15 jnthn m: say (|()).perl
23:15 camelia rakudo-moar e195e5: OUTPUT«slip()␤»
23:15 jnthn OK, good, we can distinguish that from Empty :)
23:16 jnthn I'm fine with the warning on Empty
23:16 lizmat ok
23:16 lizmat but then I will need to rethink the code and warning
23:16 lizmat and that will be tomorrow  :-)
23:17 jnthn Yeah, I'm gonna turn in too :)
23:17 jnthn busy day for me tomorrow; likely won't be around all that much.
23:17 lizmat ok, sleep well!
23:18 jnthn Thanks, you also :)
23:18 jnthn 'night, #perl6-dev
23:38 jsimonet joined #perl6-dev
23:48 MasterDuke m: say sprintf '%0۳d', -3.1415
23:48 camelia rakudo-moar e195e5: OUTPUT«Directive d not applicable for type Rat␤␤»
23:48 MasterDuke m: say sprintf '%0۳d', -31415
23:48 camelia rakudo-moar e195e5: OUTPUT«Directive d not applicable for type Int␤␤»
23:48 MasterDuke m: say sprintf '%03d', -31415
23:48 camelia rakudo-moar e195e5: OUTPUT«-31415␤»
23:49 MasterDuke m: say sprintf '%۳.3Gd', -3.1415
23:49 camelia rakudo-moar e195e5: OUTPUT«This representation (Null) does not support elems (for type VMNull)␤␤»
23:49 MasterDuke m: say sprintf '%3.3Gd', -3.1415
23:49 camelia rakudo-moar e195e5: OUTPUT«-3.14d␤»
23:49 MasterDuke m: say sprintf '%3.۳G', -3.1415
23:49 camelia rakudo-moar e195e5: OUTPUT«Directive g not applicable for type Rat␤␤»
23:49 MasterDuke m: say sprintf '%3.3G', -3.1415
23:49 camelia rakudo-moar e195e5: OUTPUT«-3.14␤»
23:50 MasterDuke m: say sprintf '%۳.3G', -3.1415
23:50 camelia rakudo-moar e195e5: OUTPUT«This representation (Null) does not support elems (for type VMNull)␤␤»
23:52 MasterDuke .ask TimToady do you have an opinion on Nd's in sprintf format strings? e.g., https://irclog.perlgeek.de/perl6-dev/2017-01-22#i_13970314. should they be made to work?
23:52 yoleaux2 MasterDuke: I'll pass your message to TimToady.
23:52 MasterDuke .ask jnthn do you have an opinion on Nd's in sprintf format strings? e.g., https://irclog.perlgeek.de/perl6-dev/2017-01-22#i_13970314. should they be made to work?
23:52 yoleaux2 MasterDuke: I'll pass your message to jnthn.
23:52 MasterDuke .ask lizmat do you have an opinion on Nd's in sprintf format strings? e.g., https://irclog.perlgeek.de/perl6-dev/2017-01-22#i_13970314. should they be made to work?
23:52 yoleaux2 MasterDuke: I'll pass your message to lizmat.
23:52 MasterDuke .ask samcv do you have an opinion on Nd's in sprintf format strings? e.g., https://irclog.perlgeek.de/perl6-dev/2017-01-22#i_13970314. should they be made to work?
23:52 yoleaux2 MasterDuke: I'll pass your message to samcv.
23:53 MasterDuke .ask bartolin do you have an opinion on Nd's in sprintf format strings? e.g., https://irclog.perlgeek.de/perl6-dev/2017-01-22#i_13970314. should they be made to work?
23:53 yoleaux2 MasterDuke: I'll pass your message to bartolin.
23:54 samcv MasterDuke, that would be cool
23:54 yoleaux2 23:52Z <MasterDuke> samcv: do you have an opinion on Nd's in sprintf format strings? e.g., https://irclog.perlgeek.de/perl6-dev/2017-01-22#i_13970314. should they be made to work?
23:55 samcv let me poke a few things and see if I have any other comments

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