»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
AlexDaniel oh, so now github shows the license on top 00:50
dalek k-simple: 64f0f76 | (Richard Hainsworth)++ | examples/01-hello-world.pl6:
_ to - in comments
07:10
k-simple: dc085ff | finanalyst++ | / (4 files):
ScrolledWindow widget & example. Adds auto scrollbars when child too large
k-simple: b885186 | finanalyst++ | examples/01-hello-world.pl6:
Merge branch 'master' of github.com/finanalyst/gtk-simple
k-simple: c6abba8 | finanalyst++ | / (2 files):
adding required files
k-simple: da96500 | (Richard Hainsworth)++ | / (7 files):
Merge pull request #62 from finanalyst/master

ScrolledWindow widget & example + 01-example typos
dalek k-simple: 91f4f35 | finanalyst++ | README.md:
typo in readme
07:19
k-simple: 0741e2a | lizmat++ | README.md:
Merge pull request #65 from finanalyst/master

typo in readme
grondilu .seen Xliff 07:37
yoleaux I saw Xliff 8 Sep 2016 06:28Z in #perl6: <Xliff> Bed time for me, so I will see you, later.
bioduds hey all 08:39
just passing by
to say
I'm drunk!
:)
thanks for Perl6
sjn is sober and like Perl6 too :) 08:40
likes* 08:41
bioduds LOL 08:43
yeah
he must 08:44
Perl6 is so awesome
and I'm not saying it cause I'm drunk
what time is it there? 08:46
im in Brazil
its 5:46 AM here 08:47
you in Europe?
w4and0er96 after reading perl6 inter site, I find I still confuse about many pl6 code for their 'magic' ops or grammar, to figure out 'all' those seems meaningless, and I now still code pl6 in a 'C-like' style. Since I'm a student, where can I find a task that can improve my pl6 coding skill and knowledge? 08:50
bioduds w4and0er96 : currently, youtube p6 principles that the guys who made it are spreading 08:53
check, for instance why they say that perl6 has Math that really works and why
also, check how to make you code fully declarative, a thing perl lets you do 08:54
also, check how grammars work
this may begin to show you the new perl6 programming paradigm
w4and0er96 thx, I'll try it 08:59
Woodi w4and0er96: maybe try to write some perl6 script or module you want to write, that provides instant learning. also helps improve language with real world usages :) 09:15
stmuk_ yes and exactly what you write matters less than writing sommething 09:19
El_Che w4and0er96: like Woodi and stmuk_ say, I also just picked a small project I needed to do and did it in Perl 6 while having the documentation open 10:10
w4and0er96: and #perl6 of course :)
masak greetings, #perl6 11:49
munja hi!
moritz \o masak, munja 11:50
dalek c: a5f5ca0 | (Zoffix Znet)++ | doc/Language/unicode_texas.pod6:
Fix fancy-pants quotes

  - Some alternatives do not reference the quote in question
  - Some alternatives are omited
