Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-02-12

Perl 6 | Reference Documentation | Rakudo | Niecza | Specs

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

All times shown according to UTC.

Time Nick Message
00:06 atweiden joined #perl6
00:11 maybekoo5 joined #perl6
00:11 prammer_ joined #perl6
00:11 olinkl_ joined #perl6
00:14 AlexDani` joined #perl6
00:14 molaf_ joined #perl6
00:15 SmokeMachine____ joined #perl6
00:15 MadcapJake I haven't made a slideshow in years, should I be doing 16:9 or 4:3?
00:15 xinming joined #perl6
00:16 mrsolo joined #perl6
00:16 MadcapJake 16:9 probably, (weird that LibreOffice still defaults to 4:3 at this point...)
00:19 nekrodesk joined #perl6
00:21 nekrodesk joined #perl6
00:28 M-eternaleye joined #perl6
00:32 nekrodesk joined #perl6
00:36 wamba joined #perl6
00:37 M-matthew joined #perl6
00:37 M-Illandan joined #perl6
00:37 AlexDani` joined #perl6
00:43 idiosyncrat_ joined #perl6
00:49 Actualeyes joined #perl6
01:10 apiw joined #perl6
01:14 b2gills sortiz: If you want to see what I was talking about earlier https://github.com/perl6/roast/pull/104 my be able to shine a light on it.
01:22 sortiz b2gills, thank you. I'll comment there.
01:43 apiw joined #perl6
01:43 wamba joined #perl6
01:54 addison_ joined #perl6
02:09 mr-foobar joined #perl6
02:09 cognominal joined #perl6
02:18 addison_ joined #perl6
02:22 dalek doc: ff69616 | (Shlomi Fish)++ | doc/Language/5to6-nutshell.pod:
02:22 dalek doc: Add the equivalent of backticks - capture stdout.
02:22 dalek doc: review: https://github.com/perl6/doc/commit/ff69616acf
02:22 dalek doc: e0c27d6 | (Shlomi Fish)++ | doc/Language/5to6-nutshell.pod:
02:22 dalek doc: Add equivalent to each
02:22 dalek doc: review: https://github.com/perl6/doc/commit/e0c27d6d81
02:22 dalek doc: 18da27a | (Shlomi Fish)++ | doc/Language/5to6-nutshell.pod:
02:22 dalek doc: Revise the qqx section.
02:22 dalek doc:
02:22 dalek doc: Thanks to @AlexDaniel 's comment on the pull-req.
02:22 dalek doc: review: https://github.com/perl6/doc/commit/18da27a987
02:22 dalek doc: 81552ba | (Aleks-Daniel Jakimenko-Aleksejev)++ | doc/Language/5to6-nutshell.pod:
02:22 dalek doc: Merge pull request #387 from shlomif/shlomif--enhance-5to6
02:22 dalek doc:
02:22 dalek doc: Enhance the 5-to-6 documents .
02:22 dalek doc: review: https://github.com/perl6/doc/commit/81552ba5e2
02:26 molaf__ joined #perl6
02:57 Xor_ joined #perl6
02:57 Hotkeys is there something similar to smartmatch for regex that will return a boolean rather than me doing so $x ~~ $pattern'
02:58 Hotkeys er
02:58 Hotkeys quote before 'so' too
02:59 llfourn Hotkeys: don't think so
02:59 apiw joined #perl6
02:59 Hotkeys darn
03:00 llfourn m: $_ = 'abc'; say /ab/.so # well there's this
03:00 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
03:01 llfourn Hotkeys: ^
03:01 Hotkeys weird
03:03 apiw joined #perl6
03:05 AlexDaniel m: $_ = ‘abc’; say ?m/ab/
03:05 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
03:05 AlexDaniel Hotkeys: ↑
03:05 AlexDaniel golfing again?
03:05 Hotkeys yeah
03:05 AlexDaniel 1 symbol is probably as short as it could get
03:05 Hotkeys I need it for two positionals though
03:06 Hotkeys so $_ is a no-go
03:06 Juerd m: "foo" ~~ /oo/ . Bool
03:06 camelia rakudo-moar 72dbb3: ( no output )
03:06 Hotkeys I'll have to stick with so
03:06 Juerd m: say("foo" ~~ /oo/ . Bool)
03:06 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
03:06 llfourn Hotkeys: what's wrong with match objects in this case?
03:06 Juerd Hotkeys: ? is shorter than so :)
03:06 AlexDaniel m: say ?(‘abc’~~?m/ab/)
03:06 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
03:07 Juerd ?() is longer than so :)
03:07 AlexDaniel m: say so ‘abc’~~?m/ab/
03:07 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
03:07 AlexDaniel same length
03:07 AlexDaniel ahhh
03:07 AlexDaniel no
03:07 AlexDaniel m: say so‘abc’~~?m/ab/
03:07 Juerd What's ~~? :)
03:07 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
03:07 AlexDaniel didn't know you can omit space after so…
03:07 AlexDaniel Juerd: smartmatch
03:07 llfourn m: say &infix:<~~?> # I don't think it's a thing
03:07 camelia rakudo-moar 72dbb3: OUTPUT«5===SORRY!5=== Error while compiling /tmp/eKLy48ucXx␤Undeclared routine:␤    infix:<~~?> used at line 1. Did you mean 'infix:<~|>', 'infix:<∖>', 'infix:<lt>'?␤␤»
03:07 Juerd m: say "misleading" ~~? "nope"
03:07 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
03:07 AlexDaniel whoah
03:08 AlexDaniel I didn't notice it
03:08 Juerd AlexDaniel: No, you're actually doing FOO ~~ ?BAR
03:08 AlexDaniel yeah didn't notice it
03:08 Juerd $anything ~~ True is true.
03:08 AlexDaniel hey, but it works
03:08 AlexDaniel m: say ‘abc’~~?m/abc/
03:08 Juerd "works" :)
03:08 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
03:08 AlexDaniel m: say ‘abc’~~?m/abd/
03:08 camelia rakudo-moar 72dbb3: OUTPUT«False␤»
03:08 llfourn it does?
03:08 AlexDaniel yup
03:08 llfourn so ~~ sets $_?
03:09 AlexDaniel m: say ‘abc’~~?m/abd{say $_}/
03:09 camelia rakudo-moar 72dbb3: OUTPUT«False␤»
03:09 konobi are there any "large" projects using perl6 yet at all?
03:09 AlexDaniel m: say ‘abc’~~?m/{say $_}abd/
03:09 camelia rakudo-moar 72dbb3: OUTPUT«abc␤abc␤abc␤abc␤False␤»
03:09 llfourn AlexDaniel: cool
03:09 Juerd konobi: That's not very likely
03:09 AlexDaniel konobi: depends on what you mean by “large”
03:09 llfourn I am building a large project in Perl 6. Not public yet though.
03:09 Hotkeys this the golf fn I have
03:10 Hotkeys m: my &f = {so$^a~$^b~~m:i/^[2|t0|t[w|o]?o][b[ee?|3]?]$/}; say f("2", "bee")
03:10 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
03:10 Hotkeys etc.
03:10 AlexDaniel Holy sh!
03:10 noganex_ joined #perl6
03:10 Juerd konobi: Or, well, since much of Perl 6 is written in Perl 6, and since Perl 6 is a large project: yep, there is! :)
03:10 konobi AlexDaniel: a good hierarchy
03:10 Hotkeys http://codegolf.stackexchange.com/questi​ons/71698/to-be-or-not-to-be/71793#71793
03:10 AlexDaniel ok, let's see :)
03:10 konobi Juerd: =0P
03:10 Hotkeys that's why I can't use $_
03:11 Hotkeys I don't know if my regex is as minimal as can be there
03:11 Hotkeys oh
03:11 Hotkeys I can get rid of the group on the right
03:11 konobi AlexDaniel: i think i have a project idea that would really show off perl6 features... but trying to see if there's another that's a good example already
03:11 Juerd What's with this "bytes" thing?
03:12 Juerd Seems horribly antique
03:12 AlexDaniel konobi: I'd say just go with it if it makes sense
03:12 Hotkeys blame stack exchange
03:12 llfourn konobi: what's it do?
03:12 Hotkeys or actually
03:12 Hotkeys shoot
03:12 Hotkeys this doesn't work
03:12 AlexDaniel konobi: who knows, maybe somebody else will come with the same question and we will show off your project :)
03:12 konobi AlexDaniel: thinking a nix replacement
03:12 Hotkeys I'm a goof
03:12 llfourn what's a nix?
03:12 konobi mst and I have been throwing it back and forth for a while
03:13 AlexDaniel Hotkeys: yeah, just replace so with ~~?
03:13 AlexDaniel Hotkeys: and you'll save one character
03:13 konobi llfourn: https://nixos.org/nix/
03:13 Hotkeys hm?
03:13 AlexDaniel m: my &f = {$^a~$^b~~?m:i/^[2|t0|t[w|o]?o][b[ee?|3]?]$/}; say f("2", "beez")
03:13 camelia rakudo-moar 72dbb3: OUTPUT«False␤»
03:13 AlexDaniel m: my &f = {$^a~$^b~~?m:i/^[2|t0|t[w|o]?o][b[ee?|3]?]$/}; say f("2", "bee")
03:13 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
03:13 Hotkeys This regex is bad
03:13 Hotkeys I need to change it
03:13 * llfourn checks it out
03:13 AlexDaniel I have no idea why that works but don't ask
03:13 Hotkeys m: my &f = {so$^a~$^b~~m:i/^[2|t0|t[w|o]?o][b[ee?|3]?]$/}; say f("2b", "ee")
03:13 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
03:13 Hotkeys see
03:14 Hotkeys I need to separate them
03:14 Hotkeys comma or something
03:14 Juerd t[w|o]?o is just obfuscation... too?|two is just as long.
03:14 Hotkeys hm
03:14 Hotkeys well this is golf
03:14 Hotkeys so it can stay
03:15 konobi llfourn: make sense?
03:15 Juerd Obfuscation isn't golf :)
03:15 Hotkeys m: {"$^a,$^b"~~?m:i/^[2|t0|t[w|o]?​o]\,b[ee?|3]?$/}("2","Bee").say
03:15 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
03:15 Juerd Making shorter is
03:15 Hotkeys m: {"$^a,$^b"~~?m:i/^[2|t0|t[w|o]?​o]\,b[ee?|3]?$/}("2B","ee").say
03:15 camelia rakudo-moar 72dbb3: OUTPUT«False␤»
03:15 Hotkeys there
03:15 llfourn konobi: still absorbing gimmie a min :)
03:15 Hotkeys m: {"$^ax$^b"~~?m:i/^[2|t0|t[w|o]?​o]xb[ee?|3]?$/}("2B","ee").say
03:15 camelia rakudo-moar 72dbb3: OUTPUT«False␤»
03:16 Hotkeys m: {"$^ax$^b"~~?m:i/^[2|t0|t[w|o]?​o]xb[ee?|3]?$/}("2","Bee").say
03:16 camelia rakudo-moar 72dbb3: OUTPUT«False␤»
03:16 konobi Juerd: could be up your street too
03:16 Hotkeys m: {"$^a=$^b"~~?m:i/^[2|t0|t[w|o]?​o]=b[ee?|3]?$/}("2","Bee").say
03:16 camelia rakudo-moar 72dbb3: OUTPUT«5===SORRY!5===␤Unrecognized regex metacharacter = (must be quoted to match literally)␤at /tmp/EJLlcgHD2E:1␤------> 3{"$^a=$^b"~~?m:i/^[2|t0|t[w|o]?o]7⏏5​=b[ee?|3]?$/}("2","Bee").say␤Couldn't find terminator / (corresponding / was at line 1…»
03:16 Hotkeys hmm
03:16 Hotkeys trying to not have to use an escape in there
03:16 Juerd konobi: I don't understand.
03:17 Juerd Hotkeys: _
03:17 Hotkeys m: {"$^a,$^b"~~?m:i/^[2|t0|t[w|o]?​o]\,b[ee?|3]?$/}("2B","ee").say
03:17 camelia rakudo-moar 72dbb3: OUTPUT«False␤»
03:17 Hotkeys oops
03:17 Hotkeys didn't mean to do that
03:17 Hotkeys m: {"$^a_$^b"~~?m:i/^[2|t0|t[w|o]?​o]_b[ee?|3]?$/}("2B","ee").say
03:17 camelia rakudo-moar 72dbb3: OUTPUT«False␤»
03:17 konobi Juerd: it's a fully declarative package manager
03:17 Hotkeys m: {"$^a_$^b"~~?m:i/^[2|t0|t[w|o]?​o]_b[ee?|3]?$/}("2","Bee").say
03:17 camelia rakudo-moar 72dbb3: OUTPUT«False␤»
03:17 Juerd _ is the only non-alphanumeric ascii that doesn't need escaping, iirc
03:18 konobi with guarantees of versioning, etc.
03:18 AlexDaniel what about - and '?
03:18 Hotkeys I think it is being interpolated as part of the var name
03:18 Juerd konobi: What is?
03:18 Hotkeys in that string
03:18 konobi Juerd: nix
03:18 Juerd That's confusing. "Nix" sounds like "niks", which is Dutch for "nothing".
03:18 konobi but it has it's issues... but i think perl6 would excel at fixing em
03:18 llfourn konobi: it looks interesting. I am actually building something not similar but in the same realm. I'm making a cfg language.
03:19 AlexDaniel Hotkeys: once you smashed it into one string I don't think that there is a way out
03:19 konobi llfourn: oh nice! yeah... there's an aspect of that too
03:19 Hotkeys true
03:20 AlexDaniel Hotkeys: you need this
03:20 AlexDaniel m: say so (‘hello’, ‘world’) ~~ (/‘hello’/, /‘world’/)
03:20 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
03:20 AlexDaniel m: say so (‘hello’, ‘world’) ~~ (/‘hallo’/, /‘world’/)
03:20 camelia rakudo-moar 72dbb3: OUTPUT«False␤»
03:20 llfourn konobi: I should have something up in the next week or two will appreciate your feedback :)
03:20 Hotkeys hmm
03:20 konobi llfourn: mst would have an interest too i think
03:21 llfourn Awesome. It needs some input from ppl with a lot of unix knowledge.
03:21 Juerd Hotkeys: "@_[]" and \s
03:21 llfourn it's essentially a glorified shell script transpiler designed for curl | sh usage
03:22 llfourn so you write shell scripts in Perl 6 basically
03:22 konobi Juerd: nix gives you a verifiabily reproduceable system based on declarative configs
03:22 Juerd konobi: That's nice.
03:23 konobi and they have a nixos linux distro
03:23 Hotkeys m: {($^a,$^b) ~~ (/^[2|t0|t[w|o]?o]$/,/^b[ee?|3]?$/)}("2", "bee")
03:23 camelia rakudo-moar 72dbb3: ( no output )
03:23 Juerd Hotkeys: Ooh, ~@_ even
03:23 Hotkeys m: {($^a,$^b) ~~ (/^[2|t0|t[w|o]?o]$/,/^b[ee?|3]?$/)}("2", "bee").say
03:23 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
03:23 Hotkeys Juerd: fancy
03:24 AlexDaniel konobi: what I can say is that if you're building something big then expect to report a few bugs. It's not too bad, with a 50% chance your bug will be fixed very quickly :) but just don't expect it to go too smoothly
03:24 Hotkeys m: {~@_ ~~ ?m:i/^[2|t0|t[w|o]?o]\sb[ee?|3]?$/}("2", "bee").say
03:24 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
03:24 Hotkeys m: {~@_ ~~ ?m:i/^[2|t0|t[w|o]?o]\sb[ee?|3]?$/}("2", "Bee").say
03:24 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
03:24 Hotkeys m: {~@_ ~~ ?m:i/^[2|t0|t[w|o]?o]\sb[ee?|3]?$/}("2B", "Bee").say
03:24 camelia rakudo-moar 72dbb3: OUTPUT«False␤»
03:24 Hotkeys Juerd++
03:24 Hotkeys m: {~@_~~?m:i/^[2|t0|t[w|o]?o]\sb[ee?|3]?$/}("2B", "Bee").say
03:24 camelia rakudo-moar 72dbb3: OUTPUT«False␤»
03:24 AlexDaniel Hotkeys: so what about making it right??
03:24 Hotkeys m: {~@_~~?m:i/^[2|t0|t[w|o]?o]\sb[ee?|3]?$/}("2", "Bee").say
03:24 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
03:24 Hotkeys AlexDaniel: hm?
03:25 Hotkeys m: {~@_~~?m:i/^[2|t0|too|two?]\sb[ee?|3]?$/}("2", "Bee").say # less obfuscated
03:25 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
03:25 konobi AlexDaniel: heh... perl6 doesn't scare me... more interested in a way to really use the new functionality... roles feature heavily in my head
03:25 Juerd Hotkeys: too|two? looks wrong. ITYM too?|two
03:26 Hotkeys oops you're right
03:26 Hotkeys m: {~@_~~?m:i/^[2|t0|too?|two]\sb[ee?|3]?$/}("2", "Bee").say # less obfuscated
03:26 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
03:26 Hotkeys I inserted the |two in the wrong place
03:26 Juerd Darn, t[0|oo?|wo] isn't shorter :)
03:26 Hotkeys shh
03:26 Hotkeys er
03:26 Hotkeys darn
03:27 AlexDaniel m: {so@_~~(/:i^[2|t0|t[w|o]?o]$/,/:i^b[ee?|3]?$/)}("2", "Bee").say
03:27 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
03:27 AlexDaniel Hotkeys: ↑
03:27 Hotkeys oh
03:27 AlexDaniel and yeah, I just shove off 2 chars just by getting :i in
03:27 Hotkeys you see I couldn't get the adverbs to work when I tried it
03:27 Hotkeys when I did m:i with that
03:27 AlexDaniel yup because that's not how it works :)
03:27 Hotkeys well it should
03:28 AlexDaniel nope? Here we are smartmatching on a list of regexes
03:28 Hotkeys you actually don't need so with that
03:28 Hotkeys btw
03:28 AlexDaniel ooh right
03:28 Juerd Oh, heh, the ~ in front of @_ isn't even needed :)
03:28 Hotkeys m: {@_~~(/:i^[2|t0|t[w|o]?o]$/,/:i^b[ee?|3]?$/)}("2", "Bee").say
03:28 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
03:28 AlexDaniel Juerd: ~ makes it wrong.
03:28 Hotkeys what do you mean wrong
03:28 Juerd AlexDaniel: Not if you match one thing, and use \s
03:28 AlexDaniel Juerd: ("2 Bee", "")
03:28 AlexDaniel Hotkeys: ↑
03:29 Juerd Hm. True.
03:29 AlexDaniel just use a list of regexes. It works this way
03:29 Hotkeys m: {~@_~~?m:i/^[2|t0|too?|two]\sb[ee?|3]?$/}("2 Bee". "").say # less obfuscated
03:29 camelia rakudo-moar 72dbb3: OUTPUT«5===SORRY!5=== Error while compiling /tmp/78iKHh3FVn␤Unsupported use of . to concatenate strings; in Perl 6 please use ~␤at /tmp/78iKHh3FVn:1␤------> 3/^[2|t0|too?|two]\sb[ee?|3]?$/}("2 Bee".7⏏5 "").say # less obfuscated␤»
03:29 Hotkeys beat
03:29 Hotkeys neat
03:29 konobi AlexDaniel: it's also a good excuse to get up to date on perl6
03:29 AlexDaniel konobi: :)
03:30 colomon joined #perl6
03:30 konobi has been quite a while since i was added to pugs =0)
03:31 Juerd AlexDaniel: @_~~/foo/,/bar/ ends up with ($something, /bar/), though.
03:31 mohae joined #perl6
03:31 AlexDaniel Juerd: yup, you need parens
03:31 Juerd Meh
03:31 Juerd I like the wrong version better :)
03:32 AlexDaniel it's wrong >:(
03:32 AlexDaniel and honestly, the right version is not very longer
03:32 Hotkeys nope
03:32 Hotkeys it's actually very competitive
03:32 Hotkeys even with the golf langs
03:32 Hotkeys thank regex for that
03:33 Juerd But parens :(
03:33 AlexDaniel Juerd: yeah yeah, I know!
03:34 Hotkeys darn
03:34 Hotkeys 1 byte more than the javascript answer
03:34 konobi AlexDaniel, llfourn: i think it's also an interesting thought exercise... what's the best way to model "packaging" and "software"
03:35 AlexDaniel Hotkeys: I think I can fix that
03:35 Hotkeys er actually
03:35 Hotkeys the javascript one doesn't look correct
03:35 Hotkeys "(a,b)=>/^(2|t[ow]?o|t0)b(3|e?e)?$/.test(a+b)"
03:36 Hotkeys that would have the same problem as my string mashing one no?
03:36 Juerd Worse
03:36 Hotkeys I don't know how to test a JS lambda
03:36 AlexDaniel m: {@_~~(/:i^[2|t0|two|to?o]$/,/:i^be?e?|3$/)}("2", "Bee").say
03:36 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
03:36 AlexDaniel Hotkeys: I think that this is 2 chars shorter
03:36 AlexDaniel Hotkeys: please verify
03:37 Hotkeys yep
03:37 Juerd Hotkeys: Test with (() => ...)(args)
03:37 mr-foobar joined #perl6
03:37 llfourn konobi: I think you don't. Just start with a blank VM/container each time and write tests to make sure it got where it needs to be.
03:37 AlexDaniel OH
03:37 Juerd Hotkeys: Or var x = () => ...; x(args)
03:37 AlexDaniel m: {@_~~(/:i^2|t0|two|to?o$/,/:i^be?e?|3$/)}("2", "Bee").say
03:37 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
03:38 AlexDaniel ok we're getting closer to 0 bytes
03:38 Hotkeys are you sure that works
03:38 AlexDaniel Hotkeys: test it
03:38 Hotkeys my first try was without that group
03:38 Juerd AlexDaniel: It should test for b3, not 3
03:38 AlexDaniel Hotkeys: sure enough, but you had everything smashed together
03:38 Hotkeys m: {@_~~(/:i^2|t0|two|to?o$/,/:i^be?e?|3$/)}("2to", "Bee").say
03:38 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
03:39 Hotkeys it lumps the $ in the | bit
03:39 AlexDaniel m: {@_~~(/:i^[2|t0|two|to?o]$​/,/:i^b[e?e?3]$/)}("too", "b3").say
03:39 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
03:40 AlexDaniel Hotkeys: oh really? Dammit!
03:40 AlexDaniel indeed
03:40 llfourn m: say 'a','b' ~~ (/a/,/b/) # didn't know this worked
03:40 camelia rakudo-moar 72dbb3: OUTPUT«aFalse␤»
03:40 AlexDaniel m: {@_~~(/:i^[2|t0|two|to?o]$​/,/:i^b[e?e?3]$/)}("too", "bee3").say # WRONG!
03:40 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
03:40 Hotkeys it needs the ? on the be group too
03:40 llfourn m: say ('a','b') ~~ (/a/,/b/) # didn't know this worked
03:40 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
03:40 Hotkeys cause it can test for b
03:40 AlexDaniel Hotkeys: ok then I don't know
03:40 konobi llfourn: well no... there's a fair amount of thought that needs to go into it
03:40 Hotkeys yeah
03:41 Hotkeys looks like 45 is where it stays
03:41 Hotkeys 45 is good enough
03:41 Hotkeys that JS answer is wrong anyway
03:41 Hotkeys I think
03:41 Hotkeys I still haven't tested
03:41 Juerd Most answers are wrong because of string concat.
03:41 AlexDaniel ↑ point it out in your answer
03:42 Juerd Or reply to the wrong one
03:42 Juerd Off to bed, ciao!
03:43 Hotkeys I replied to the JS one
03:44 AlexDaniel xD
03:44 AlexDaniel Hotkeys: I have a gut feeling that this could be shorter
03:44 AlexDaniel let's see…
03:44 Hotkeys maybe
03:45 Hotkeys m: {**~~(/:i^[2|t0|two|to?o]$​/,/:i^b[e?e?3]$/)}("too", "bee").say
03:45 camelia rakudo-moar 72dbb3: OUTPUT«Too many positionals passed; expected 0 or 1 arguments but got 2␤  in block <unit> at /tmp/_nLh0dl4V0 line 1␤␤»
03:45 Hotkeys darn
03:45 Hotkeys m: {** ~~(/:i^[2|t0|two|to?o]$/,/:i^b[e?e?3]$/)}("too", "bee").say
03:45 camelia rakudo-moar 72dbb3: OUTPUT«Too many positionals passed; expected 0 or 1 arguments but got 2␤  in block <unit> at /tmp/QmskbJCkLj line 1␤␤»
03:45 Hotkeys thought I'd be cheeky
03:46 flussence m: {@_~~(~2|/:i^t[0|wo|o?o]$/,/:i^b[e?e?3]$/)}("too", "b3").say
03:46 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
03:46 konobi llfourn: i mean, perl6 took a while to get into shape =0)
03:47 japhb joined #perl6
03:47 llfourn konobi: What I meant was I try to avoid issues with package versions by as much as possible by locking them down in docker and writing tests.
03:48 llfourn I never do apt-get updgrade etc
03:48 llfourn or try and model anything
03:48 llfourn but I am mostly developing software for myself no idea what it's like in enterprise :P
03:48 AlexDaniel Hotkeys: why are we doing this with regexes???
03:49 Hotkeys idk
03:49 Hotkeys everyone else was
03:49 Hotkeys I got tunnel vision
03:49 Hotkeys >_>
03:49 konobi llfourn: docker doesn't give you that.
03:49 llfourn give what?
03:50 atweiden konobi: yes on nix replacemen
03:50 atweiden something more like guix except in p6?
03:51 Hotkeys regex seems like it'd be the shortest, but then again I'm a bit tired
03:51 AlexDaniel m: {@_~~(any(<to too two t0 2>), any(<b be bee b3>))}("too", "b3").say
03:51 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
03:51 AlexDaniel honestly that is not much longer
03:51 konobi atweiden: well... still trying to work it out... mst too
03:52 AlexDaniel Hotkeys: perhaps list that as an alternative non-golfy variant
03:52 AlexDaniel Hotkeys: because hey, that's just some regular code
03:53 konobi atweiden: things like being able to apply a role to a package like "build::cmake" or "build::automake" or "build::gem" or "build::npm", etc.
03:53 atweiden sounds like guix
03:53 ugexe see %?RESOURCE build-time in s22
03:53 atweiden i really like the idea of replacing guile scheme with p6 though
03:54 AlexDaniel Hotkeys: -1 character if you remove parens in the second 「any」
03:54 Juerd m: {@_~~any(<t0 to too two 2>X,<b be bee b3>)}("2", "b3")
03:54 camelia rakudo-moar 72dbb3: ( no output )
03:54 Juerd m: {@_~~any(<t0 to too two 2>X,<b be bee b3>)}("2", "b3").say
03:54 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
03:54 Juerd Couldn't resist.
03:55 mspo Juerd: case insensitive
03:55 Juerd It throws an exception instead of returning false, when invalid values are given, though
03:55 Juerd Oh, case :(
03:55 Juerd Regexes then :P
03:55 Hotkeys m: {@_~~(any(<to too two t0 2>), any(<b be bee b3>))}("too", "B3").say
03:55 camelia rakudo-moar 72dbb3: OUTPUT«False␤»
03:55 Hotkeys AlexDaniel:
03:55 konobi atweiden: not too familiar with guix... that's a fsf thing, right?
03:55 AlexDaniel nooooooo case sensitivity!!
03:55 Juerd @_>>.lc is *long*
03:56 Hotkeys I was just about to add it to my post too
03:56 Juerd (Don't go for @_».lc because that's more bytes :P)
03:56 AlexDaniel m: {@_».lc~~(any(<to too two t0 2>), any <b be bee b3>)}("too", "B3").say
03:56 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
03:56 Hotkeys it's the same amount of bytes actually
03:56 Juerd Is it?
03:56 Juerd Oh, it is
03:56 flussence m: '»'.encode('windows-1252').bytes.say # :)
03:56 camelia rakudo-moar 72dbb3: OUTPUT«1␤»
03:56 Hotkeys AlexDaniel: I'll include that one
03:56 AlexDaniel flussence: oh come on
03:56 Hotkeys flussence: heh
03:57 konobi oh!
03:57 AlexDaniel flussence: don't bring your cave things here please :D
03:57 Hotkeys m: '»'.encode('C-1252').bytes.say # :)
03:57 camelia rakudo-moar 72dbb3: OUTPUT«Unknown string encoding: 'c-1252'␤  in block <unit> at /tmp/7jdaiot_4c line 1␤␤»
03:57 Hotkeys er
03:57 Hotkeys there's one that this other golf lang uses
03:57 flussence well if html5 says that's the default, why not...
03:57 konobi anyone know of any good articles on using perl6 for data analytics?
03:57 Juerd {@_».lc~~any(<t0 to too two 2>X,<b be bee b3>)} is shorter but I don't get why it errors on invalid values.
03:57 atweiden konobi: afaik guix wraps the nix pkg manager gnu.org/software/guix/
03:58 konobi ah yeah... i stop at gnu/fsf i'm afraid
03:58 AlexDaniel but I've never liked how all these golf tasks say “hey, in the fewest bytes possible”… bytes of what??
03:58 nekrodesk joined #perl6
03:58 Juerd And with '?try ' in front it's 1 char longer than the any,any
03:58 AlexDaniel if I give them compiled C file is that going to count?
03:59 Hotkeys There's actually a guy that posts with some lang
03:59 AlexDaniel but then oh god, which architecture?
03:59 Hotkeys and specifies "Using blah encoding"
03:59 Juerd Oh, miscounted. It's the same length.
03:59 Juerd m: {?try @_».lc~~any(<t0 to too two 2>X,<b be bee b3>)}("twa", "ba").say
03:59 camelia rakudo-moar 72dbb3: OUTPUT«False␤»
03:59 Juerd m: {?try @_».lc~~any(<t0 to too two 2>X,<b be bee b3>)}("two", "be").say
03:59 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
04:00 Juerd Oh, it doesn't need the ()!
04:00 Hotkeys I'll stick with {@_».lc~~(any(<to too two t0 2>), any(<b be bee b3>))} as the fairly readable non-competing alternative
04:00 Juerd m: {?try @_».lc~~any <t0 to too two 2>X,<b be bee b3>}("two", "be").say
04:00 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
04:00 Juerd Shaved one off :)
04:00 AlexDaniel Hotkeys: don't you want to get it to 53 by removing a space and parens? :)
04:00 Hotkeys Nah
04:00 AlexDaniel fine
04:00 Hotkeys It's non-competing
04:00 Hotkeys it looks nicer with those in
04:00 Hotkeys :p
04:00 Juerd Hotkeys: ^
04:01 Hotkeys actually I'll remove a space
04:01 Hotkeys there it's at 53
04:01 Hotkeys er
04:01 Hotkeys 54
04:01 nekrodesk joined #perl6
04:02 AlexDaniel do we even need “any”?
04:02 Juerd Yes.
04:03 Hotkeys m: {@_».lc~~(<to too two t0 2>,<b be bee b3>)}("too", "B3").say
04:03 camelia rakudo-moar 72dbb3: OUTPUT«False␤»
04:03 Juerd {?try @_>>.lc~~any <t0 to too two 2>X,<b be bee b3>} is 52, isn't it?
04:03 Hotkeys hmm
04:05 AlexDaniel m: {@_».lc~~(<to too two t0 2>.any,<b be bee b3>.any)}("too", "b3").say
04:05 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
04:05 AlexDaniel Hotkeys: ↑ no parens
04:05 Hotkeys yeah Juerd
04:05 Hotkeys nice AlexDaniel
04:05 Juerd I already had a parenless one :)
04:06 Juerd Somehow, a golf without parens feels like earning bonus points
04:06 Juerd Anyhow, I should really get some sleep. Golf is addictive.
04:06 AlexDaniel yeah it is
04:06 AlexDaniel procrastination
04:07 AlexDaniel I just ran some script which is going to take forever to finish… so, I guess I can play with golf for quite some time :)
04:07 AlexDaniel Hotkeys: I am not satisfied. I want it shorter
04:07 Herby_ joined #perl6
04:07 Herby_ Evening, everyone!
04:08 Hotkeys AlexDaniel: I'm working on something
04:08 Hotkeys hold on
04:10 Hotkeys m: {?all @_ Z∈<to too two t0 2>».Str,<b be bee b3>}("2","bee")
04:10 camelia rakudo-moar 72dbb3: ( no output )
04:10 Hotkeys m: {?all @_ Z∈<to too two t0 2>».Str,<b be bee b3>}("2","bee").say
04:10 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
04:10 Hotkeys if you can find a way for me to not have to string the whole first match list
04:10 Hotkeys I would love you forever
04:10 Hotkeys because
04:10 AlexDaniel ooooooooh
04:10 Hotkeys m: <2 to>.perl.say
04:10 camelia rakudo-moar 72dbb3: OUTPUT«(IntStr.new(2, "2"), "to")␤»
04:10 Hotkeys it does that
04:10 Hotkeys which doesn't element
04:11 AlexDaniel m: <to 2>.perl.say
04:11 camelia rakudo-moar 72dbb3: OUTPUT«("to", IntStr.new(2, "2"))␤»
04:11 Hotkeys quite annoying
04:11 AlexDaniel ~« ?
04:11 Hotkeys I did try that
04:11 Hotkeys I think
04:11 azawawi joined #perl6
04:11 Hotkeys m: say ~«<to too two 2 t0>
04:11 camelia rakudo-moar 72dbb3: OUTPUT«(to too two 2 t0)␤»
04:11 Hotkeys m: say ~«<to too two 2 t0>.perl
04:11 camelia rakudo-moar 72dbb3: OUTPUT«(("to", "too", "two", IntStr.new(2, "2"), "t0"))␤»
04:11 Hotkeys m: say (~«<to too two 2 t0>).perl
04:11 camelia rakudo-moar 72dbb3: OUTPUT«("to", "too", "two", IntStr.new(2, "2"), "t0")␤»
04:11 Hotkeys nope
04:11 azawawi hi
04:12 AlexDaniel seems like intstr is still a str
04:12 azawawi http://pasteboard.co/1uqPo9c8.png # Camelia The gray attacks Atom :)
04:12 Hotkeys ∈ is very strict though
04:12 llfourn m: say IntStr ~~ Str
04:12 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
04:12 Hotkeys m: "2" ∈ <2 to>
04:12 camelia rakudo-moar 72dbb3: OUTPUT«WARNINGS for /tmp/kwWL8IoifH:␤Useless use of "∈" in expression "\"2\" ∈ <2 to>" in sink context (line 1)␤»
04:12 Hotkeys m: say "2" ∈ <2 to>
04:12 camelia rakudo-moar 72dbb3: OUTPUT«False␤»
04:12 AlexDaniel m: say "2" ∈ <to 2>
04:12 camelia rakudo-moar 72dbb3: OUTPUT«False␤»
04:12 AlexDaniel m: say 2 ∈ <to 2>
04:12 camelia rakudo-moar 72dbb3: OUTPUT«False␤»
04:13 AlexDaniel m: say "to" ∈ <to 2>
04:13 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
04:13 AlexDaniel isn't it a bug?…
04:13 Hotkeys could be
04:13 llfourn m: say "to" ∈ set(<to 2>)
04:13 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
04:13 llfourn m: say "2" ∈ set(<to 2>)
04:13 camelia rakudo-moar 72dbb3: OUTPUT«False␤»
04:14 llfourn m: say "2".Int ∈ set(<to 2>)
04:14 camelia rakudo-moar 72dbb3: OUTPUT«False␤»
04:14 AlexDaniel “Returns True if $a is an element of $b.”
04:14 AlexDaniel so it's not an element so fuck off? :/
04:14 Hotkeys idk
04:14 Hotkeys m: say <2 to> ∋ "2"
04:14 camelia rakudo-moar 72dbb3: OUTPUT«False␤»
04:14 Hotkeys darn
04:14 llfourn m: <to 2>.map: *.^name..say
04:14 camelia rakudo-moar 72dbb3: OUTPUT«5===SORRY!5===␤Argument to "say" seems to be malformed␤at /tmp/f_hSe984uD:1␤------> 3<to 2>.map: *.^name..say7⏏5<EOL>␤Other potential difficulties:␤    Unsupported use of bare "say"; in Perl 6 please use .say if you meant $_, or use an …»
04:14 llfourn m: <to 2>.map: *.^name.say
04:14 camelia rakudo-moar 72dbb3: OUTPUT«Str␤IntStr␤»
04:15 llfourn m: say "2".IntStr ∈ set(<to 2>)
04:15 camelia rakudo-moar 72dbb3: OUTPUT«Method 'IntStr' not found for invocant of class 'Str'␤  in block <unit> at /tmp/uZuWao4YxI line 1␤␤»
04:15 masak ah, the joys of hybrid types.
04:16 llfourn m: <2>.map: { say "2" ~~ $_ }
04:16 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
04:16 Hotkeys why doesn't qw just do it as a string
04:16 llfourn m: <2>.map: { say .^name; say "2" ~~ $_ }
04:16 camelia rakudo-moar 72dbb3: OUTPUT«IntStr␤True␤»
04:16 Hotkeys m: say qw|2 to| ∋ "2"
04:16 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
04:16 Hotkeys OH
04:16 Hotkeys that's shorter than ».Str
04:17 AlexDaniel Hotkeys: so what's the final variant?
04:17 Hotkeys m: {?all @_ Z∈qw|to too two t0 2|,<b be bee b3>}("2","bee").say
04:17 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
04:17 Hotkeys I don't think there's any more whitespace I can remove
04:17 AlexDaniel remove something else then
04:17 Hotkeys heh
04:18 Hotkeys we're down to 47 bytes
04:18 Hotkeys if I can somehow lose 2 more I'll include it as an alternative
04:18 Juerd Nope. .lc
04:19 Hotkeys oh
04:19 Hotkeys right
04:19 Hotkeys darn
04:19 Hotkeys way to be a buzzkill Juerd
04:19 Juerd Closing laptop now :)
04:19 AlexDaniel Juerd: go get some rest…
04:19 llfourn (Juered still not in bed)
04:19 Hotkeys m: {?all @_».lc Z∈qw|to too two t0 2|,<b be bee b3>}("2","bee").say
04:19 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
04:19 Hotkeys that's another 5
04:19 Hotkeys back to 52
04:20 AlexDaniel ok well we should get rid of ‘all’, it gets in the way
04:20 Hotkeys m: {? @_».lc Z∈qw|to too two t0 2|,<b be bee b3>}("2","bee").say
04:20 camelia rakudo-moar 72dbb3: OUTPUT«(False)␤»
04:20 Hotkeys m: {so @_».lc Z∈qw|to too two t0 2|,<b be bee b3>}("2","bee").say
04:20 camelia rakudo-moar 72dbb3: OUTPUT«(False)␤»
04:20 Hotkeys m: {@_».lc Z∈qw|to too two t0 2|,<b be bee b3>}("2","bee").say
04:20 camelia rakudo-moar 72dbb3: OUTPUT«(True True)␤»
04:21 Hotkeys that's why I had ?all
04:21 Hotkeys hmm
04:21 Hotkeys m: {[&&] @_».lc Z∈qw|to too two t0 2|,<b be bee b3>}("2","bee").say
04:21 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
04:21 Hotkeys same number of bytes though
04:21 Hotkeys m: {[&&]@_».lc Z∈qw|to too two t0 2|,<b be bee b3>}("2","bee").say
04:21 camelia rakudo-moar 72dbb3: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Sb_3aOeuQV␤Two terms in a row␤at /tmp/Sb_3aOeuQV:1␤------> 3{[&&]7⏏5@_».lc Z∈qw|to too two t0 2|,<b be bee b␤    expecting any of:␤        infix␤        infix stopper␤        statement en…»
04:22 AlexDaniel hmm
04:22 tardisx joined #perl6
04:22 AlexDaniel hey look
04:23 AlexDaniel m: {@_».lc~~([&]<to too two t0 2>,[&]<b be bee b3>)}("too", "b3").say
04:23 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
04:23 AlexDaniel Hotkeys: that's two bytes shorter than <>.any
04:23 Hotkeys crazy
04:23 AlexDaniel how long is that by the way
04:23 Hotkeys m: say [&]<to too two t0 2>
04:23 camelia rakudo-moar 72dbb3: OUTPUT«all()␤»
04:23 Hotkeys ...
04:23 Hotkeys m: {[&&]@_».lc Z∈qw|to too two t0 2|,<b be bee b3>}("2","farts").say
04:23 camelia rakudo-moar 72dbb3: OUTPUT«5===SORRY!5=== Error while compiling /tmp/xiZFjk6Aja␤Two terms in a row␤at /tmp/xiZFjk6Aja:1␤------> 3{[&&]7⏏5@_».lc Z∈qw|to too two t0 2|,<b be bee b␤    expecting any of:␤        infix␤        infix stopper␤        statement en…»
04:23 Hotkeys m: {@_».lc~~([&]<to too two t0 2>,[&]<b be bee b3>)}("too", "farts").say
04:23 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
04:23 AlexDaniel ah geez, it doesn't work
04:24 Hotkeys :p
04:24 AlexDaniel why?
04:24 Hotkeys sec
04:24 Hotkeys m: {@_».lc~~([|]<to too two t0 2>,[|]<b be bee b3>)}("too", "farts").say
04:24 camelia rakudo-moar 72dbb3: OUTPUT«False␤»
04:24 Hotkeys m: {@_».lc~~([|]<to too two t0 2>,[|]<b be bee b3>)}("too", "b3").say
04:24 camelia rakudo-moar 72dbb3: OUTPUT«False␤»
04:24 Hotkeys darn
04:25 AlexDaniel it needs parens
04:26 AlexDaniel m: {@_».lc~~([|](<to too two t0 2>),[|](<b be bee b3>))}("too", "b3").say
04:26 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
04:26 AlexDaniel m: {@_».lc~~([|](<to too two t0 2>),[|](<b be bee b3>))}("too", "b4").say
04:26 camelia rakudo-moar 72dbb3: OUTPUT«False␤»
04:26 AlexDaniel meh!
04:26 AlexDaniel too long
04:32 AlexDaniel m: {?[*] @_».lc Z∈qw{to too two t0 2},<b be bee b3>}("2","bee").say
04:32 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
04:32 AlexDaniel m: {?[*] @_».lc Z∈qw{to too two t0 2},<b be bee b3>}("2","beez").say
04:32 camelia rakudo-moar 72dbb3: OUTPUT«False␤»
04:32 AlexDaniel Hotkeys: now that's crazy, but not shorter
04:32 Hotkeys heh
04:33 Hotkeys m: {?[&] @_».lc Z∈qw{to too two t0 2},<b be bee b3>}("2","beez").say
04:33 camelia rakudo-moar 72dbb3: OUTPUT«False␤»
04:33 Hotkeys m: {?[&] @_».lc Z∈qw{to too two t0 2},<b be bee b3>}("2","bee").say
04:33 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
04:33 Hotkeys might as well
04:33 Hotkeys although that brings us back to ?all
04:34 AlexDaniel Hotkeys: it is funny how pyth solution is 39 bytes
04:34 AlexDaniel and perl6 is 45 :D
04:35 AlexDaniel that's really huge readability per byte ratio :)
04:36 Hotkeys yeah
04:36 AlexDaniel Hotkeys: you wouldn't believe it!
04:36 AlexDaniel ah no…
04:36 Hotkeys he didn't even do a breakdown
04:36 Hotkeys like the other golf langs do
04:36 Hotkeys s/he/they/
04:37 Hotkeys the page he links is just a list of char -> instruction
04:37 Hotkeys s/he/they/
04:38 AlexDaniel m: {$^a.lc∈qw{to too two t0 2}&&$^b.lc∈<b be bee b3>}("2","bee").say
04:38 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
04:38 AlexDaniel I thought that this is shorter but then I realized there is no .lc
04:42 cpage_ joined #perl6
04:49 AlexDaniel Hotkeys: well
04:50 AlexDaniel -1 char
04:50 AlexDaniel m: {?+(@_».lc Z∈<to too two t0 2>,<b be bee b3>)}("2","bee").say
04:50 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
04:50 AlexDaniel oops
04:50 AlexDaniel m: {?+(@_».lc Z∈qw{to too two t0 2},<b be bee b3>)}("2","bee").say
04:50 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
04:51 Hotkeys wait
04:51 Hotkeys but that worked
04:51 Hotkeys without qw
04:51 Hotkeys m: {?+(@_».lc Z∈<to too two t0 2>,<b be bee b3>)}("2b","bee").say
04:51 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
04:51 Hotkeys oh
04:51 Hotkeys nvm
04:51 Hotkeys er
04:52 Hotkeys oh
04:52 Hotkeys that won't work
04:52 AlexDaniel hahaha
04:52 AlexDaniel right…
04:52 AlexDaniel my bad
04:52 Hotkeys cause truthy is anything > 0
04:52 Hotkeys well actually that'll always be 2
04:52 Hotkeys so
04:52 AlexDaniel yup I see
04:53 AlexDaniel but maybe we can do that with slip somehow?
04:56 AlexDaniel actually, I've just noticed
04:56 AlexDaniel Hotkeys: that this alternative has to use qw as well
04:56 * gfldex .oO( use v6; to beat them at their own game. )
04:59 AlexDaniel m: say {@_».lc~~((qw<to too two t0 2>,<b be bee b3>)».any)}(‘2’,‘bee’)
04:59 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
04:59 AlexDaniel same amount of bytes
05:00 Hotkeys smells longer
05:00 AlexDaniel Hotkeys: exactly the same
05:00 AlexDaniel oooooh
05:00 AlexDaniel m: say {@_».lc~~(qw<to too two t0 2>,<b be bee b3>)».any}(‘2’,‘bee’)
05:01 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
05:01 AlexDaniel Hotkeys: now that is two characters shorter!
05:01 Hotkeys same length in bytes actually
05:01 Hotkeys {@_».lc~~(qw<to too two t0 2>,<b be bee b3>)».any}
05:01 Hotkeys {?all @_».lc Z∈qw|to too two t0 2|,<b be bee b3>}
05:02 AlexDaniel I didn't try to get it to compete, but…
05:02 Hotkeys neither of those are competing
05:02 AlexDaniel there's one thing I often find crazy in code golf
05:03 gfldex m: -> Int $a, Str $b {1}(1,"2")
05:03 camelia rakudo-moar 72dbb3: ( no output )
05:03 AlexDaniel just look at this example! it is as short as it could be
05:03 Hotkeys what do you find crazy?
05:04 AlexDaniel Hotkeys: that it is not going to be shorter ever
05:04 Hotkeys oh
05:04 AlexDaniel and yet comes somebody who says “hey look, here it is, twice shorter than that”
05:04 AlexDaniel and I'm like “whyyyy”
05:05 Hotkeys lol
05:05 Hotkeys like how the regex example is still 7 bytes shorter than the above
05:05 gfldex m: say sub f($a){$a}(1);
05:05 camelia rakudo-moar 72dbb3: OUTPUT«1␤»
05:07 gfldex calling functions (and blocks) in place seams not to be docked
05:07 AlexDaniel m: say {@_».lc~~qw<to too two t0 2 b be bee b3>[^5,5..*]».any}(‘2’,‘bee’) # nope
05:07 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
05:08 Hotkeys lol
05:09 gcole joined #perl6
05:09 azawawi joined #perl6
05:09 [particle] joined #perl6
05:10 flaviusb joined #perl6
05:10 azawawi about %?RESOURCES, does on have to specify every folder/file to be copied in META.info "resources" key? (e.g. resources/sample_dir)
05:11 AlexDaniel Hotkeys: hang on, it looks like regex example is -2 bytes
05:12 skarn joined #perl6
05:13 kent\n joined #perl6
05:13 kent\n joined #perl6
05:16 AlexDaniel m: {@_~~(/:i^t[0|oo?|wo]$/|2,/:i^​b[ee?|3]?$/)}(‘to’,‘bee’).say
05:16 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
05:17 AlexDaniel Hotkeys: the problem is that it errors out if you do this
05:17 AlexDaniel m: {@_~~(/:i^t[0|oo?|wo]$/|2,/:i^b​[ee?|3]?$/)}(‘HAHA’,‘bee’).say
05:17 camelia rakudo-moar 72dbb3: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5HAHA' (indicated by ⏏)␤  in block <unit> at /tmp/MKPkUUV3Gi line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/MKPkUUV3Gi line 1␤␤»
05:17 Hotkeys lol
05:17 AlexDaniel but for valid inputs it works, yeah
05:17 AlexDaniel :/
05:18 AlexDaniel Hotkeys: you can put '2' in quotes but then it ruins everything
05:18 AlexDaniel oh, but wait!
05:19 AlexDaniel no, nothing
05:19 Hotkeys lol
05:21 AlexDaniel Hotkeys: oh, YEAH!
05:21 AlexDaniel m: {@_~~(~2|/:i^t[0|oo?|wo]$/,/:i^b[e​e?|3]?$/)}(‘MWAHAHAHA’,‘bee’).say
05:21 camelia rakudo-moar 72dbb3: OUTPUT«False␤»
05:21 AlexDaniel m: {@_~~(~2|/:i^t[0|oo?|wo]$/,/:i​^b[ee?|3]?$/)}(‘2’,‘bee’).say
05:21 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
05:21 AlexDaniel m: {@_~~(~2|/:i^t[0|oo?|wo]$/,/:​i^b[ee?|3]?$/)}(2,‘bee’).say
05:21 camelia rakudo-moar 72dbb3: OUTPUT«True␤»
05:22 AlexDaniel Hotkeys: that's -1 byte as far as I can see
05:22 Hotkeys cheeky
05:22 Hotkeys I like it
05:22 eone joined #perl6
05:27 AlexDaniel joined #perl6
05:28 Hotkeys didn't mean to italics there
05:29 azawawi where can i find Distribution.install(...) source code?
05:30 jdv79 grep src/core ?
05:30 azawawi seems to me it does not handle recursive directories copying in %resources
05:31 jdv79 i bet you'll find it in src/core/Distribution.pm.  wild guess.
05:31 frew joined #perl6
05:36 AlexDaniel Hotkeys: HA-HA!
05:36 AlexDaniel ah,no…
05:36 AlexDaniel xD
05:36 Hotkeys lol
05:37 azawawi jdv79: nearly correct :) https://github.com/rakudo/rakudo/blob/nom/src/​core/CompUnit/Repository/Installation.pm#L112
05:39 AlexDaniel Hotkeys: Shakespeare answer is really cool
05:40 Hotkeys yeash
05:41 Hotkeys yeah
05:41 jdv79 cool
05:42 AlexDaniel Hotkeys: so will you change it to 44 byte version?
05:42 AlexDaniel I don't think there is any way to make it shorter. That's it
05:46 Hotkeys oh
05:46 Hotkeys yeah
05:46 Hotkeys sec
05:47 Cabanossi joined #perl6
05:51 khw joined #perl6
05:52 Hotkeys AlexDaniel: there we go
05:52 Hotkeys tied with JS now
05:53 AlexDaniel Hotkeys: kay. It seems like my edit did not make it through, please fix <to too two t0 2>
05:53 AlexDaniel Hotkeys: it has to be qw<>
05:53 Hotkeys oh
05:54 AlexDaniel you can change any() to .any to keep the byte count
05:56 Hotkeys good catch
05:58 Hotkeys Why does <> do IntStr but qw<> (s/<>/etc./) does Str
06:03 AlexDaniel m: say {("0."~.flip for ^$_)}(25)
06:03 camelia rakudo-moar 72dbb3: OUTPUT«(0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.01 0.11 0.21 0.31 0.41 0.51 0.61 0.71 0.81 0.91 0.02 0.12 0.22 0.32 0.42)␤»
06:03 AlexDaniel m: say {(^$_)».&{"0."~.flip}(25)
06:03 camelia rakudo-moar 72dbb3: OUTPUT«5===SORRY!5===␤Expression needs parens to avoid gobbling block␤at /tmp/NQ1yQR5tUH:1␤------> 3say {(^$_)».&{"0."~.flip}7⏏5(25)␤Missing block (apparently claimed by expression)␤at /tmp/NQ1yQR5tUH:1␤------> 3say 7⏏5{(^$_)».&{"0."~…»
06:03 AlexDaniel m: say {(^$_)».&{"0."~.flip}}(25)
06:03 camelia rakudo-moar 72dbb3: OUTPUT«(0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.01 0.11 0.21 0.31 0.41 0.51 0.61 0.71 0.81 0.91 0.02 0.12 0.22 0.32 0.42)␤»
06:05 AlexDaniel m: say {map ^$_: "0."~*.flip}(25)
06:05 camelia rakudo-moar 72dbb3: OUTPUT«(0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.01 0.11 0.21 0.31 0.41 0.51 0.61 0.71 0.81 0.91 0.02 0.12 0.22 0.32 0.42)␤»
06:05 AlexDaniel Hotkeys: come on… same character count
06:07 Hotkeys lol
06:07 AlexDaniel Hotkeys: perhaps you can also include the last one :)
06:08 Hotkeys Sure
06:09 _Gustaf_ joined #perl6
06:10 Hotkeys I always instinctively go for the 'for' version
06:10 Hotkeys plus it usually ends up being about the same length
06:10 Hotkeys m: {map ^$_: "0."~.flip}(25).say
06:10 camelia rakudo-moar 72dbb3: OUTPUT«Cannot call map(Range: Str); none of these signatures match:␤    ($: Hash \h, *%_)␤    (\SELF: &block;; :$label, :$item, *%_)␤    (HyperIterable:D $: &block;; :$label, *%_)␤  in block <unit> at /tmp/dnORgOcmgb line 1␤␤»
06:10 Hotkeys aww
06:11 Hotkeys m: {map ^$_:"0."~*.flip}(25).say
06:11 camelia rakudo-moar 72dbb3: OUTPUT«5===SORRY!5=== Error while compiling /tmp/xCQtBYTYT1␤Confused␤at /tmp/xCQtBYTYT1:1␤------> 3{map ^$_:7⏏5"0."~*.flip}(25).say␤    expecting any of:␤        colon pair␤»
06:11 AlexDaniel m: say {"0."xx$_ Z~(^$_)».flip}(25) # slightly longer
06:11 camelia rakudo-moar 72dbb3: OUTPUT«(0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.01 0.11 0.21 0.31 0.41 0.51 0.61 0.71 0.81 0.91 0.02 0.12 0.22 0.32 0.42)␤»
06:13 AlexDaniel m: say {"0."X~(^$_)».flip}(25)
06:13 camelia rakudo-moar 72dbb3: OUTPUT«(0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.01 0.11 0.21 0.31 0.41 0.51 0.61 0.71 0.81 0.91 0.02 0.12 0.22 0.32 0.42)␤»
06:13 AlexDaniel Hotkeys: HA
06:13 Hotkeys damn
06:14 _Gustaf_ o/
06:15 AlexDaniel Hotkeys: I liked this one
06:15 AlexDaniel Hotkeys: that's one of these moments. Look how readable it was
06:15 AlexDaniel and I only made it much uglier
06:16 AlexDaniel 19 bytes, right?
06:17 AlexDaniel Hotkeys: perhaps keep previous attempts. People seem to like it
06:17 Hotkeys 20
06:18 AlexDaniel right. Forgot about »
06:19 Hotkeys What's your stackoverflow name
06:19 Hotkeys I'll credit you
06:19 AlexDaniel Hotkeys: http://codegolf.stackexchange.com/u​sers/49921/aleks-daniel-jakimenko-a
06:19 AlexDaniel goddamn thing can't accept my name properly
06:20 AlexDaniel stupid length limits
06:21 Hotkeys lol
06:24 nekrodesk joined #perl6
06:30 nekrodesk joined #perl6
06:36 nekrodesk joined #perl6
06:39 grondilu joined #perl6
06:39 nekrodesk joined #perl6
06:41 nekrodesk joined #perl6
06:42 AlexDaniel Hotkeys: this one is easy
06:42 AlexDaniel Hotkeys: http://codegolf.stackexchange.com/questions/71​265/efficient-scientific-notation/71393#71393
06:42 AlexDaniel Hotkeys: replace 「$_ <1」 with 「1>$_」
06:43 AlexDaniel Hotkeys: replace 「by(*.chars)」 with 「by(&chars)」
06:43 AlexDaniel Hotkeys: 「* <10」 with 「10>*」
06:44 rurban joined #perl6
06:44 Hotkeys can you chain 1 <= 10 > * the same as I have it?
06:44 Hotkeys er
06:45 Hotkeys do you mean 10 > * <= 1
06:45 AlexDaniel no idea actually
06:45 AlexDaniel I didn't notice the chaining
06:46 AlexDaniel Hotkeys: but yeah reverse the whole thing
06:46 AlexDaniel 1 <= * < 10 → 10 > * >= 1
06:47 AlexDaniel Hotkeys: actually I still can't read it so I don't know :)
06:47 Hotkeys {my \s=($_,*×(1>$_??10!!.1)…10>*>=1);min(s[*-1​]~"x10^"~s-(1>$_??s*2!!1),$_,:by(&chars))}
06:47 Hotkeys is where we're at
06:48 Hotkeys that post was just me attempting while half awake
06:51 AlexDaniel Hotkeys: by=>&chars
06:52 buharin joined #perl6
06:58 AlexDaniel Hotkeys: it is interesting that @a[*-1] is equal in length to @a.tail
06:59 Hotkeys they don't do quite the same thing though
06:59 AlexDaniel @a.tail(2) and  @a[*-2..*] are same too
07:00 Hotkeys m: my @a = ^5; @a.tail.WHAT.say; @a[*-1].WHAT.say
07:00 camelia rakudo-moar 72dbb3: OUTPUT«(Seq)␤(Int)␤»
07:00 AlexDaniel Hotkeys: I'd say that tail is cooler because it returns a seq
07:00 AlexDaniel for one element it is not relevant though :)
07:00 Hotkeys right
07:00 Hotkeys m: my @a = ^5; @a.tail(3) # more interesting
07:00 camelia rakudo-moar 72dbb3: ( no output )
07:00 Hotkeys m: my @a = ^5; @a.tail(3).say # more interesting
07:00 camelia rakudo-moar 72dbb3: OUTPUT«(2 3 4)␤»
07:02 CIAvash joined #perl6
07:11 Anx joined #perl6
07:11 Hotkeys I'll go to bed, if you want AlexDaniel leave your shortened version of the golf as a comment and I'll update the post tomorrow
07:11 Hotkeys (the codegolf board generally doesn't like edits for improvements not sure why)
07:11 AlexDaniel Hotkeys: I wont look at it anymore
07:11 AlexDaniel Hotkeys: it is boring
07:12 Hotkeys lol
07:12 Hotkeys fair enough
07:12 Hotkeys 'night
07:12 AlexDaniel so just get the latest version there, I guess
07:20 dalek ecosystem: 3f4fd5f | (Sam Gillespie)++ | META.list:
07:20 dalek ecosystem: Update META.list
07:20 dalek ecosystem:
07:20 dalek ecosystem: Adding the Net::OSC module to the ecosystem :)
07:20 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/3f4fd5fc17
07:20 dalek ecosystem: c1d4465 | sylvarant++ | META.list:
07:20 dalek ecosystem: Merge pull request #152 from samgwise/patch-1
07:20 dalek ecosystem:
07:20 dalek ecosystem: Update META.list
07:20 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/c1d4465d26
07:25 domidumont joined #perl6
07:31 nakiro joined #perl6
07:32 domidumont joined #perl6
07:36 [Tux] test            22.228
07:36 [Tux] test-t          12.130
07:36 [Tux] csv-parser      51.622
07:42 FROGGS joined #perl6
07:44 firstdayonthejob joined #perl6
07:56 eternaleye joined #perl6
08:05 kurahaupo joined #perl6
08:12 darutoko joined #perl6
08:21 dolmen joined #perl6
08:28 ely-se joined #perl6
08:40 lizmat good *, #perl6!
08:40 lizmat I hope the test-t > 12 is noise, and not cause by the Failure.handled changes
08:40 lizmat *caused
08:41 bowtie joined #perl6
08:51 dalek rakudo/nom: aaf5c26 | (Salvador Ortiz)++ | src/core/Setty.pm:
08:51 dalek rakudo/nom: Fix for RT#127402: Set.hash stringifies its objects
08:51 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/aaf5c26b5f
08:51 dalek rakudo/nom: 691b39b | lizmat++ | src/core/Setty.pm:
08:51 dalek rakudo/nom: Merge pull request #711 from salortiz/setty_hash
08:51 dalek rakudo/nom:
08:51 dalek rakudo/nom: Fix for RT#127402: Set.hash stringifies its objects
08:51 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/691b39b1f9
08:59 CIAvash joined #perl6
09:02 abraxxa joined #perl6
09:25 fireartist joined #perl6
09:26 nekrodesk joined #perl6
09:29 nekrodesk joined #perl6
09:32 nekrodesk joined #perl6
09:33 nekrodesk joined #perl6
09:34 RabidGravy joined #perl6
09:35 luiz_lha joined #perl6
09:35 rindolf joined #perl6
09:36 nekrodesk joined #perl6
09:37 ocbtec joined #perl6
09:39 nekrodesk joined #perl6
09:41 nekrodesk joined #perl6
09:43 leont joined #perl6
09:46 RabidGravy wh'appen peoples!
09:47 brrt joined #perl6
09:51 DrForr Nada mucho.
10:06 wamba joined #perl6
10:07 Gothmog_ joined #perl6
10:15 dalek star: 4b44be8 | FROGGS++ | tools/star/mac-dmg.pod:
10:15 dalek star: fix typo
10:15 dalek star: review: https://github.com/rakudo/star/commit/4b44be8f03
10:16 espadrine joined #perl6
10:31 ely-se joined #perl6
10:32 apiw joined #perl6
10:33 rurban joined #perl6
10:39 Actualeyes joined #perl6
10:43 kid51 joined #perl6
10:53 kid51 joined #perl6
10:57 maybekoo5 joined #perl6
11:20 Averna joined #perl6
11:24 ely-se joined #perl6
11:25 brrt fwiw, the perlsecco wine i got at FOSDEM was really nice :-)
11:26 apiw joined #perl6
11:30 fireartist just wrote a little script to pretty-print resursive directory listing - wow! - perl6 IO is *nice*
11:36 brrt perl6 is nice, in general :-)
11:36 brrt i'm wondering if there is a perl6 equivalent of this
11:36 kaare_ joined #perl6
11:36 brrt my %hash = $string =~ m/(\w+) = (\w+)/g;
11:37 kamel joined #perl6
11:38 RabidGravy something with a split and map I would go for
11:38 RabidGravy got something very similar in the code I'm working on right now
11:39 Skarsnik joined #perl6
11:41 brrt i think the perl5 idiom is really nice
11:42 RabidGravy m: say "foo=bar".match(/$<key>=(\w+) "=" $<value>=(\w+)/, :g).map({ ~$_<key> => ~$_<value>})
11:42 camelia rakudo-moar 691b39: OUTPUT«(foo => bar)␤»
11:44 luiz_lha joined #perl6
11:47 timotimo personally, i'd .comb
11:48 timotimo m: say "foo=bar baz=quux what=that".comb(/(\w+) "=" (\w+)/, :match)>>.list.perl
11:48 camelia rakudo-moar 691b39: OUTPUT«((Match.new(ast => Any, list => (), hash => Map.new(()), orig => "foo=bar baz=quux what=that", to => 3, from => 0), Match.new(ast => Any, list => (), hash => Map.new(()), orig => "foo=bar baz=quux what=that", to => 7, from => 4)), (Match.new(ast => Any, li…»
11:48 timotimo m: say "foo=bar baz=quux what=that".comb(/(\w+) "=" (\w+)/, :match)>>.list>>.Str.perl
11:48 camelia rakudo-moar 691b39: OUTPUT«($("foo", "bar"), $("baz", "quux"), $("what", "that"))␤»
11:48 timotimo m: say "foo=bar baz=quux what=that".comb(/(\w+) "=" (\w+)/, :match)>>.list>>.Str.flat.perl
11:48 camelia rakudo-moar 691b39: OUTPUT«($("foo", "bar"), $("baz", "quux"), $("what", "that")).Seq␤»
11:48 timotimo m: say "foo=bar baz=quux what=that".comb(/(\w+) "=" (\w+)/, :match)>>.list>>.Str>>.flat.perl
11:48 camelia rakudo-moar 691b39: OUTPUT«($(("foo",).Seq, ("bar",).Seq), $(("baz",).Seq, ("quux",).Seq), $(("what",).Seq, ("that",).Seq))␤»
11:48 timotimo that's terrible %)
11:49 timotimo m: say "foo=bar baz=quux what=that".comb(/(\w+) "=" (\w+)/, :match)>>.list>>.Slip>>.Str.perl
11:49 camelia rakudo-moar 691b39: OUTPUT«("foo", "bar", "baz", "quux", "what", "that")␤»
11:49 timotimo m: my %result = "foo=bar baz=quux what=that".comb(/(\w+) "=" (\w+)/, :match)>>.list>>.Slip>>.Str; say %result.perl
11:49 camelia rakudo-moar 691b39: OUTPUT«{:baz("quux"), :foo("bar"), :what("that")}␤»
11:49 timotimo m: my %result = "foo=bar baz=quux what=that".comb(/(\w+) "=" (\w+)/, :match)>>.Slip>>.Str; say %result.perl
11:49 camelia rakudo-moar 691b39: OUTPUT«{:baz("quux"), :foo("bar"), :what("that")}␤»
11:49 timotimo cool, i can drop the .list because .Slip does that already
11:50 moritz Slip is a subtype of List anyway
11:50 timotimo aye
11:50 moritz m: say Slip ~~ List
11:50 camelia rakudo-moar 691b39: OUTPUT«True␤»
11:50 timotimo is my solution acceptable?
11:50 timotimo i must admit, the .match one looks a bit nicer
11:51 timotimo though ...
11:51 timotimo m: say "foo=bar yours=mine".match(/$<key>=(\w+) "=" $<value>=(\w+) { make ~$<key> => ~$<value> /, :g)>>.ast
11:51 camelia rakudo-moar 691b39: OUTPUT«5===SORRY!5=== Error while compiling /tmp/h6oolbsQP7␤Preceding context expects a term, but found infix , instead␤at /tmp/h6oolbsQP7:1␤------> 3ue>=(\w+) { make ~$<key> => ~$<value> /,7⏏5 :g)>>.ast␤»
11:51 timotimo m: say "foo=bar yours=mine".match(/$<key>=(\w+) "=" $<value>=(\w+) { make ~$<key> => ~$<value> } /, :g)>>.ast
11:51 camelia rakudo-moar 691b39: OUTPUT«(foo => bar yours => mine)␤»
11:51 moritz m: my %result = flat "foo=bar baz=quux what=that".words>>.split('='); say %result.perl
11:51 camelia rakudo-moar 691b39: OUTPUT«{:baz("quux"), :foo("bar"), :what("that")}␤»
11:51 timotimo m: say "foo=bar yours=mine".match(/$<key>=(\w+) "=" $<value>=(\w+) { make ~$<key> => ~$<value> } /, :g)>>.ast.perl
11:51 camelia rakudo-moar 691b39: OUTPUT«(:foo("bar"), :yours("mine"))␤»
11:54 apiw joined #perl6
11:55 jkva joined #perl6
11:56 brrt acceptable, just not as well-worn-down, i'd say :-)
11:57 timotimo thing is, if we did it more like your idiom, we'd end up with a hash filled with match objects
11:57 timotimo so there has to be at least a .Str in there somewhere
11:57 timotimo or a ~*
11:57 brrt hmmm......
11:57 brrt here's an idea though
11:57 brrt way, way to late, but here it is
11:58 brrt what if we give the hash a Cool method that converts all its keys and all its values to strings
11:58 timotimo .Coolize
11:58 brrt or, Cool objects at any rate
11:58 brrt Coler
11:58 brrt .Cooler
11:58 timotimo .refridgerate
11:59 brrt anyway, lunch &
11:59 timotimo lunch well
12:11 FROGGS joined #perl6
12:22 brrt ok, naive question
12:23 timotimo if it's a native question, you spell it with a lower-case q :)
12:23 brrt is a Match a descendant of Str, or does it at least does Stringy
12:23 brrt why ask i
12:23 timotimo m: say Str ~~ Stringy
12:23 camelia rakudo-moar 691b39: OUTPUT«True␤»
12:23 timotimo er
12:23 timotimo m: say Match ~~ Stringy
12:23 camelia rakudo-moar 691b39: OUTPUT«False␤»
12:23 timotimo it does not, but it has .Str
12:23 brrt because.. this would make sense
12:24 brrt a Match is always a part-of-a-string
12:24 brrt hence, it *is* a string
12:24 moritz no
12:24 brrt why not
12:24 masak because a Match is not a kind of Str
12:24 moritz right
12:24 brrt why not
12:24 masak it's pointing into a Str
12:25 brrt well, yes, but it never incorrect to refer to it as a Str
12:25 bitmap joined #perl6
12:25 moritz it's information about how a regex matched a string
12:25 masak it's not a Str
12:25 brrt it is Stringy, at least
12:25 masak no
12:25 masak you are misinformed about what it is
12:25 brrt yes
12:25 brrt i said it was a naive question
12:25 moritz lots of things can be coerced to Str, but they don't do the Stringy role
12:26 masak right. exactly the same argument could be made about Bool
12:26 khagan joined #perl6
12:26 brrt no, but a Match always (refers to) a part of a Str
12:26 brrt hmmmm
12:26 masak both True and False have Str-y representations
12:26 brrt that is actually a decent enough point
12:26 masak pause for breathing.
12:26 * brrt thinks
12:26 masak :)
12:26 brrt but still, always a subset-of-matched string
12:27 brrt well, reference is not identity, of course
12:27 brrt hmm
12:27 masak brrt: designing type relationships is bloody hard. you're experiencing a *desire* for the model to be in a certain way. it isn't.
12:27 brrt aye
12:28 brrt well, i was thinking about it, because if it *were* Stringy, then timotimo's sample would be simpler
12:28 molaf joined #perl6
12:28 masak in a sense, you're akin to the people who want Int to be a kind of Rat and Rat to be a kind of Num.
12:28 moritz or you always talk about a customer by name, which is a string. That doesn't make Customer a Str
12:28 masak I don't feel a great compulsion to make Match ~~ Stringy. it feels like conflating two things.
12:29 brrt in fact, i experience a revulsion to the idea :-)
12:29 brrt (from you)
12:29 masak sometimes I do +$0 and coerce my Match to a Numeric type. doesn't mean I want Match ~~ Numeric
12:29 rindolf joined #perl6
12:30 brrt but my counterargument remains. a match *is* always a subset-of-a-Str, it has certain string-like-behaviour; it also has very un-string-like behaviour, like being a decent target for assignment, whereas a substring - i think - is not
12:30 brrt but yeah, it is hard
12:31 masak brrt: where you see an is-a, I see a has-a. a Match object has many properties, one of which is referring into part of a Str.
12:31 apiw joined #perl6
12:31 moritz there's also the representational aspect to consider
12:32 moritz Match actually stores a references to the original string, and start and end indexes of the match
12:32 Juerd I think one of the most important distinctions between a Match's substring and a real string, is that a Match can "be" (have) an empty string, but it will still be true.
12:32 brrt well, that's not a terribly strong argument; you could have javastrings, and then match being a subset of String would be the most logical thing in the world
12:32 moritz if you make it inherit from Str, you *have* to store the matched string again
12:33 masak Juerd: good point. which spoils the monoidal aspect of Str, quite a strong deviation.
12:33 Juerd What does monoidal mean?
12:33 brrt (javastring as a representation)
12:33 * masak thinks
12:34 masak Juerd: monoidal means having an associative operation with a unit. like (Int, +, 0) or (Bool, ||, False) or (Str, ~, "")
12:35 Juerd Also, a Match thingy can have multiple strings
12:35 brrt hmm.. can it
12:35 brrt ok, well, i can't continue this now, will be back later :-)
12:35 Juerd m: say "foo" ~~ m:g/o/
12:35 camelia rakudo-moar 691b39: OUTPUT«(「o」 「o」)␤»
12:36 masak m: say ("foo" ~~ m:g/o/).^name
12:36 camelia rakudo-moar 691b39: OUTPUT«List␤»
12:36 Juerd Oh, that's a list of Matches
12:36 Juerd Never mind this argument then :)
12:36 masak yeah.
12:36 masak but the fact that this was even a *question* means that Match is not an obvious Str.
12:36 Juerd m: say "foo" ~~ /(f)(o+)/
12:36 camelia rakudo-moar 691b39: OUTPUT«「foo」␤ 0 => 「f」␤ 1 => 「oo」␤»
12:44 rurban joined #perl6
12:44 sufrostico joined #perl6
12:45 ugexe joined #perl6
12:51 domidumont joined #perl6
12:53 orbus joined #perl6
13:04 bioexpress joined #perl6
13:05 bowtie joined #perl6
13:08 bioexpress Hello! "sub one { some_func( $_[0] ) }":  was is the most similirar construct (with the smalles overhead regarding passing the parameter) in Perl 6 ?
13:09 timotimo what exactly do you want the sub to accept?
13:09 masak m: sub one { some_func(@_[0]) }; sub some_func($s) { say $s }; one("OH HAI")
13:09 camelia rakudo-moar 691b39: OUTPUT«OH HAI␤»
13:09 masak bioexpress: like that?
13:10 masak m: sub one { some_func(@_[0]) }; sub some_func($s) { say $s }; one("OH HAI", "I can send more stuff", "but it doesn't get printed")
13:10 camelia rakudo-moar 691b39: OUTPUT«OH HAI␤»
13:10 timotimo masak: it looks to me like they want a sub that extracts the first item in the first parameter passed
13:10 timotimo but what do i know
13:10 masak yes, I'm not sure either. :)
13:11 apiw joined #perl6
13:11 bioexpress timotimo: I think that is what I am searching for
13:12 timotimo okay, then the code is literally the same you already had :)
13:12 timotimo m: sub first_of_first { some_func($_[0]) }; sub some_func { say "i got ", $_ }; first_of_first([10, 20, 30]);
13:12 camelia rakudo-moar 691b39: OUTPUT«Too many positionals passed; expected 0 arguments but got 1␤  in sub first_of_first at /tmp/3hWl12_ERk line 1␤  in block <unit> at /tmp/3hWl12_ERk line 1␤␤»
13:12 timotimo whoops.
13:13 timotimo m: sub first_of_first($_) { some_func($_[0]) }; sub some_func { say "i got ", $_ }; first_of_first([10, 20, 30]);
13:13 camelia rakudo-moar 691b39: OUTPUT«Too many positionals passed; expected 0 arguments but got 1␤  in sub some_func at /tmp/rTwdAsJ51m line 1␤  in sub first_of_first at /tmp/rTwdAsJ51m line 1␤  in block <unit> at /tmp/rTwdAsJ51m line 1␤␤»
13:13 timotimo oh, *in* the sub
13:13 timotimo m: sub first_of_first($_) { some_func($_[0]) }; sub some_func($_) { say "i got ", $_ }; first_of_first([10, 20, 30]);
13:13 camelia rakudo-moar 691b39: OUTPUT«i got 10␤»
13:13 timotimo m: sub first_of_first { some_func($^thing[0]) }; sub some_func { say "i got ", $^thing }; first_of_first([10, 20, 30]);
13:13 camelia rakudo-moar 691b39: OUTPUT«i got 10␤»
13:13 timotimo m: sub first_of_first { some_func($^thing[0]) }; sub some_func { say "i got ", $^thing }; first_of_first([10, 20, 30], <foo bar baz>);
13:13 camelia rakudo-moar 691b39: OUTPUT«Too many positionals passed; expected 1 argument but got 2␤  in sub first_of_first at /tmp/uGfhwZysPy line 1␤  in block <unit> at /tmp/uGfhwZysPy line 1␤␤»
13:14 garu_ is http://doc.perl6.org/type/Signature the ultimate-goto-if-its-not-there-it-doesnt-exist reference on sub/method signatures in P6? Or should I look elsewhere as well?
13:14 timotimo if you want it to accept as many positional arguments, you'd add a "*@" in the signature
13:14 bioexpress I need only one argument
13:14 timotimo OK
13:14 bioexpress Thx!
13:23 pmurias joined #perl6
13:23 apiw joined #perl6
13:27 Perl6Newbie joined #perl6
13:28 timotimo what can we do to make /downloads/star prettier?
13:28 FROGGS garu_: it seems pretty complete
13:28 timotimo like, perhaps putting all files that belong to the same month into columns?
13:28 timotimo or friendlier icons?
13:29 FROGGS garu_: though from skimming it, constant expressions are just mentioned on return types, which is unfortunate I think
13:29 mspo you mean http://rakudo.org/downloads/star/  ?
13:29 awwaiid mmm. I think you could do just about anything and it would be prettier than it is
13:29 timotimo yes, that's the one
13:29 FROGGS garu_: like: sub foo("bar", $baz) { ... }
13:29 mspo Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 Server at rakudo.org Port 80
13:30 timotimo without forcing people to spend more effort on this
13:30 mspo is that real?
13:30 awwaiid ideally big buttons at the top for the current version is all you want, and then only show the others if people go out of their way to get an outdated version
13:30 timotimo is that an OpenSSL version susceptible to heartbleed or something?
13:30 timotimo and yeah, it is real.
13:30 mspo old apache :)
13:30 awwaiid oh, zero-effort. hmm. maybe there are some like apache themes or something
13:30 timotimo rakudo.org isn't well maintained. the owner doesn't have time to work on it
13:30 FROGGS mspo: could be worse
13:30 FROGGS (could be IIS)
13:31 mspo FROGGS: that's always true
13:31 timotimo i think the wordpress is also quite old
13:31 mspo ugh wordpress
13:31 jkva joined #perl6
13:31 jkva left #perl6
13:31 moritz pmichaud runs rakudo.org; somebody should contact him
13:31 timotimo it says "update is available! please update now", but i'm *not* going to be the one doing the update click.
13:31 awwaiid mostly I think if you move /downloads/star to the main site as a regular page that links to the current versions, and then make this full-list page something almost nobody goes to
13:32 moritz if he doesn't want to maintain the server, we could host it on www.p6c.org (same as perl6.org)
13:32 awwaiid yeah, that sort of update is scary
13:32 moritz you only do that sort of update if you have shell access to the host *and* a recent backup
13:32 mspo yeah probably best to just have a button and hide that dirlist
13:33 mspo timotimo: the lowest effort would be to fix the icons in the mod_dirlist :)
13:33 timotimo we could build a little something something that takes the dirlist apache generates (can it also generate it as .json or .xml or .txt?) and generate a nice little html page from it?
13:33 timotimo perhaps then we could remote-upload that to rakudo.org
13:34 awwaiid timotimo: is the goal that you drop a new version in the dir and don't do anything else?
13:34 timotimo aye
13:34 timotimo *perhaps* trigger the rebuild of the page and check if it doesn't crap itself due to unexpected filenames or something
13:35 awwaiid hmm. I'm still leaning toward having another wordpress download page being the best, but that would mean editing it to point to the lastest version
13:35 timotimo yeah
13:35 awwaiid well gimme edit access to it (wordpress side) and let's see if we can work it out? We don't do releases THAT often :)
13:36 timotimo i'm not sure i'd be allowed to extend trust from rakudo.org to you. also no clue if i have the rights to do that
13:36 timotimo let's see
13:36 awwaiid yeah, no worries
13:37 timotimo wow, i can!
13:37 timotimo would you be an author? editor? administrator?
13:37 timotimo contributor, maybe?
13:38 awwaiid for initial setup of a new page I think I'd need more (editor or admin, can't remember) -- thereafter less
13:38 timotimo i can easily set up a page for you
13:38 timotimo msg me your wanted e-mail address and username please?
13:38 awwaiid ideally, imo, right next to "Home" would be "Download" -- that page would have the most up-to-date / popular downloads and then link to the directories
13:39 fireartist need to be an editor to edit pages - contributor/author are blog-post only
13:39 fireartist https://codex.wordpress.org/Roles_and_Capabilities
13:40 cdg joined #perl6
13:40 timotimo thank you, fireartist, that helps :)
13:47 apiw joined #perl6
13:51 * [Coke] .
13:52 rurban joined #perl6
14:01 skids joined #perl6
14:11 apiw joined #perl6
14:15 [Coke] m: say sqrt(-1+0i) * 2**3 * sum pi
14:15 camelia rakudo-moar 691b39: OUTPUT«0+25.1327412287183i␤»
14:16 timotimo "sum pi"? %)
14:16 moritz m: say pi == sum pi
14:16 camelia rakudo-moar 691b39: OUTPUT«True␤»
14:16 avenj joined #perl6
14:16 avenj joined #perl6
14:16 timotimo is that supposed to read like a poem or something?
14:18 [Coke] i 8 sum pi
14:19 * moritz groans
14:19 [Coke] usually written as √-1 2³ ∑ π
14:20 [Coke] m: say sqrt(-1+0i) * 2³ * sum pi # slightly better
14:20 camelia rakudo-moar 691b39: OUTPUT«0+25.1327412287183i␤»
14:21 timotimo oh lord
14:23 marmay joined #perl6
14:26 cdg joined #perl6
14:31 Actualeyes joined #perl6
14:33 dalek rakudo/experiment-multi-line-repl: 398a92c | hoelzro++ | src/Perl6/Compiler.nqp:
14:33 dalek rakudo/experiment-multi-line-repl: Multi-line input: Don't segfault if an exception has no payload
14:33 dalek rakudo/experiment-multi-line-repl:
14:33 dalek rakudo/experiment-multi-line-repl: We extract BOOTException's payloads via nqp::getpayload to detect
14:33 dalek rakudo/experiment-multi-line-repl: X::Syntax::Missing errors; sometimes, an exception has no payload,
14:33 dalek rakudo/experiment-multi-line-repl: which (until now) causes a segmentation fault
14:33 dalek rakudo/experiment-multi-line-repl: review: https://github.com/rakudo/rakudo/commit/398a92c62f
14:34 garu_ FROGGS: that looks interesting. can you show me an example of where it would be useful? I might try and append to that doc
14:34 timotimo hoelzro: i'm on that segfault
14:35 maybekoo5 joined #perl6
14:37 timotimo pushed, please test :)
14:38 wamba joined #perl6
14:39 FROGGS garu_: https://github.com/tadzik/pan​da/blob/master/bin/panda#L14
14:40 raiph joined #perl6
14:42 FROGGS m: #| do something sensible␤multi MAIN("doit") { ... };␤#| more verbose help␤multi MAIN("WAT") { ... }
14:42 camelia rakudo-moar 691b39: OUTPUT«Usage:␤  /tmp/3p3fJNo0eD doit -- do something sensible␤  /tmp/3p3fJNo0eD WAT -- more verbose help␤»
14:42 garu_ FROGGS: thanks!
14:42 FROGGS garu_: so one usage is subcommand style things#
14:42 FROGGS -#
14:46 garu_ FROGGS: yeah, really interesting!
14:47 virtualsue joined #perl6
14:50 rje_ joined #perl6
14:50 timotimo hoelzro: well? :)
14:55 rje_ Is +camelia written in Perl6?
14:55 moritz rje_: no
14:56 moritz I guess it could be now
14:56 moritz but back then, Perl 6 wasn't stable enough
14:56 timotimo only if enough hours in the day
14:57 rje_ Gotcha.  Hey, due to the bad rep Perl5 has from the millennials here at work, maybe I should refer to Perl6 as "Camelia".
14:57 [Coke] rje_: the main implementation is Rakudo - just lead with that.
14:57 timotimo moritz: i think i already asked this, but i don't know if there was an answer yet. should we get collectd onto more than just hack.p6c.org?
14:57 cdg_ joined #perl6
14:58 moritz timotimo: you mean on the webserver too?
14:58 rje_ Code: I was thinking that last week, but it's weirder-sounding.
14:58 moritz timotimo: +1 from me
14:58 rje_ er, Coke
14:58 timotimo or on the VM host?
14:59 moritz timotimo: maybe that too
14:59 stmuk the most simple solution for http://rakudo.org/downloads/ and similar might be to create an 'archive' directory and move anything preXmas into it
14:59 moritz or maybe start to introduce subdirs for the years
14:59 rje_ Coke: your server is in TX.  Are you in Texas?
14:59 moritz downloads/rakudo/2016/
15:00 rje_ Coke: I'm in Plano
15:00 timotimo stmuk: awwaiid is already working on a pretty little page for downloadingus
15:00 [Coke] rje_: I am not logged in from texas. :)
15:01 stmuk ah good
15:01 [Coke] Coincidentally, I lived in Houston for 2 years, worked for Enron.
15:02 timotimo moritz: strange. my reading of https://collectd.org/wiki/index.php/Plugin:CPU makes it seem like we're running some other cpu plugin on our collectd ... but how is that possible?
15:02 dalek perl6.org: 9d04254 | (Steve Mynott)++ | source/downloads/index.html:
15:02 dalek perl6.org: refer to Mac binary .dmg
15:02 dalek perl6.org: review: https://github.com/perl6/p​erl6.org/commit/9d042543dc
15:03 rje_ Coke: unfortunately, our young over here are an opinionated lot.
15:07 moritz timotimo: dunno; I did a pretty minimal installation and stopped working on at as soon as it works
15:07 kurahaupo joined #perl6
15:07 timotimo hum. interesting
15:07 timotimo why don't i have my password on my desktop?
15:07 * timotimo grabs laptop
15:08 Zero_Dogg joined #perl6
15:08 Zero_Dogg joined #perl6
15:09 timotimo better now
15:10 RabidGravy joined #perl6
15:21 hoelzro timotimo: sorry, was commuting; which segfault?
15:24 apiw joined #perl6
15:24 timotimo hoelzro: getexpayload on unitialized exceptions
15:26 secwang joined #perl6
15:26 hoelzro ahhh
15:27 hoelzro getpayload is fine; it just fails when I do my $inner := nqp::getpayload($_); my $ex-type := nqp::what($inner).HOW.name(nqp::what($inner))
15:29 hoelzro status update on the multi-line input branch: it now passes roast
15:29 timotimo damn, i misread your commit in that case
15:29 timotimo so my patch is useless? :<
15:29 hoelzro timotimo: that just means I miswrote it =/
15:29 hoelzro sorry =(
15:29 jnthn Fixing Moar SEGVs isn't really useless :)
15:30 timotimo moritz: how do we feel about having a notification from collectd when we have a process that's been eating too much cpu time? perhaps something like that is possible
15:30 timotimo (otherwise, it could probably be written in perl6 ;)  )
15:30 hoelzro jnthn: it certainly doesn't hurt =)
15:30 timotimo jnthn: i didn't actually check if you could get a segfault from that ... :|
15:31 timotimo i didn't know what would be required to reproduce hoelzro's segfault from getexpayload
15:31 hoelzro it wasn't getexpayload that was segfaulting
15:31 hoelzro but nqp::what(nqp::getpayload($ex)) should probably never segfault
15:31 timotimo well, if it was returning c-level null, it could be causing the segfault
15:31 hoelzro mhmm
15:31 timotimo i put in a line that makes sure when it's null it gives VMNull instead
15:31 timotimo which can be WHAT'd
15:32 sufrostico joined #perl6
15:32 apiw joined #perl6
15:32 hoelzro oh, then it wasn't for nothing!
15:32 hoelzro timotimo++ # fixing other's bug
15:32 hoelzro *bugs
15:34 timotimo great!
15:38 timotimo i activated the "aggregation" plugin for collectd. it should now show a "all cpu usages added" graph on the cpu page, too
15:38 * geekosaur misreads "aggravation"...
15:38 timotimo but i don't really know when that'll kick in. i've "systemctl restart collectd"
15:48 MadcapJake timotimo, wrt rakudo.org/downloads: http://adamwhitcroft.com/apaxy/ looks really nice
15:49 timotimo pretty!
15:49 timotimo we'd have to have someone with shell access to rakudo.org, though, i imagine
15:50 timotimo or we just use one of the probably millions of applicable wordpress exploits on it ...
15:50 MadcapJake lol
15:50 hoelzro oh, I forgot to finish my status report! the multi-line stuff works pretty well, except for class definitions
15:50 hoelzro it really doesn't like those =/
15:52 MadcapJake anyone been following @perlhex? Curious if people are enjoying the content.  Could use some more retweets to get the account more followers too!
15:52 * timotimo is following it
15:53 timotimo the last few tweets i saw, i enjoyed
15:53 timotimo the ~= i found a bit strange, though
15:53 MadcapJake lol, i was trying to evoke "this was recently added to the docs" and thought I'd do something perl6ish :D
15:54 timotimo heh
15:54 timotimo okay, that's cute :)
15:59 ugexe should i be concerned if --profile always crashes a program? or is it just --profile is kinda fragile?
15:59 timotimo --profile might immediately die if you use anything multi-threaded or asynchronous I/O
15:59 ugexe ah
16:00 timotimo HA!
16:00 timotimo the aggregation plugin works now and has the cpu sum
16:07 khw joined #perl6
16:07 moritz /w 10
16:08 Cabanossi joined #perl6
16:10 kaare_ In Perl 5 it's rather common to pass a scalar to a sub, and then in there decide what to do based on the type [if (ref $parm eq 'ARRAY') {...}]
16:10 hoelzro multi subs?
16:10 kaare_ is there a common idiom to handle that in Perl 6?
16:10 kaare_ That's not always really efficient.
16:10 hoelzro multi sub handle-it(Int $n) { ... } multi sub handle-it(Str $s) { ... }
16:10 [Coke] hoelzro++ is correct.
16:11 kaare_ But I guess that's the canonical answer :-)
16:11 [Coke] What makes you say it's not efficient?
16:11 [Coke] Have you profiled it?
16:11 Actualeyes joined #perl6
16:12 kaare_ Ah, no. Don't mean performance.
16:14 kaare_ Just that it leads to too much clutter in some cases.
16:14 hankache joined #perl6
16:15 kaare_ I guess I'll try to rewire it one step further up.
16:17 rindolf joined #perl6
16:17 alpha123 How's that cluttered? IMO it's *way* nicer than a bunch of if ... { ... }
16:17 hoelzro I think (personally) that multi subs are a lot less cluttered than if($type_check_1) { ... } elsif($type_check2) { ... }
16:18 Cabanossi joined #perl6
16:19 kaare_ I agree that the perl 5 way is ugly too. Or rather that the construct probably never should have existed in the old code.
16:22 musiKk joined #perl6
16:23 RabidGravy I actually remade a large given/when into a bunch of multis with literal parameters yesterday, much prettier
16:29 hankache joined #perl6
16:30 hankache hola #perl6
16:30 MadcapJake kaare_, as RabidGravy pointed out, given/when is another possible solution
16:30 fireartist m: Str.WHAT.say
16:30 camelia rakudo-moar 691b39: OUTPUT«(Str)␤»
16:31 fireartist say( "X: " ~ Str.WHAT )
16:31 fireartist why doesn't .WHAT want to concat?
16:32 hankache m: say( "X: " ~ Str.WHAT )
16:32 camelia rakudo-moar 691b39: OUTPUT«Use of uninitialized value of type Str in string context␤Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed.  in block <unit> at /tmp/UWxEQCR6OI line 1␤X: ␤»
16:32 fireartist ok, right, thanks :-)
16:32 timotimo kaare_: probably better than having a bunch of ifs is to have a given/when
16:32 hankache m: say( "X: " ~ .WHAT )
16:32 camelia rakudo-moar 691b39: OUTPUT«Use of uninitialized value of type Any in string context␤Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed.  in block <unit> at /tmp/8NJRRE5veT line 1␤X: ␤»
16:32 hankache m: say( "X: " "X"~ .WHAT )
16:32 camelia rakudo-moar 691b39: OUTPUT«5===SORRY!5=== Error while compiling /tmp/DkY8hUlwTu␤Unable to parse expression in argument list; couldn't find final ')' ␤at /tmp/DkY8hUlwTu:1␤------> 3say( "X: "7⏏5 "X"~ .WHAT )␤    expecting any of:␤        infix␤        infix stop…»
16:32 timotimo hankache: you want .WHAT.^name
16:32 timotimo or .WHAT.gist
16:33 hankache timotimo i was helping fireartist
16:33 timotimo oh
16:33 timotimo OK
16:33 hankache fireartist what are you trying to do?
16:33 MadcapJake fireartist, or Str.WHICH
16:33 timotimo .WHICH has a quite different use-case
16:34 timotimo m: say "hello how are you".WHICH
16:34 camelia rakudo-moar 691b39: OUTPUT«Str|hello how are you␤»
16:34 fireartist just printing some debugging - was surprised it didn't do as I expected
16:34 MadcapJake m: say( "X: " ~ Str.WHICH )
16:34 camelia rakudo-moar 691b39: OUTPUT«X: Str␤»
16:34 kaare_ thanks hankache/timotimo but I'm stepping back a little to see if I can avoid the ugliness completely.
16:35 MadcapJake timotimo, on a type, WHICH seems to just concatenate the type name
16:35 MadcapJake *when used with ~
16:36 timotimo kaare_: you can also just try to call a method on something and catch exceptions and stuff like that
16:36 timotimo or try to coerce to a different type and catch exceptions when it doesn't work
16:38 RabidGravy this diff shows refactoring a given/when to multi with literal parameters https://github.com/jonathanstowe/Audio-Liquidsoap​/commit/ac6582192070863b01142342ca0393fe4de3b687
16:40 MadcapJake with the lovely github showing it's syntax highlighting muscles...
16:40 MadcapJake s/it's/its/
16:42 timotimo yeah
16:44 apiw joined #perl6
16:44 mamadama joined #perl6
16:51 abaugher joined #perl6
17:00 timotimo i'm not sure how to remove the aggregation/ stuff, since apparently collectd-web keeps that around
17:00 timotimo even though since i moved the output into the cpu plugin's tab there'll not be new data there
17:02 domidumont joined #perl6
17:05 hoelzro should I merge in the multi-line input work, in spite of its problem with classes?
17:05 hoelzro I think it's better than nothing, but at the same time I think it might irritate users
17:10 geekosaur can you make it switchable?
17:11 skids Rabidgravy: you shouldn't need the else { Empty } these days.
17:11 skids m: say (if (0) { }); say (Empty)
17:11 camelia rakudo-moar 691b39: OUTPUT«()␤()␤»
17:13 hoelzro geekosaur: switchable? so one can turn off the feature?
17:13 RabidGravy yeah, I think it's superstitious after I found a case where it did matter
17:14 geekosaur yeh. $*MULTILINE-INPUT or some such so they can play with it and if it's too annoying push it out of the way
17:19 jnthn Maybe an env var
17:20 lostinfog joined #perl6
17:22 hoelzro ok
17:22 hoelzro I'll add that later and merge it
17:25 ZoffixW joined #perl6
17:26 ZoffixW m: say "㊤".uniname.words.first: :end
17:26 camelia rakudo-moar 691b39: OUTPUT«This Seq has already been iterated, and its values consumed␤(you might solve this by adding .cache on usages of the Seq, or␤by assigning the Seq into an array)␤  in block <unit> at /tmp/o5PFGbXALC line 1␤␤»
17:26 ZoffixW :/
17:26 ZoffixW m: say "㊤".uniname.words.first
17:26 camelia rakudo-moar 691b39: OUTPUT«CIRCLED␤»
17:28 jts joined #perl6
17:29 ZoffixW m: say "㊤৫".comb».uniname».words».[*-1]
17:29 camelia rakudo-moar 691b39: OUTPUT«(HIGH FIVE)␤»
17:29 ZoffixW :D
17:30 telex joined #perl6
17:31 jts left #perl6
17:31 TimToady m: say "㊤৫".uninames».words»[*-1]
17:31 camelia rakudo-moar 691b39: OUTPUT«(HIGH FIVE)␤»
17:32 timotimo oh hey TimToady
17:32 timotimo ZoffixW: i see your twitter exchange and ... oh well ...
17:36 ZoffixW heh
17:36 ZoffixW It's the equivalent of shouting "get a horse" at the dawn of automobile age :)
17:43 leont joined #perl6
17:46 jnthn o/ TimToady
17:48 Actualeyes left #perl6
17:54 RabidGravy I might finally write Test::Kinda so I can express a "to be honest if only one or two fail then it's a pass" ;-)
17:55 xiaomiao RabidGravy: have a look at glibc test suite then
17:55 ely-se joined #perl6
17:55 RabidGravy I think at this stage I'd rather not to be frank ;-)
17:57 dolmen joined #perl6
17:57 RabidGravy testing against an external software that has its own view of deterministic scheduling with several distinct clocks is proving to be quite annoying
18:00 RabidGravy oh well, my back, my rod ....
18:02 firstdayonthejob joined #perl6
18:02 Kermi joined #perl6
18:04 Kermi Hi, I am reading http://perl6intro.com/#_what_is_perl_6 and I wonder Can we use perl6 with apache with mod_perl ?
18:05 [Coke] mod_perl is perl5
18:05 [Coke] (so, no)
18:06 TimToady m: say "艹"
18:06 camelia rakudo-moar 691b39: OUTPUT«艹␤»
18:06 TimToady I don't want to canonicalize that character
18:06 stmuk most perl 5 people have moved from mod_perl anyway
18:07 TimToady I want to be able to mention that variant in my file without it going away.
18:08 TimToady jnthn: ^^
18:08 ggoebel16 joined #perl6
18:08 Kermi :) Thanks
18:09 Kermi What can I use for Apache and Perl6?
18:10 RabidGravy I'm not even clear in my mind how a mod_rakudo fir instance would work
18:10 RabidGravy Kermi, right now it's start a separate server and use Apache as a proxy
18:10 stmuk kermi: psgi
18:11 Kermi RabidGravy, where can read more about this?
18:11 sufrostico joined #perl6
18:12 RabidGravy about which part?
18:12 Kermi [20:10] <RabidGravy> Kermi, right now it's start a separate server and use Apache as a proxy
18:12 RabidGravy right, which part?
18:12 Kermi How to connect perl6 with apache
18:12 RabidGravy er
18:13 RabidGravy the Apache documentation describes how to use it as a frontend proxy for another application
18:14 RabidGravy (though I think all the cool kids are using nginx or something else for this purpose these days)
18:15 jnthn TimToady: That'd be part of NFC, no?
18:15 bowtie joined #perl6
18:15 jnthn .u 艹
18:15 yoleaux U+FA5E CJK COMPATIBILITY IDEOGRAPH-FA5E [Lo] (艹)
18:16 jnthn m: say Uni.new(0xFA5E)
18:16 camelia rakudo-moar 691b39: OUTPUT«Uni:0x<fa5e>␤»
18:16 jnthn m: say Uni.new(0xFA5E).NFC
18:16 camelia rakudo-moar 691b39: OUTPUT«NFC:0x<8279>␤»
18:16 jnthn Yeah
18:16 jnthn Almost certainly a singleton decomposition.
18:17 jnthn There's not a good way yet, anyways. It's in Uni territory.
18:17 Kermi RabidGravy thanks
18:18 jnthn But we don't have uni literals yet.
18:18 jnthn And even when we do, we'll need to work out what happens if you try to concatenate them with Str.
18:19 jnthn .oO( NFG is a good default, but perhaps sometimes a bit too good... :P )
18:20 RabidGravy Kermi, there are several things in the Perl 6 ecosystem that allow making a web application server, Bailador, Crust and so forth, you probably want to peruse a couple of those in the first instance
18:20 dbrunton joined #perl6
18:21 stmuk Kermi: http://examples.perl6.org/categories/cookb​ook/19cgi-programming/19-01cgi-script.html
18:22 stmuk that's one miminal way of doing it and you would probably proxypass off apache or nginx to that port
18:22 mamadama joined #perl6
18:24 addison_ joined #perl6
18:24 Kermi I will read how to proxypass it. Thanks
18:24 timotimo i'm showing the "An Earthshaking Announcement" to a friend right now %)
18:29 jnthn noms &
18:29 hankache joined #perl6
18:31 Vitrifur joined #perl6
18:33 Laurent_R joined #perl6
18:37 cdg joined #perl6
18:39 spider-mario joined #perl6
18:41 TimToady m: say "𢡊"
18:41 camelia rakudo-moar 691b39: OUTPUT«(signal SEGV)»
18:42 TimToady jnthn: ^^ there's another glitch :)
18:42 bowtie_ joined #perl6
18:43 timotimo can you also make that with a \x literal, so that i can more easily copy-paste it?
18:47 TimToady m: say "\xfacf"
18:47 camelia rakudo-moar 691b39: OUTPUT«(signal SEGV)»
18:47 TimToady m: say "\xfad0"
18:47 camelia rakudo-moar 691b39: OUTPUT«(signal SEGV)»
18:48 [Coke] O_o
18:48 TimToady m: say "\xfad9"
18:48 camelia rakudo-moar 691b39: OUTPUT«龎␤»
18:49 TimToady m: say "\xfad8"
18:49 camelia rakudo-moar 691b39: OUTPUT«齃␤»
18:49 TimToady m: say "\xfad7"
18:49 camelia rakudo-moar 691b39: OUTPUT«(signal SEGV)»
18:49 TimToady there's the boundary
18:50 TimToady that trailing boundary, facf is the leading boundary
18:50 TimToady timotimo: thanks
18:50 FROGGS joined #perl6
18:51 timotimo er, thanks why exactly?
18:52 TimToady for copy-pasting it :)
18:52 timotimo damn, you expect me to fix that bug now? ;)
18:52 TimToady or at least for wanting to copy-paste it :)
18:53 timotimo 48543    const MVMint32 *pcs  = comp_p[plane][upper][lower];
18:53 timotimo the values of the indices are, respectively, <optimized out>, <optimized out>, and <optimized out>
18:53 timotimo :P
18:53 TimToady cool!
18:54 TimToady "Nobody will ever use those characters!"
18:54 timotimo 2, 126, and 211
18:55 timotimo (gdb) print comp_p[2][126]
18:55 timotimo $5 = (const MVMint32 **) 0x0
18:56 * TimToady notes that those are, in fact, plane 0 characters
18:56 timotimo so ... do we actually expect there to be something?
18:57 TimToady I wouldn't expect to find something in plane 2 for them, no :)
19:01 domidumont1 joined #perl6
19:01 timotimo i personally haven't a clue what that particular piece of code is precisely supposed to achieve; you said it's supposed to be plane 0, do you know why it'd get plane 2 instead?
19:02 timotimo given plane is just (l >> 16) & 0xF
19:03 _mg_ joined #perl6
19:03 TimToady maybe upstream, the same remapping thingy that turns 艹 into 艹 is turning those compat chars into something in plane 2?
19:03 TimToady but then they should find something
19:04 TimToady m: say "𢡊".ord.base(16)
19:04 camelia rakudo-moar 691b39: OUTPUT«2284A␤»
19:04 prammer joined #perl6
19:04 TimToady yeah, looks like that's what's going on
19:05 TimToady m: say "𢡊".ord.base(16).chr
19:05 camelia rakudo-moar 691b39: OUTPUT«Cannot convert string to number: trailing characters after number in '2284⏏5A' (indicated by ⏏)␤  in block <unit> at /tmp/fFGuCOiKMA line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/fFGuCOiKMA line 1␤␤»
19:05 TimToady m: say "𢡊".ord..chr
19:05 camelia rakudo-moar 691b39: OUTPUT«5===SORRY!5===␤Argument to "chr" seems to be malformed␤at /tmp/EXvSTh8KTb:1␤------> 3say "𢡊".ord..chr7⏏5<EOL>␤Other potential difficulties:␤    Unsupported use of bare "chr"; in Perl 6 please use .chr if you meant $_, or use an expli…»
19:05 TimToady m: say "𢡊".ord.chr
19:05 camelia rakudo-moar 691b39: OUTPUT«(signal SEGV)»
19:05 TimToady m: say "\x2284a"
19:05 camelia rakudo-moar 691b39: OUTPUT«(signal SEGV)»
19:06 timotimo https://gist.github.com/timo/0566aa167dbf0996bab9
19:06 timotimo that's the full backtrace of the thing you originally made copy-pastable
19:06 TimToady m: say "𢡊"
19:06 camelia rakudo-moar 691b39: OUTPUT«(signal SEGV)»
19:06 TimToady that's the actual plane 2 character that can't print
19:11 avenj joined #perl6
19:17 mr-foobar joined #perl6
19:18 leont joined #perl6
19:20 peter joined #perl6
19:26 eyck joined #perl6
19:27 rurban joined #perl6
19:30 prammer joined #perl6
19:30 AlexDaniel joined #perl6
19:32 b2gills TimToady: should storing a fail in a variable stop it from going into $! ( unless you ask it the wrong question ) 「{my $ = sub {fail 'e'}();Nil}; say $! === Nil」
19:33 arnsholt timotimo: IME, those <optimised out> values can frequently be recovered if you are one of those people who are able to remember which registers are used to pass arguments into a function
19:33 arnsholt Sadly, I'm not one of those people =(
19:35 [particle] joined #perl6
19:37 b2gills TimToady: I'm thinking it shouldn't fail at the end of the scope 「{my @a = { Bool.pick ?? ++$ !! sub {fail}() } ... *;Nil}」 Otherwise the only way to deal with this example would be to look at the internals of Array and handle the Failures that have already been generated.
19:40 addison_ joined #perl6
19:57 skids b2gills: it is not that it is stored, it is that it is not sunk.
20:00 timotimo arnsholt: oh, that's a good idea actually. from the moar jit i know that a little bit
20:01 arnsholt Yeah, if you know it, it's useful
20:01 arnsholt And there's a command to dump the contents of the registers as well, obv
20:05 kamel joined #perl6
20:05 timotimo print %foo should already do it, i think?
20:06 arnsholt Probably
20:07 brrt joined #perl6
20:08 moritz \o
20:09 hanekomu joined #perl6
20:10 timotimo moritz: do you happen to know if collectd-web has its own data store somewhere? that may need a tiny bi tof cleanup so that the aggregated cpu thingies that no longer get updates won't show any more
20:10 moritz timotimo: I don't think so; I think it just looks a the list of rrd files in some directories
20:10 moritz timotimo: so just delete the old rrd files
20:11 timotimo ah. but i looked into the folder where it seemed like collectd was putting the rrd files and i didn't see the "old"/obsolete ones there
20:11 moritz hm
20:12 timotimo does collectd-web run on hack? if so, how should i transport the data from other hosts over to hack or make it reachable for collectd-web?
20:12 moritz yes to the first
20:13 moritz and to the second: you can configure collectd on a second host to forward the data to hack
20:14 moritz https://collectd.org/wiki/inde​x.php/Networking_introduction
20:32 dalek perl6-roast-data: 3d732a0 | (Heiko Jansen)++ | perl6_pass_rates.csv:
20:32 dalek perl6-roast-data: Remove incomplete entries
20:32 dalek perl6-roast-data:
20:32 dalek perl6-roast-data: A bunch of rows for rakudo.moar-jit with an insufficient number of fields broke github CSV formatting.
20:32 dalek perl6-roast-data: Since there are other entries from the same day and with the same sha1 hash I simply deleted the corrupted data sets.
20:32 dalek perl6-roast-data: review: https://github.com/coke/perl6​-roast-data/commit/3d732a092d
20:32 dalek perl6-roast-data: 473e8d5 | (Will Coleda)++ | perl6_pass_rates.csv:
20:32 dalek perl6-roast-data: Merge pull request #12 from heikojansen/patch-1
20:32 dalek perl6-roast-data:
20:32 dalek perl6-roast-data: Remove incomplete entries
20:32 dalek perl6-roast-data: review: https://github.com/coke/perl6​-roast-data/commit/473e8d57bf
20:32 kamel joined #perl6
20:34 [Coke] so, the daily tests I'm running on hack are getting stuck again.
20:34 [Coke] no one else is seeing weird hangs running stresstest?
20:35 ely-se joined #perl6
20:37 bartolin [Coke]: I've seen integration/advent2013-day14.t hanging lately (see http://irclog.perlgeek.de/p​erl6/2016-02-08#i_12007689)
20:37 bartolin [Coke]: but this week I saw no hangs
20:40 ChoHag joined #perl6
20:43 ryan__ joined #perl6
20:46 [Coke] joined #perl6
20:46 rurban joined #perl6
20:48 [particle] joined #perl6
20:48 [Coke] argh, killed my screen session accidentally.
20:49 prammer joined #perl6
20:49 dalek perl6-roast-data: 4c3e1d0 | coke++ | / (7 files):
20:49 dalek perl6-roast-data: today (automated commit)
20:49 dalek perl6-roast-data: review: https://github.com/coke/perl6​-roast-data/commit/4c3e1d0cd9
20:49 dalek perl6-roast-data: 197eac5 | coke++ | / (2 files):
20:49 dalek perl6-roast-data: today (automated commit)
20:49 dalek perl6-roast-data: review: https://github.com/coke/perl6​-roast-data/commit/197eac5e85
20:52 [particle]1 joined #perl6
20:56 prammer joined #perl6
20:59 timotimo https://video.fosdem.org/2016/STATUS.txt - has significantly changed
20:59 timotimo luckily we were in 2214, not in 2215
20:59 [particle] joined #perl6
20:59 timotimo because in 2215, more than half the videos got lost
21:01 raiph joined #perl6
21:05 * hoelzro was so confused reading that
21:05 dolmen joined #perl6
21:05 hoelzro I was going to say "2215?! Perl 6 really *is* a one-hundred year language!"
21:07 jnthn TimToady: 'fraid I'm too tired to go SEGV hunting tonight on that one...please do RT it.
21:17 leobut joined #perl6
21:22 pmurias joined #perl6
21:22 [particle]1 joined #perl6
21:30 revhippie joined #perl6
21:30 leobut joined #perl6
21:33 leobut joined #perl6
21:34 prammer joined #perl6
21:50 prammer joined #perl6
21:58 brrt joined #perl6
22:08 cpage_ joined #perl6
22:10 AlexDaniel I see that all bugs in RT have 0 priority. Is it OK use priority other than 0?
22:16 AlexDaniel e.g. for segfaults?
22:19 moritz AlexDaniel: I don't think it'll accomplish anything
22:20 moritz AlexDaniel: people who work on bugs have their own judgment about their relative priorities
22:22 TEttinger joined #perl6
22:23 perlpilot joined #perl6
22:30 [Coke] make sure the title has [SEGV] or Segmentation Fault in it.
22:31 AlexDaniel okay
22:39 virtualsue joined #perl6
22:46 test joined #perl6
22:46 pmurias AlexDaniel: are segfaults really higher priority?
22:46 AlexDaniel pmurias: imo yes
22:47 hippie joined #perl6
22:48 apiw joined #perl6
22:48 Hotkeys b2gills: are you around?
22:48 b2gills Hotkeys: nope ... wait a minute
22:49 b2gills that was meant as a joke
22:49 Hotkeys :p
22:49 Hotkeys I have a solution for "How even is a number" that is 23 bytes, but it's significantly different from yours
22:49 Hotkeys Should I post it as my own?
22:49 Hotkeys Or would it be better for you to add it to yours
22:50 Hotkeys I'm not sure what the protocol is here
22:51 Hotkeys b2gills:
22:52 b2gills If it is a vastly different approach, go ahead and post it if you want
22:52 b2gills really there is no hard and fast rules
22:52 Hotkeys mmkay
22:54 Hotkeys posted
22:54 Hotkeys m: my &f = {elems $_,*/2...^*!%%2}; say f(14); say f(20); say f(94208); say f(7); say f(-4)
22:54 camelia rakudo-moar 691b39: OUTPUT«1␤2␤12␤0␤2␤»
22:55 Hotkeys actually
22:55 Hotkeys m: my &f = {+($_,*/2...^*!%%2)}; say f(14); say f(20); say f(94208); say f(7); say f(-4)
22:55 camelia rakudo-moar 691b39: OUTPUT«1␤2␤12␤0␤2␤»
22:55 Hotkeys neat
22:56 b2gills {+($_,*/2...^*%2)}
22:56 Hotkeys :p
22:56 Hotkeys oh
22:57 Hotkeys I didn't realize that would work
22:58 apiw joined #perl6
22:58 Hotkeys oh
22:58 Hotkeys right
22:59 Hotkeys I forgot that it would be okay with a truthy value
23:00 Hotkeys and not just a True
23:00 Hotkeys weird
23:00 Hotkeys I can't get !% to work outside that example
23:00 b2gills In Perl 5 there is no True and False, but there are still if statements
23:00 Hotkeys m: say 3 !% 2
23:00 camelia rakudo-moar 691b39: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Rd78q5E7l3␤Cannot negate % because multiplicative operators are not iffy enough␤at /tmp/Rd78q5E7l3:1␤------> 3say 3 !7⏏5% 2␤    expecting any of:␤        infix␤        infix stopper␤»
23:01 Hotkeys I mean I know that it would accept a truthy value logically
23:01 Hotkeys I just didn't think about it
23:02 Hotkeys because I'm used to doing like * > 10 or whatever in a sequence
23:02 Hotkeys so my mind was like "It's gotta be a boolean"
23:02 rje_ m: say "hello?"
23:02 camelia rakudo-moar 691b39: OUTPUT«hello?␤»
23:02 rje_ wow, cool
23:03 b2gills m: say "hello?".comb(/\w/).perl
23:03 camelia rakudo-moar 691b39: OUTPUT«("h", "e", "l", "l", "o").Seq␤»
23:03 rje_ comb!  So that's what I should be using instead of split!
23:03 rje_ thanks for that
23:04 rje_ m: say "hello?".split('')
23:04 camelia rakudo-moar 691b39: OUTPUT«( h e l l o ? )␤»
23:04 b2gills m: say "hello?".split('').perl
23:04 camelia rakudo-moar 691b39: OUTPUT«("", "h", "e", "l", "l", "o", "?", "")␤»
23:04 rje_ it inserts undef thingies, see
23:04 rje_ unlike perl5
23:05 rje_ not the principle of least surprise to a Perl5 person :)
23:05 b2gills You can get Perl 5 to return them as well
23:05 Hotkeys sometimes split can be the same bytecount for a problem
23:05 rje_ eeek
23:05 rje_ m: say "hello?".split('').gist
23:05 camelia rakudo-moar 691b39: OUTPUT«( h e l l o ? )␤»
23:06 rje_ d'oh
23:07 b2gills I guess it's only the trailing empty string that you can get from Perl 5 「split "", "hello", -1」
23:07 Hotkeys m: say "11a1".comb(/\d+/).sum == "11a1".split(/\D/).sum
23:07 camelia rakudo-moar 691b39: OUTPUT«True␤»
23:07 atweiden joined #perl6
23:07 Hotkeys :D
23:07 Hotkeys b2gills: perhaps you could add the split version as an alternate on your filter and add answer?
23:08 Hotkeys I know they're effectively the same
23:08 Hotkeys byte count and all
23:08 sortiz joined #perl6
23:08 Hotkeys up to you
23:08 sortiz \o #perl6
23:08 Hotkeys \o
23:08 cpage_ joined #perl6
23:09 sortiz Still golfing Hotkeys? :)
23:10 Hotkeys of courwse
23:10 atweiden m: %h[0] = :zero(0); say %h.perl
23:10 camelia rakudo-moar 691b39: OUTPUT«5===SORRY!5=== Error while compiling /tmp/3Q5_xJEohQ␤Variable '%h' is not declared␤at /tmp/3Q5_xJEohQ:1␤------> 3<BOL>7⏏5%h[0] = :zero(0); say %h.perl␤»
23:10 atweiden m: my %h; %h[0] = :zero(0); say %h.perl
23:10 camelia rakudo-moar 691b39: OUTPUT«{:zero(0)}␤»
23:10 atweiden can anyone say what indexing a Hash type with a [0] accessor does?
23:11 Hotkeys m: my %h = a=>foo, b=>bar, c=>baz; say %h[0]
23:11 camelia rakudo-moar 691b39: OUTPUT«5===SORRY!5=== Error while compiling /tmp/z9ci6P85Yw␤Undeclared routines:␤    bar used at line 1. Did you mean 'VAR', 'bag'?␤    baz used at line 1. Did you mean 'bag'?␤    foo used at line 1␤␤»
23:11 Hotkeys m: my %h = a=>'foo', b=>'bar', c=>'baz'; say %h[0]
23:11 camelia rakudo-moar 691b39: OUTPUT«a => foo, b => bar, c => baz␤»
23:12 Hotkeys m: my %h = a=>'foo', b=>'bar', c=>'baz'; say %h[1]
23:12 camelia rakudo-moar 691b39: OUTPUT«Index out of range. Is: 1, should be in 0..0␤  in block <unit> at /tmp/GWFIZK16H9 line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/GWFIZK16H9 line 1␤␤»
23:12 b2gills Any non-positional will return itself when you use [0]
23:12 Hotkeys m: my %h = a=>'foo', b=>'bar', c=>'baz'; say %h.pairs[1]
23:12 camelia rakudo-moar 691b39: OUTPUT«c => baz␤»
23:12 Hotkeys m: my %h = a=>'foo', b=>'bar', c=>'baz'; say %h.pairs
23:12 camelia rakudo-moar 691b39: OUTPUT«(a => foo c => baz b => bar)␤»
23:12 Hotkeys oh hashes
23:12 Hotkeys ohhhh you
23:13 b2gills m: my %h; %h[0][0][0][0][0][0][0][0][0][0][0][​0][0][0][0][0][0][0][0][0][0][0][0] = :zero(0); say %h.perl
23:13 camelia rakudo-moar 691b39: OUTPUT«{:zero(0)}␤»
23:13 dalek ecosystem: 809e5ff | (Claudio Ramirez)++ | META.list:
23:13 dalek ecosystem: Move to META6.json
23:13 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/809e5ff39b
23:13 dalek ecosystem: cb66171 | nxadm++ | META.list:
23:13 dalek ecosystem: Merge pull request #153 from nxadm/master
23:13 dalek ecosystem:
23:13 dalek ecosystem: Move to META6.json
23:13 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/cb661718b1
23:13 Hotkeys that's a lot of zeroes
23:13 b2gills It's a lot of zeros that don't matter
23:13 sortiz atweiden, indexing any not Positional returns its type if index == 0, otherwise a Failure
23:14 timotimo i'd be glad if ecosystem commits were a bit more informative about what they do ... like, in the first line of the commit ...
23:14 timotimo and extra nice if they include a line that points at the github repository page of the module itself
23:15 b2gills some of them have had a line that pointed at the repository
23:16 timotimo yes
23:16 timotimo i was really glad about those when i wrote one of the weeklies
23:17 atweiden i'm having difficult seeing where indexing a non-positional with [0] would be practically useful. any hints?
23:17 atweiden why wouldn't it raise an exception?
23:19 timotimo that's the thing where single things pretend to be a list of a single thing
23:19 timotimo m: my $foo = 10; $foo[1] = "hi";
23:19 camelia rakudo-moar 691b39: OUTPUT«Index out of range. Is: 1, should be in 0..0␤  in block <unit> at /tmp/L_XsAgqY9h line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/L_XsAgqY9h line 1␤␤»
23:19 timotimo that kind of thing still b0rks
23:19 sortiz m: 1.elems
23:19 camelia rakudo-moar 691b39: ( no output )
23:19 sortiz m: 1.elems.say
23:19 camelia rakudo-moar 691b39: OUTPUT«1␤»
23:20 sortiz m: "foo".elems.say
23:20 camelia rakudo-moar 691b39: OUTPUT«1␤»
23:21 sortiz atweiden, that way other common operations degrade gratefully
23:23 Hotkeys is .reverse the shortest way to reverse a list?
23:23 Hotkeys er nevermind
23:25 Zero_Dogg joined #perl6
23:28 atweiden m: try { @a[-8]; CATCH { default { say $_.perl } } }
23:28 camelia rakudo-moar 691b39: OUTPUT«5===SORRY!5=== Error while compiling /tmp/oJWzT1pOHZ␤Unsupported use of a negative -8 subscript to index from the end; in Perl 6 please use a function such as *-8␤at /tmp/oJWzT1pOHZ:1␤------> 3try { @a[-8]7⏏5; CATCH { default { say $_.perl }…»
23:28 atweiden is there a way to catch that error?
23:28 atweiden m: try { my @a = 0, 1, 2; @a[-8]; CATCH { default { say $_.perl } } }
23:28 camelia rakudo-moar 691b39: OUTPUT«5===SORRY!5=== Error while compiling /tmp/ou_oO_IAUq␤Unsupported use of a negative -8 subscript to index from the end; in Perl 6 please use a function such as *-8␤at /tmp/ou_oO_IAUq:1␤------> 3try { my @a = 0, 1, 2; @a[-8]7⏏5; CATCH { defaul…»
23:28 sortiz A CATCH block
23:28 geekosaur atweiden, the ==SORRY== tells you it's compile time
23:29 geekosaur hard to use runtime code to catch a compile time error
23:29 atweiden i see
23:31 * sortiz .. can be used to catch runtime... early <ENTER>
23:36 sortiz Ups:
23:36 sortiz m: my @A[-1];
23:36 camelia rakudo-moar 691b39: OUTPUT«Memory allocation failed; could not allocate 18446744073709551608 bytes␤»
23:36 AlexDaniel m: my $x = -8; try { @a[$x]; CATCH { default { say $_.perl } } }
23:36 camelia rakudo-moar 691b39: OUTPUT«5===SORRY!5=== Error while compiling /tmp/hwg3DIh7YM␤Variable '@a' is not declared␤at /tmp/hwg3DIh7YM:1␤------> 3my $x = -8; try { 7⏏5@a[$x]; CATCH { default { say $_.perl } ␤»
23:36 AlexDaniel m: my @a; my $x = -8; try { @a[$x]; CATCH { default { say $_.perl } } }
23:36 camelia rakudo-moar 691b39: OUTPUT«X::OutOfRange.new(what => "Index", got => -8, range => "0..Inf", comment => Any)␤»
23:37 AlexDaniel ?
23:37 BenGoldberg joined #perl6
23:38 sortiz AlexDaniel, that's the runtime Failure
23:38 AlexDaniel sortiz: sure, why would you want to catch your typos?
23:38 RabidGravy right that's me done for the day.  toodles.
23:38 AlexDaniel Hotkeys: did you figure it out? :)
23:39 AlexDaniel m: my @a = <a b c>; say [R,] @a
23:39 camelia rakudo-moar 691b39: OUTPUT«(c b a)␤»
23:39 Hotkeys I just did something else
23:39 AlexDaniel Hotkeys: ↑ this is probably shorter
23:39 sortiz AlexDaniel, May be not _your_ typos, you are working with someone data.
23:40 AlexDaniel sortiz: you mean if I'm EVAL-ing someone's code?
23:40 Hotkeys m: my @a = <a b c d e f>; say [R,] @a
23:40 camelia rakudo-moar 691b39: OUTPUT«(f e d c b a)␤»
23:40 Hotkeys neat
23:40 apiw joined #perl6
23:41 sortiz AlexDaniel, your $x can be anything, not necessarily declared or assigned in the same scope.
23:43 sortiz AlexDaniel, That the general idea of a try { CATCH {} }, when your expectations can fail.
23:46 AlexDaniel sortiz: if $x is anything then you can use try { CATCH {} } without any problems
23:46 AlexDaniel because it becomes a runtime problem
23:46 sortiz Exactly.
23:47 AlexDaniel the original snippet above had -8 hard coded, and there is no reason to try to catch that
23:47 AlexDaniel that's what I was trying to say
23:48 Pukku joined #perl6
23:48 sortiz There are other methods, but try/CATCH becomes a general way for handling Exceptions and Failures
23:51 sortiz Indeed, if the compiler can see a problem, it is reported at compiler time, otherwise is a runtime problem that can be handled with a try BLOCK
23:54 AlexDaniel Hotkeys: anything fun for today? :)
23:57 Ben_Goldberg joined #perl6

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

Perl 6 | Reference Documentation | Rakudo | Niecza | Specs