Perl 6 - the future is here, just unevenly distributed

IRC log for #p6dev, 2016-03-27

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

All times shown according to UTC.

Time Nick Message
01:09 skids joined #p6dev
01:09 AlexDaniel joined #p6dev
01:35 AlexDani` joined #p6dev
01:47 ilbot3 joined #p6dev
01:47 Topic for #p6dev is now Perl 6 language and compiler development
03:54 geekosaur joined #p6dev
05:29 geekosaur joined #p6dev
05:31 geekosaur joined #p6dev
08:54 masak yep -- shortest day of the year!
08:54 * masak .oO( leap hour )
09:11 RabidGravy joined #p6dev
09:33 dalek joined #p6dev
10:19 [Tux] test            22.338
10:19 [Tux] test-t          12.827
10:19 [Tux] csv-parser      26.899
10:59 FROGGS joined #p6dev
12:25 vendethiel joined #p6dev
12:56 RabidGravy joined #p6dev
13:44 lizmat m: say "foo99".succ   # sort of unexpected, but logical
13:44 camelia rakudo-moar 47d21b: OUTPUT«fop00␤»
13:44 lizmat m: say "foo.99".succ   # sort of expected to see "foo.100"
13:44 camelia rakudo-moar 47d21b: OUTPUT«fop.99␤»
13:45 lizmat ^^ feels like a bug to me, opinions ??     I mean, it should probably be "fop.00" if we're just ignoring non-magical chars
13:50 masak m: say "foo-99".succ # hyphen behaves differently from dot -- why?
13:50 camelia rakudo-moar 47d21b: OUTPUT«foo-100␤»
13:51 masak currently I see no arguments either for changing or keeping the current behavior.
13:51 masak though I confess to being wary of this type of magic
13:51 lizmat masak: there's an explicit check for "." somewhere in there
13:51 masak I would probably not rely on it in production -- I'd write something slightly longer but clearer :)
13:52 masak lizmat: could be that "." figures in numbers, perhaps? I dunno.
13:55 vendethiel no, it's here explicitly for this, AFAIK:
13:55 vendethiel m: say "file99.ext".succ;
13:55 camelia rakudo-moar 47d21b: OUTPUT«filf00.ext␤»
13:55 lizmat the check for "." was part of pmichaud's original implementation in ffb46dcfc0057475ed5
13:55 vendethiel m: say "file99-ext".succ;
13:55 camelia rakudo-moar 47d21b: OUTPUT«file99-exu␤»
13:55 vendethiel ^ masak
13:56 lizmat this feels more like an implementation of IO::Path.succ
13:57 masak I can see that argument, yes
13:57 masak that's kind of why we have types ;)
13:58 Ven joined #p6dev
13:58 masak m: say "file-99.ext".succ # saner example
13:58 camelia rakudo-moar 47d21b: OUTPUT«file-100.ext␤»
13:58 Ven I'd argue it's **very** surprising how the "add-another-char" behavior is :o
14:01 lizmat m: say "9".succ   # really surprising ??
14:01 camelia rakudo-moar 47d21b: OUTPUT«10␤»
14:02 Ven m: say "file99.ext".succ;
14:02 camelia rakudo-moar 47d21b: OUTPUT«filf00.ext␤»
14:02 Ven instead of prepending a "1", it changed "e" (from file) to "f"
14:03 Ven lizmat: ^ that I consider surprising..
14:03 masak that's a p5 thing, though
14:03 masak m: say "f9".succ
14:03 camelia rakudo-moar 47d21b: OUTPUT«g0␤»
14:03 lizmat ah, yes, that, well, it's logical in a way, since the "e" is a magical char as far as .succ is concerned
14:03 masak easier to see when the letter is not a word...
14:04 lizmat m: say "z".succ
14:04 camelia rakudo-moar 47d21b: OUTPUT«aa␤»
14:04 lizmat m: say "aa".pred
14:04 camelia rakudo-moar 47d21b: OUTPUT«Decrement out of range␤  in block <unit> at /tmp/8PoC91TM1y line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/8PoC91TM1y line 1␤␤»
14:04 masak $ perl -E 'my $s = "f9"; $s++; say $s'
14:04 masak g0
14:04 lizmat huh?
14:04 masak lizmat: ¿huh
14:04 lizmat "aa" doesn't have a pred ?
14:04 masak I remember us adding that error
14:05 Ven m: say "99".succ
14:05 camelia rakudo-moar 47d21b: OUTPUT«100␤»
14:05 Ven heh.
14:05 masak m: say "100".pred
14:05 camelia rakudo-moar 47d21b: OUTPUT«099␤»
14:05 lizmat $ perl -E 'my $a = "aa"; say $a--; say $a'
14:05 lizmat aa
14:05 lizmat -1
14:05 lizmat weird
14:06 masak hm, actually, I'm wrong
14:06 masak it wasn't added
14:06 masak it's from the *original* 2011 implementation by pmichaud++
14:06 lizmat yeah..
14:06 masak a comment says
14:06 masak # cannot carry beyond first rangechar position
14:06 masak which I think is fair
14:07 lizmat but if "z".succ is "aa", shouldn't "aa".pred be "z" ?
14:07 masak my brain insists (vaguely) that there was some very good reason not to do that
14:07 masak but I don't have a reference, sorry
14:07 masak maybe it was some discussion on IRC or p6l
14:08 lizmat well, it definitely simplifies matters  :-)
14:08 masak it's easy to rationalize why it shouldn't work
14:08 masak namely, strings aren't numbers, and you can't increment them
14:08 masak we try to pretend that they are and that you can
14:08 masak to a point, after which it turns untenable. then we throw an exception
14:09 masak also, due to the way ranges work, I'd think that .succ is way more common than .pred
14:09 lizmat true
14:09 masak so maybe it could be argued that "aa".pred is much more indicative of mistake/confusion than "z".succ
14:09 masak language design is tricky :)
14:10 * masak .oO( let's go shopping )
14:25 lizmat it feels that I'm getting close to 6.c.1 or 6.d territory
14:26 dalek rakudo/nom: d0c675c | lizmat++ | tools/build/makeMAGIC_INC_DEC.pl6:
14:26 dalek rakudo/nom: Some more WIP on succ/pred data structure generating
14:26 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/d0c675cd33
15:00 * TimToady wonders why this sudden urge to redesign all the things...
15:01 jnthn .succ/.pred are methods, so can't really be handled by language versioning
15:01 TimToady the '.' exception was quite intentional from the start
15:01 jnthn I'm pretty sure I have code that relies on the . special case even :)
15:01 jnthn So yeah, we won't change that.
15:02 jnthn I'd be surprised if it's not test-covered
15:02 TimToady I'd be surprised if it's not explicitly specced
15:02 jnthn That too ;)
15:04 * jnthn isn't sure whether the backlog was actually proposing changes or just exploring what exactly is going on... :)
15:10 lizmat I was looking at fixing the "z" .. "ab" issue
15:10 lizmat dinner&
15:11 jnthn m: say "z" .. "ab"
15:11 camelia rakudo-moar d0c675: OUTPUT«"z".."ab"␤»
15:11 jnthn m: say list "z" .. "ab"
15:11 camelia rakudo-moar d0c675: OUTPUT«()␤»
16:36 vendethiel joined #p6dev
16:58 masak I hope I will never need the correct behavior of "z" .. "ab" in any of my future code :P
17:10 skids joined #p6dev
17:29 vendethiel joined #p6dev
18:33 lizmat the more I dig into this, the more I think Str ranges should only allow single char strings
18:34 * lizmat is going to check out what Batman has against Superman
18:34 lizmat so afk for a few hours&
22:23 lizmat well, that was a lot of WAT!
22:24 lizmat good night, #p6dev!
22:24 jnthn .oO( Don't worry, the sequel will DWIM to make up for it... )
22:42 RabidGravy Ooh didn't do my weekly "test all the things" run
22:42 RabidGravy tomorrow
23:20 vendethiel joined #p6dev

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