11:54
FROGGS o/ 11:59
timotimo yo FROGGS :)
masak m: my %names = ma => "sak", mo => "ritz", mu => "nja"; say "hi ", $_, %names{$_} given %names.keys.roll 12:04
camelia rakudo-moar 4578e7: OUTPUT«hi moritz␤»
masak :)
moritz \o
rightfold omg production distribution 12:06
masak .oO( production is already here, it's just unevenly distributed? ) 12:09
rightfold > Undeclared routine: use used at line 2 12:11
Oh I'm an idiot, I missed the "v"
masak was this `use v6;`? 12:20
I find I don't bother most of the time any more.
dogbert17 o/ #perl6
masak apparently I put `use v6;` consistently in .t files, and most of the time in bin/ files 12:21
but almost not at all in .pm files
timotimo m: use 6 12:22
camelia rakudo-moar 6e2a55: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤ use used at line 1␤␤»
dogbert17 does anyone have time to look at some, possibly controversial, changes to the 'eqv' doc in operators.pod6 before I commit them :) gist.github.com/dogbert17/d35362c1...3b63dc1b08
timotimo interesting.
masak today's autopun spotting: twitter.com/dmonbeer/status/773773272639008768 12:28
rightfold masak: "use 6.c;" :P 12:29
masak ah, yes. 12:33
MasterDuke does it make sense to remove module from the ecosystem if they've been obsoleted? 12:34
i wrote the hacky List::Combinations because the rakudo builtins were slower, but now they're faster (and lazy if you want)
timotimo you can deprecate your functions with "is DEPRECATED" iirc 12:35
iirc it allows you to tell the user what you recommend using instead
MasterDuke do that, bump the version, then remove entirely after some time has gone by? 12:36
timotimo yeah 12:38
give it a year or two :P
MasterDuke ha, i don't think it has all that many users other than me
timotimo *shrug* 12:40
MasterDuke but ok, that's what i'll do
dalek c: 44d6add | (Jan-Olof Hendig)++ | doc/Language/operators.pod6:
The description of eqv was slightly outdated
12:43
rightfold Can I pass a Blob to a native function that takes a Pointer[void]? 12:48
or CArray[uint8] 12:50
the documentation says "TBD" 12:51
timotimo you can definitely nativecast a CArray into a Pointer 12:52
i'm not sure about Blob, though.
rightfold I suppose I can fill a CArray from a Blob 12:54
timotimo define a binding to memcpy that takes a Blob and a CArray :) 12:56
actually, you may want to manually memory-manage the thing and use CPointer instead of CArray
if all you want to do is pass the thing into a function
NativeCall really wants to have a way to pretend an array is a pointer and the other way around 12:57
that requires some extra care with regards to what kinds of things may have their storage move around in memory.
AFK for a bit
rightfold timotimo: got it working: lpaste.net/1290423804551495680 12:59
w4and0er96 besides reduce using [op], how can I code equivalently like a.filter(..).reduce(..).filter(..)? 13:26
moritz w4and0er96: filter is called grep 13:32
w4and0er96: reduce is reduce
though after a reduce, you typically only have one item left, so not much point in having another grep/filter after it 13:33
rightfold is it at all possible to serve two clients simultaneously using IO::Socket::INET? or do I have to use IO::Socket::Async? 13:33
because I can't read from a socket that was created in another thread 13:35
MasterDuke pretty sure that's either by design or a known limitation
w4and0er96 moritz: sure, but what if a is array of arrays? at that point I may apply one more grep, although its real world app may rare 13:40
perlawhirl w4and0er96: in most cases i think you're thinking of .map , ie. @AoA.grep( *.elems > 5 ).map( *.sum ).grep( * > 10 ); 13:43
w4and0er96 moritz: got it 'reduce is reduce' :) embarrassed
perlawhirl: yes this case appears more often 13:44
moritz m: say ([1, 2, 3], [4, 5], [6, 8]).filter(*.elems %% 2).map(*.reduce(&infix:<+>)).filter(* %% 2) 13:48
camelia rakudo-moar 20ed9e: OUTPUT«Method 'filter' not found for invocant of class 'List'␤ in block <unit> at <tmp> line 1␤␤»
moritz m: say ([1, 2, 3], [4, 5], [6, 8]).grep(*.elems %% 2).map(*.reduce(&infix:<+>)).grep(* %% 2)
camelia rakudo-moar 20ed9e: OUTPUT«(14)␤»
tadzik wow, cpan's "Panda" namespace is full of stuff 14:04
w4and0er96 why ((1..5), (1..10)).map(&[+]) produce (15) ? I just thought it #=> ([+] (1..5), [+](1..10)) => (15 55) 14:33
moritz w4and0er96: it doesn't go recursively into sublists 14:40
w4and0er96: instead it numifies each argument, and numifying a range ends up with the number of elements
hoelzro are blob literals NYI? 14:49
timotimo tadzik: it is? 14:50
what's in it? 14:51
Xliff \o 14:51
Rakudo build process is broken
Are folks aware, or should I pastebin my last rakudobrew attempt? 14:52
timotimo uh oh
do paste it please
moritz Xliff: there might be a difference between "rakudo build process is broken" and "my last build failed" 14:53
Xliff Can't locate build/setup.pm in @INC (you may need to install the build::setup module) 14:54
tadzik timotimo: various libraries, seemingly unrelated to one another
Xliff This is from Configure.pl
I will fpaste
timotimo hmm
hoelzro m: say :16{abcd}
camelia rakudo-moar 20ed9e: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed radix number␤at <tmp>:1␤------> 3say :167⏏5{abcd}␤ expecting any of:␤ number in radix notation␤»
shadowpaste "xliff" at 217.168.150.38 pasted "Latest rakudobrew" (22 lines) at fpaste.scsys.co.uk/533511 14:55
Xliff And just for shits and grins, I did "cpan install build::setup" and cpan responded with "Whachu talkin' about Willis?" 14:56
m: say 16 => {abcd} 14:58
camelia rakudo-moar 20ed9e: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤ abcd used at line 1␤␤»
Xliff m: say 16 => <abcd>
camelia rakudo-moar 20ed9e: OUTPUT«16 => abcd␤»
Xliff m: say :16{abcd}
camelia rakudo-moar 20ed9e: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed radix number␤at <tmp>:1␤------> 3say :167⏏5{abcd}␤ expecting any of:␤ number in radix notation␤»
Xliff It could be my local install, but I haven't touched the system perl in ages. 14:59
And what is build::setup?
w4and0er96 moritz: what 'numify' means? 15:01
Xliff Attempt to rectify a value to a number 15:02
s/value/variable/
w4and0er96 moritz: i think i got it, thank you >_< 15:08
and it works by replacing .map(*.sum) 15:09
dalek c: 56402ee | (Jan-Olof Hendig)++ | doc/Language/syntax.pod6:
Added a few semicolons to the code examples
MasterDuke Xliff: are you using debian? didn't they recently remove '.' from the system @INC due to a CVE? 15:17
Xliff Yes, I am on Debian. 15:18
And I had no idea they removed .
Is there a fix?
MasterDuke i think there was some talk about it here in the past couple days, maybe search for @INC or debian in the logs? 15:19
i don't use debian, so i don't know if there's a specific fix for it 15:20
timotimo i'm glad rakudo doesn't have . in its normal module search path 15:21
rightfold Me too; lib is more useful :P 15:22
timotimo does python have . in its default search path for import? 15:23
rightfold No
Xliff *sigh* 15:25
Xliff OK. Well I am stuck with my current rakudo until this gets fixed.... or until I am vexed enough to fix it myself. 15:25
Just wanted you all to know.
timotimo ah, i just now saw you already pasted the error 15:29
i was still waiting for you to paste ... 15:30
dogbert17 m: dd 123456.split("", :skip-empty) # is this correct behaviour? 15:48
camelia rakudo-moar 20ed9e: OUTPUT«("", "1", "2", "3", "4", "5", "6", "")␤»
dogbert17 m: dd '123456'.split("", :skip-empty) # string is handled differently 15:49
camelia rakudo-moar 20ed9e: OUTPUT«("1", "2", "3", "4", "5", "6")␤»
ugexe i think its safe to say thats not correct behavior 15:52
dogbert17 ugexe: should I RT? 15:53
AlexDaniel YES
committable6: releases dd 123456.split("", :skip-empty)
dogbert17 will do
committable6 AlexDaniel, ¦«2015.10»: Seq $var = ("", "1", "2", "3", "4", "5", "6", "").Seq␤¦«2015.11»: List $var = $("", "1", "2", "3", "4", "5", "6", "")␤¦«2015.12,2016.02,2016.03,2016.04,2016.05,2016.06,2016.07.1,2016.08.1,HEAD»: ("", "1", "2", "3", "4", "5", "6", "")
AlexDaniel committable6: releases dd ‘123456’.split("", :skip-empty) 15:54
committable6 AlexDaniel, ¦«2015.10»: Seq $var = ("", "1", "2", "3", "4", "5", "6", "").Seq␤¦«2015.11»: List $var = $("1", "2", "3", "4", "5", "6")␤¦«2015.12,2016.02,2016.03,2016.04,2016.05,2016.06,2016.07.1,2016.08.1,HEAD»: ("1", "2", "3", "4", "5", "6")
AlexDaniel ok that's interesting
ugexe m: dd 1.23456.split(".", :skip-empty)
camelia rakudo-moar 20ed9e: OUTPUT«("1", "23456")␤»
AlexDaniel bisectable6: good=2015.10 good=2015.11 .say for ‘123456’.split("", :skip-empty) 15:55
bisectable6 AlexDaniel, On both starting points (good=2015.10 bad=20ed9e2) the exit code is 1 and the output is identical as well
AlexDaniel, Output on both points: ===SORRY!=== Error while compiling /tmp/XQZ7k7K2ri␤Undeclared routine:␤ good used at line 1␤
AlexDaniel bisectable6: good=2015.10 bad=2015.11 .say for ‘123456’.split("", :skip-empty)
bisectable6 AlexDaniel, Exit code is 0 on both starting points (good=2015.10 bad=2015.11), bisecting by using the output
AlexDaniel, bisect log: gist.github.com/22338b6147812fb603...0d0cb9bb81
AlexDaniel, (2015-11-07) github.com/rakudo/rakudo/commit/4b8937f
AlexDaniel dogbert17: ↑ maybe this is relevant
AlexDaniel committable6: 4b8937f^,4b8937f .say for ‘123456’.split("", :skip-empty) 15:56
committable6 AlexDaniel, ¦«4b8937f^»: ␤1␤2␤3␤4␤5␤6␤␤¦«4b8937f»: 1␤2␤3␤4␤5␤6
dogbert17 AlexDaniel: thx
AlexDaniel dogbert17: you see, 4b8937f changed the Str.split behavior, so to me it looks like numeric split was just forgotten 15:57
MasterDuke: damn, I love working with these bots
dogbert17 done, rt.perl.org/Public/Bug/Display.html?id=129242 16:02
the bots got a mention :-)
dogbert17 interesting, '12345'.split('', :skip-empty) is a lot slower than '12345'.comb 16:12
AlexDaniel after all, .comb is just easier to type ;) 16:19
dogbert17 indeed, just a bit surprised 16:29
ugexe has everyone got mojolicious working with Inline::Perl5 yet? Zoffix I know you were trying a few months ago... 16:39
s/everyone/anyone/
dalek c: 54bf52f | (Jan-Olof Hendig)++ | doc/Type/Cool.pod6:
Partial fix for #791
16:41
dalek c: 563b803 | (Zoffix Znet)++ | doc/Type/Cool.pod6:
Rearrange poorly placed sentence
18:37
c: 3462d89 | (Zoffix Znet)++ | doc/Type/Cool.pod6:
Indicate types of values given by :v/:p in .split
18:47
moritz wiki.dlang.org/Voldemort_types 19:01
masak moritz: heh, I correctly guessed the reason for naming them that :) 19:03
Perl 6 almost has the same thing, except not enough static typing for the outside scope to take advantage of 19:04
masak argh. I was looking forward to watching www.youtube.com/watch?v=MAKhV9wKblk -- but it appears to lack sound :/ 19:07
looks funny though, with the t-shirt changes :)
sjn masak: I get sound here 19:08
masak I see. odd. sound works for me for other talks. 19:09
guess I'll just try again later, then ;)
sjn masak: it's only sound on the left channel though 19:12
masak oh! that explains it. my left earphone is b0rk
TimToady or you knocked the plug out halfway 19:19
TimToady rereads the convo and retracts his addendum 19:20
masak TimToady: listening to your keynote now. I'm oddly flattered by the choice of title :P 19:22
(and happy that train tracks ended up on the big screen, and not some boring bug hunt or weird macro musing)
timotimo i hate it when recordings have only one channel with sound and it decides to blow it up to stereo by putting audio onto one ear only 19:23
masak TimToady: "favicon" :) 19:24
TimToady that were it
When your brain turns to sponge, some of your words fall into the holes... 19:25
timotimo whoops, now there's sound on zero ears
geekosaur w-ear-d 19:26
timotimo :)
mst TimToady: I'm stealing that excuse to explain my slides 19:27
masak TimToady: nowadays I think "strangely consistent" as a concept comes down to CT's natural transformations, neither more nor less. but the problem is getting to the point of grokking natural transformations :P 19:28
TimToady your much learning has driven you mad :)
masak yeah, tell me about it
mst masak: expand CT? 19:29
masak mst: category theory
rightfold category theory is great
mst ugexe: 98% sure zoffix did. I could try it with Alien::Rakudo maybe
masak: aha
masak mst: a zoom-out of group theory and universal algebra that ends up explaining all of math rather well, and providing an alternative/cuter foundation than ZF set theory 19:30
mostly, it shows a lot of connections *across* fields (which is also how it got invented)
its slogan is something like "values aren't primary; mappings are" 19:31
timotimo a beautiful buzzing sound in the background
rightfold masak: "The arrows count."
masak rightfold: they are the only thing that counts
and someone has described it as "mathematicians finally learning about programming to an interface"
rightfold Once you know all the arrows, you know all the objects 19:32
because every object has an identity arrow :p
masak CT has also been described, often and with emphasis, as "abstract nonsense". last I checked, the practicioners wear that as some sort of badge of honor
TimToady is deeply suspicious of any use of the word "natural" since reading C.S. Lewis's Studies in Words
rightfold glot.io/snippets/ei534lx1lq 19:33
masak haven't read that book
masak TimToady: but etymologically, the word "natural" in CT is just a formalization of things people were already groping for and partly trying to express with that choice of word 19:33
rightfold PureScript has a natural transformation type in its standard library 19:34
masak rightfold: that quote, "A monad...", is real, except for the provocative "what's the problem?" in the end: stackoverflow.com/questions/3870088...-the-issue 19:35
masak (by Saunders Mac Lane) 19:35
rightfold I know :p 19:36
masak there's also "Git, complicated? Of course not! Commits map to isomorphic contours in source-code phase space." -- www.reddit.com/r/programming/comme...ts_map_to/ 19:38
emdashcomma heh 19:39
mst TimToady: I keep forgetting C.S. Lewis wrote things other than the Chronicles of God's Fursona
masak .oO( Savior, now with more mane than ever! ) 19:41
I remember being fond of the Narnia books as a child. I haven't tried reading them as an adult, though. 19:50
mst masak: same, and same. I worry that re-reading them might spoil my nostalgic fondness 19:53
masak quite possibly
I also remember enjoying the (BBC?) TV series version, although I know I wouldn't be able to watch it today :)
partly that's due to the inexorable march of special effects, though 19:54
geekosaur you don't like pepper shakers? :p
masak thought that was Star Trek 19:55
mst I really don't mind ye olde special effects
then again I've also been known to watch plays
geekosaur daleks, actually 19:56
ST had its own levels of that, though, sure. I'm fairly lax about that, picking on something as old as I am for being old seems like bad plan :p 19:57
(tbh I'm usually impressed by such things as "clever" given what they had available at the time) 19:58
mst has fond memories of a production of '3 men in a boat' that did an amazing job of using a cardboard cutout for the dog 20:00
TimToady
.oO("Oh, he knows how to swim, he just can't."
20:03
TimToady or was that Connie Willis's take on it 20:04
arnsholt has only read the Connie Willis version 20:10
I suspect I missed quite a few things, not having read the source material first 20:11
dalek c: e6a5d37 | (Jan-Olof Hendig)++ | doc/Type/Cool.pod6:
Fixed incorrectly defined return value
20:32
masak nwc10: I was sad about the death of Cube reading your manuscript -- but I will never forgive the lack of compassion with which you kill it off in the talk delivery itself :P 21:25
"Cube dies" -- no pause afterwards, on to the next thing
I think I'm going to have to write some Cube VM fanfiction or something to console myself 21:26
timotimo :D
timotimo hm. this points out to me that we don't have sitemaps for most of our perl6 sites; i'm not sure what exactly they allow you to get, but maybe it'd be good to have them for some of our stuff? 21:28
mst yes! it's like web scale, except useful
timotimo :D 21:29
well, what sites would sitemaps be good for? perl6.org? docs.perl6.org? our rss feed agregator?
examples.perl6.org? 21:30
timotimo modules.perl6.org? 21:30
i expect wordpress (which is what rakudo.org runs) builds sitemaps by itself? 21:32
masak "if you're in a hurry, it's the fastest way to destroy CPAN" -- nwc10++ :D
(removing prototypes from p5)
timotimo :D 21:34
mst masak: bet you I could auto-patch about 75% of it 21:39
masak mst: sounds oddly tempting 21:40
dogbert17 m: say "1232".rindex('2',-1) 21:48
camelia rakudo-moar b771bc: OUTPUT«Position in rindex out of range. Is: -1, should be in 0..4␤ in block <unit> at <tmp> line 1␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤»
masak m: say "1232".rindex('2',*-1)
camelia rakudo-moar b771bc: OUTPUT«Cannot resolve caller rindex(Str: Str, WhateverCode); none of these signatures match:␤ (Cool:D $: Cool $needle, *%_)␤ (Cool:D $: Cool $needle, Cool $pos, *%_)␤ (Str:D $: Str:D $needle, *%_)␤ (Str:D $: Str:D $needle, Int:D $pos, *%_)␤ …»
masak m: say "1232".index('2',*-1) 21:49
camelia rakudo-moar b771bc: OUTPUT«Cannot resolve caller index(Str: Str, WhateverCode); none of these signatures match:␤ (Cool:D $: Cool $needle, *%_)␤ (Cool:D $: Cool $needle, Cool $pos, *%_)␤ (Str:D $: Str:D $needle, *%_)␤ (Str:D $: Str:D $needle, Int:D $pos, *%_)␤ …»
masak huh.
dogbert17 m: say "1232".rindex('2',4)
camelia rakudo-moar b771bc: OUTPUT«index start offset out of range␤ in block <unit> at <tmp> line 1␤␤»
dogbert17 the first message claims the allowed range is 0..4 which seems to be incorrect
dogbert17 the problem could possibly be related to github.com/rakudo/rakudo/blob/nom/...tr.pm#L230 21:56
timotimo nah, that's the one that fires when you give it -1
dogbert17 row 223 then :) 21:57
timotimo the error itself probably comes from inside moarvm, actually 21:58
dogbert17 m: say "1232".rindex('2',-1)
camelia rakudo-moar b771bc: OUTPUT«Position in rindex out of range. Is: -1, should be in 0..4␤ in block <unit> at <tmp> line 1␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤»
timotimo that one just fires if you use a big integer instead of a normal-sized integer
m: my $ex = try { "1232".rindex('2', 100) }; say $ex.WHAT
camelia rakudo-moar b771bc: OUTPUT«(Any)␤»
dogbert17 but if there are four chars in the string shouldn't the range be 0..3
timotimo m: my $ex = try { "1232".rindex('2', 100) CATCH { say .WHAT } };
camelia rakudo-moar b771bc: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3my $ex = try { "1232".rindex('2', 100)7⏏5 CATCH { say .WHAT } };␤ expecting any of:␤ infix␤ infix stopper␤ statement end␤ …»
timotimo ... 21:59
m: my $ex = try { "1232".rindex('2', 100); CATCH { say .WHAT } };
camelia rakudo-moar b771bc: OUTPUT«(AdHoc)␤index start offset out of range␤ in block <unit> at <tmp> line 1␤␤»
timotimo you see how it's an X::AdHoc?
this bug has an additional part where going above the threshold doesn't mention the acceptable range of values
dogbert17 m: say "1232".rindex('2',4) 22:00
camelia rakudo-moar b771bc: OUTPUT«index start offset out of range␤ in block <unit> at <tmp> line 1␤␤»
timotimo now we need to decide whether we want rindex to accept $self.chars as a start index and just always return Nil
well, -1 really
and when you give it more than that it would throw
or if the error messages should go with self.chars - 1 instead
dogbert17 I just tried -1 for fun and was surprised when it said the allowed range was 0..4 22:01
but I agree, when the value is to high, something breaks deeper in the code 22:02
s/to/too/
when should the code on line 223 fire? 22:03
timotimo m: say "1234".rindex('2', 100000000000000000000000000000) 22:07
camelia rakudo-moar b771bc: OUTPUT«Position in rindex out of range. Is: 100000000000000000000000000000, should be in 0..4␤ in block <unit> at <tmp> line 1␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤»
timotimo if we didn't have that code in there, here's what would happen instead:
m: use nqp; nqp::rindex("foobar", 100000000000000000000000000000000000000)
camelia rakudo-moar b771bc: OUTPUT«This type cannot unbox to a native string: P6opaque, Int␤ in block <unit> at <tmp> line 1␤␤»
timotimo er, oops
m: use nqp; nqp::rindex("foobar", "foo", 100000000000000000000000000000000000000)
camelia rakudo-moar b771bc: OUTPUT«Cannot unbox 127 bit wide bigint into native integer␤ in block <unit> at <tmp> line 1␤␤»
timotimo ^- this unhelpful error 22:08
dogbert17 aha, thx for explaining, so which code handles the case when the position is just a bit too large then?
m: say "1232".rindex('2',17) 22:09
camelia rakudo-moar b771bc: OUTPUT«index start offset out of range␤ in block <unit> at <tmp> line 1␤␤»
timotimo that's inside MoarVM 22:11
in the implementation of the rindex op (probably in src/string/ops.c) there's an MVM_exception_throw_adhoc (or how it's spelled) 22:12
dogbert17 so deep in the c code then 22:13
timotimo actually, we have a MVM_string_check_arg function that does all kinds of checks for us 22:14
no, that's something else
a-ha!
in the moarvm code there's already a comment /* maybe return -1 instead? */ 22:15
dogbert17 interesting 22:17
asdfgh How do I make sure a string matches the format of a domain 22:48
asdfgh <a-z 0-9 stuff>.<domain suffix> 22:49
timotimo the first step would be to look at the exact definition for valid domain names 22:51
now that domain names can also include some parts of unicode, and now that top level domains can be pretty much anything you want ... 22:52
timotimo but then you're likely going to want character classes; usually one for the first letter in a domain name and one for the rest 22:53
like, a - is probably not allowed at the very beginning of a domain name, but after that you can even have -- in a domain name (that's what punycode domains expand to, if i'm not mistaken) 22:54
El_Che is "use v6c" a thing. I mean, does it do something?
timotimo use v6.c you mean?
El_Che (I know what it's supposed to do, but with only 6c out there, I wonder if it's implemented)
yes
timotimo we have beginnings of "ability to use a 6.d setting" that i haven't looked very closely at 22:55
you're mostly future-proofing your code at this point, i guess
El_Che I am writing a blog post about "perl6 for small scripts" and I wonder if it's should be there 22:56
asdfgh How would I match a string against that though timotimo
timotimo m: say "foobar.domain" ~~ / (<[a-z]>+)+ % '.' / 22:59
camelia rakudo-moar b771bc: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unsupported use of - as character range; in Perl 6 please use .. for range, for explicit - in character class, escape it or place it as the first or last thing␤at <tmp>:1␤------> 3say "foobar.domain" ~~…»
timotimo m: say "foobar.domain" ~~ / (<[a..z]>+)+ % '.' /
camelia rakudo-moar b771bc: OUTPUT«「foobar.domain」␤ 0 => 「foobar」␤ 0 => 「domain」␤»
timotimo tired already