»ö« 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.
00:01 mcmillhj joined, w_richard_w joined
Zoffix All tests successful yey 00:03
Geth doc/post-release-2018.04: 2e96dd3894 | (Zoffix Znet)++ | doc/Language/variables.pod6
Fix articles
doc/post-release-2018.04: d13f6424b7 | (Zoffix Znet)++ | doc/Language/variables.pod6
Merge branch 'master' into post-release-2018.04
00:05 mcmillhj left 00:06 BenGoldberg joined 00:13 Guest43854 left 00:19 mcmillhj joined 00:21 lizmat joined 00:23 simpleseeker left 00:24 mcmillhj left 00:32 mcmillhj joined 00:37 mcmillhj left 00:42 aindilis left 00:44 mcmillhj joined 00:47 aindilis joined 00:49 mcmillhj left 00:50 markong left 00:56 mcmillhj joined
Kaiepi jesus i didn't notice how bad the boilerplate in my bot was until i shortened ~200 lines of code to this hastebin.com/legawomoqu.pl 00:58
01:00 mcmillhj left
Zoffix Doesn't that code have a data race? You're pushing to @lines from two separate threads. 01:00
I think a Channel is better for that (since it protects for such cases)
Kaiepi hm
depends, is any of rakudo's build scripts concurrent? 01:01
wait i think the tests are
Zoffix No idea, but does it matter? If either prints to both to STDERR and STDOUT, they don't need to be concurrent 01:02
01:02 zachk left
Kaiepi probbaly not 01:02
01:03 telnet is now known as tel, tel is now known as telnet
Kaiepi oh good channels work roughly the same as golang channels 01:05
AlexDaniel just use react maybe?
01:05 pharv left
AlexDaniel then you can just push into arrays just fine 01:05
01:06 pharv joined
AlexDaniel also .stdout.tap does not tap on lines 01:06
Zoffix What does it tap on?
AlexDaniel chunks
Zoffix Of what size?
And how to control them
?
AlexDaniel dunno to both, but you can use .stdout.lines to get lines 01:07
Kaiepi it taps each 80 characters from what i've seen
01:08 mcmillhj joined
Kaiepi lines would be better though 01:08
AlexDaniel Kaiepi: maybe see this as a reference: github.com/perl6/whateverable/blob...#L224-L268
Kaiepi ohhh 01:09
Zoffix This gives 20030 consistently with and without atomicint: gist.github.com/zoffixznet/ad3f569...baab369ed5
Kaiepi see i've read the docs for react, but i still didn't understand how it works
Zoffix So maybe there isn't a race.
Also, don't get where the extra 30 come from :S 01:10
I guess the chunking
yeah, doing stdout.line gives 20000 exact
01:10 elcaro[m] joined, pharv left
AlexDaniel Zoffix: try perl5 maybe 01:10
it could be that perl6 process is printing just too slow? 01:11
AlexDaniel tries himself
Kaiepi wait does react work sort of like select in golang? 01:12
except not specific to channels
01:13 mcmillhj left
AlexDaniel Zoffix: haha yea seems to be different with perl5 01:13
wait… 01:15
nah that's something else
I had this gist.github.com/AlexDaniel/6ce255c...bf3eadbddf 01:16
which outputs different numbers
but I guess for a different reason
Zoffix That's the chunking
.tell pmurias did some initial debugging for JVM issue, but giving up. Maybe it'll help you fix the problem: github.com/rakudo/rakudo/issues/17...-383771805 01:18
yoleaux Zoffix: I'll pass your message to pmurias.
AlexDaniel anyway, I don't know why it works, but it shouldn't 01:19
Zoffix What is? 01:20
AlexDaniel pushing to the same array from two taps
Zoffix Well, I'm guessing the two taps are fed from one event loop so it's just one thread actually or something? 01:21
Because it's one proc async
01:22 mcmillhj joined
AlexDaniel yeah, looks so 01:22
Zoffix or maybe not... sticking a `sleep` in one doesn't block the other
Zoffix doesn't know much about this stuff
AlexDaniel at least according to “say $*THREAD”
Zoffix or it's the affinity worker.... 01:24
Yup: *** Error in `/home/zoffix/rakudo/install/bin/moar': double free or corruption (!prev): 0x00007f87d86955c0 *** 01:25
Kaiepi: yeah, it's not thread safe.
AlexDaniel Zoffix: how did you get it to do that?
Zoffix If you stick ` sleep 2` into one of the code blocks, a second affinity worker will spawn and it'll be two threads. So the number of used threads depends on how busy the system is. The supervisor checks every 100ms (or 10ms) to see if it needs to spawn more workers and that sleep forces it to spawn 01:26
Kaiepi damn
01:26 mcmillhj left
Kaiepi i tried with channels but $c.list hanged regardless of if the channel was closed or not 01:27
AlexDaniel just use react, it's easier 01:28
Zoffix Kaiepi: react version: gist.github.com/zoffixznet/cb002b0...ad9057c094
This one is safe, 'cause only one whenever is run at a time. It also gives you better error reporting when stuff explodes
Kaiepi how does react decide which whenever statement to run? 01:29
that's what confuses me about it 01:30
Zoffix As for $c.list hanging... I'm guessing you forgot to .close the Channel 01:31
Kaiepi: it's asynchronous. So it runs whenever the event occurs
AlexDaniel well, if it's running something else already 01:32
01:32 rjt_pl left
AlexDaniel not* 01:32
Zoffix yeah
01:32 rjt_pl joined
Zoffix it queues it up to run, I guess I should say 01:32
Kaiepi ohh
AlexDaniel so it's doing synchronous processing of asynchronous events, sorta :) 01:33
Kaiepi zoffix i closed the channel before doing .list
Zoffix m: my Channel $c .= new; $c.send: "meows"; $c.send: "foos"; $c.send: 42; $c.close; say $c.list
camelia (meows foos 42)
Kaiepi i checked Channel.pm6 and it's trying to use .Seq on itself, but it doesn't seem to have a Seq method in it or its roles...?
ok weird 01:34
Zoffix s: Channel.new, 'Seq', \()
SourceBaby Zoffix, Sauce is at github.com/rakudo/rakudo/blob/a138...ny.pm6#L73
Zoffix It's provided by Any
Kaiepi oh
perlawhirl m: say (^10).head('5')
camelia This type cannot unbox to a native integer: P6opaque, Str
in block <unit> at <tmp> line 1
perlawhirl should .head be Cool ?
be Cool, man
Zoffix I really wish we establish a language-wide policy on such thing rather than fixing things piece-meal 01:35
m: say substr "abc", "1", "2"
camelia bc
Zoffix like here it works. There it don't
.splice used to coerce, now it doesn't.
01:35 timotimo left
AlexDaniel Zoffix: any downsides to coercing everywhere? 01:37
Zoffix m: say substr "abc", ("maybe",), <there are>
camelia bc
01:38 mcmillhj joined
perlawhirl maybe a good rule might be, if the argument can only ever be an Int, then it should be Cool (whether or not that criteria should be wider than Int is up for discussion) 01:38
Zoffix AlexDaniel: also, either slower speed or larger size with all the multies 01:39
m: say [].^lookup("splice").candidates.elems
camelia 31
Zoffix Like this would end up prolly around 50-60 candidates.
AlexDaniel puts his head in the sand 01:40
perlawhirl If I'm feeling bitter, I would say that making Lists Cool feels like it was something that was done to make the language more like perl5 that ended up being a mistake :S
Zoffix (and don't tell me the "torture the developer" stuff; there won't be any developers to torture when the code is an unmaintable pile)
Kaiepi zoffix: issue was i was closing the channel before awaiting the promise 01:41
instead of after
Zoffix ah
perlawhirl: in an alternate universe, there's a perlawhirl who's bitter because they have to stick explicit .elems all over the place :) 01:42
AlexDaniel just a prefix +
01:42 mcmillhj left
Zoffix You'll get 1 01:42
But it's not Cool anymore. It doesn't know how to behave like a number anymore. 01:43
Kaiepi btw thanks for the help
AlexDaniel :'(
right
Zoffix Well, I guess you won't get one either, because I was thinking you'd get a 1-el list :)
m: say +class {}.new
camelia Cannot resolve caller Numeric(<anon|1>: ); none of these signatures match:
(Mu:U \v: *%_)
in block <unit> at <tmp> line 1
Zoffix you'd get that :D
AlexDaniel
.oO( all universes suck )
01:44
TEttinger I gotta say, I've been in here for a while now and I still have no understanding of the names Perl6 uses for almost anything
Zoffix Like what?
TEttinger Cool
01:44 eliasr left
Zoffix It's "Convenient OO Loop" 01:44
Also a pun.
TEttinger it's like there's a rule that unless it's an inside joke it can't be made permanent 01:45
Zoffix Like MoarVM is "Metamodel On A Runtime"
AlexDaniel
.oO( Strinty? Numstry? )
01:46
01:46 ilbot3 left
TEttinger I still don't know what Cool is or does by the name or acronym 01:46
Zoffix Well, the first sentence of the docs answers precisely that :) 01:47
TEttinger I mean I'm not using perl6 any time soon, but I just want the channel to know that it sounds like you're all having strokes
Zoffix Erm. Thanks? :) 01:48
perlawhirl Zoffix: actually, I often perfer to use .elems because it conveys intent a little better then the short prefixes... but regardless, I suspect i'm bitter in all universes :D 01:49
01:50 AlexDaniel left
Zoffix perlawhirl: doesn't that argumentation defeat your original proposal to coerce things? :) Just use `say (^10).head: $x.Int`... conveys intent a little beter :D 01:51
perlawhirl I'm a walking contradiction
Zoffix perlawhirl: also, currently you don't need short prefixes. An array coerces to numeric automagically. It's Cool like that :)
Zoffix &
01:51 Zoffix left
perlawhirl TEttinger: Cool just means it can will coerce to string or a number depending on the context 01:54
AlexDaniel` TEttinger:
oops
perlawhirl m: my @l = < one two three >; say @l + 1; say @l ~ ' four';
camelia 4
one two three four
AlexDaniel` anyway, hey, we got rid of the texas thingy
and also we no longer use `nom` branch :)
there's also much less of “RT” which most newcomers know nothing about 01:55
TEttinger perlawhirl: what does the first say do there?
01:56 mcmillhj joined
TEttinger it looks like it prints the number 4? 01:56
01:56 ilbot3 joined, ChanServ sets mode: +v ilbot3
perlawhirl TEttinger: The use of the '+' infix means _numeric_ addition, so the list is coerced to it's number of elements (ie. 3) 01:56
AlexDaniel` yeah, number of elements + 1
perlawhirl so it's doing 3 + 4
01:56 AlexDaniel joined
perlawhirl i mean ... 3 + 1 01:56
m: say ('alpha', 'beta', 'gamma') + 1 01:57
camelia 4
TEttinger so... ~ is string concatenation but ~~ is smart match?
perlawhirl Yes
AlexDaniel and there's also ≅ :) 01:58
for approximate equality, but no ≈
TEttinger 02:00
02:00 mcmillhj left
AlexDaniel that's a cool character 02:01
perlawhirl TEttinger: It's mainly nice for checking number of elems in conditions, eg. if @things < 5 { ... }
similar to addition '<' means numerically less than, so arguments are coerced to numbers if possible 02:02
TEttinger mmm 02:04
02:04 vcv_ left 02:06 Herby_ joined
Herby_ o/ 02:06
\o 02:07
TEttinger I dunno. as I've gotten more opinionated on programming, I've found implicit behavior to be counterproductive even if it saves some keystrokes. having to consult a manual and hoping it adequately describes some corner case that's causing me issues takes a lot more time than typing out what I mean 02:08
a friend hit a worst-case scenario for this in Go, recently 02:09
golang.org/pkg/net/url/#URL.Parse was failing to fail on a clearly-invalid URL, the string containing only the ASCII char 127 (a control char, often DEL in older encodings) 02:12
going through comments in the code he found that it had been changed to address a Git issue. that issue cross-referenced the actual issue, which was that it was broken in the first release, was fixed but that broke code that expected the parser to be incorrect, so they had to un-fix the correct code for compatibility 02:13
02:14 mcmillhj joined
perlawhirl yeah I tend to agree on the opinionated thing most of the time, which is why i'll typically write `@things.elems` 02:18
02:19 mcmillhj left
perlawhirl but i constantly appreciate that i can treat the string '10' as a number in perl if i want to 02:19
particualy when translating things to other languages, and realising to make calls to `int()` in a bunch of places 02:20
so I'm not against Cool in principal... but making Lists Cool is the source of quite a few traps that I'd happy do without 02:21
happily*
02:25 mcmillhj joined 02:30 mcmillhj left 02:38 Herby_ left, Herby_ joined 02:44 ufobat_ joined 02:45 mcmillhj joined 02:47 ufobat left
AlexDaniel implicit behavior being that lists turn into the number of elements in numeric contexts? 02:49
02:50 espadrine_ left, mcmillhj left 02:57 mcmillhj joined 03:02 mcmillhj left
MasterDuke i think List.contains is a trap (implicit behavior being it stringifies the list) 03:03
lookatme good noon 03:05
m: say (1, 2, 3, ).contains(1) 03:06
camelia True
lookatme m: say (1, 2, 3, ).contains(12) 03:07
camelia False
lookatme m: say (1, 2, 3, ).contains("1, ") 03:08
camelia False
lookatme m: say (1, 2, 3, ).Str 03:09
camelia 1 2 3
lookatme m: say (1, 2, 3, ).contains("1 2 ")
camelia True
Herby_ rookie question: does declaring types for functions and objects typically provide a speedup compared to not declaring them?
sub triple-number(Int $x) {} versus triple-number($x) {} 03:10
03:16 mcmillhj joined
MasterDuke Herby_: right now there's usually not much of a speedup for using high-level types (e.g., Int, Str). however, native types (e.g., int, str) are frequently faster (assuming of course it's correct to use them in the given situation) 03:16
m: my Int $s; for ^1_000_000 { $s += $_ }; say $s; say now - INIT now 03:17
camelia 499999500000
0.8544502
MasterDuke m: my int $s; for ^1_000_000 -> int $_ { $s += $_ }; say $s; say now - INIT now 03:18
camelia 499999500000
0.5473163
Herby_ ahh ok
Looking here: docs.perl6.org/type.html, I see Int, int, and Str but I don't see str 03:19
MasterDuke that may be deliberate, i don't think str is as different from Str as int is from Int 03:21
03:21 mcmillhj left
Herby_ gotcha 03:21
03:26 Herby_ left 03:28 pharv joined, pharv left, pharv joined 03:31 Herby_ joined, mcmillhj joined 03:32 pharv_ joined 03:35 pharv left 03:36 mcmillhj left 03:40 Guest78496 joined, Guest78496 left, Guest78496 joined 03:41 Guest78496 is now known as scott 03:43 w_richard_w left 03:44 w_richard_w joined 03:47 pharv_ left 03:51 mcmillhj joined 03:54 AlexDaniel left 03:55 mcmillhj left 04:13 Sgeo__ joined 04:16 Sgeo_ left 04:35 khw left 04:40 mcmillhj joined 04:45 mcmillhj left 04:47 curan joined 04:50 xtreak joined, MilkmanDan left 04:54 MilkmanDan joined 04:55 mcmillhj joined 05:00 mcmillhj left, troys left 05:06 mcmillhj joined 05:09 aindilis left, aindilis` joined 05:10 jmerelo joined 05:11 mcmillhj left 05:14 aindilis` left 05:15 aindilis joined 05:22 wamba joined
Kaiepi what's the command to tell someone who's offline something? 05:23
lookatme .tell Kaiepi :( 05:24
yoleaux lookatme: I'll pass your message to Kaiepi.
lookatme .tell lookatme :)
yoleaux lookatme: Talking to yourself is the first sign of madness.
lookatme .
05:24 BenGoldberg left 05:25 domidumont joined, mcmillhj joined
Kaiepi thanks 05:26
yoleaux 05:24Z <lookatme> Kaiepi: :(
lookatme welcome 05:27
Kaiepi .tell zoffix i refactored rakudobot so i can add the features you want easily. it also does stresstest instead of spectest now. i'll be adding Inline::Perl5 support soon
yoleaux Kaiepi: I'll pass your message to zoffix.
jmerelo releasable6: status 05:28
releasable6 jmerelo, Next release will happen when it's ready. 1 blocker. 263 out of 263 commits logged
jmerelo, Details: gist.github.com/a029541f1b7ce61259...529b71eb1d
Kaiepi jesus i did not write it well the first time since i ended up cutting its loc in half 05:29
05:30 mcmillhj left
Kaiepi still does the same thing, just i figured out how to work with perl's style of modules and oop better 05:30
05:33 domidumont left, domidumont joined 05:35 xtreak left, espadrine_ joined 05:39 b2gills left, b2gills joined 05:40 xtreak joined 05:41 mcmillhj joined 05:46 mcmillhj left
El_Che morning 05:47
05:51 domidumont left 05:55 mcmillhj joined 05:56 andrzejku_ joined 05:59 andrzejku left 06:00 mcmillhj left 06:04 domidumont joined 06:10 espadrine_ left 06:25 andrzejku joined 06:28 andrzejku_ left 06:30 mcmillhj joined 06:31 japanoise left, japanoise joined 06:32 robertle joined 06:35 mcmillhj left
ufobat_ is there a difference between --> and returns for signatures? I wanted to put a function signature in a pod C<...> but that would not work with --> 06:46
06:50 wamba left
jmerelo ufobat_: that should work in Pods. Maybe escaping? 06:57
ufobat_: and yes, there are differences between --> and returns docs.perl6.org/type/Signature#inde...turn_Types 06:58
ufobat_ docs.perl6.org/language/functions#...onstraints dosn't mention that there is any difference 07:00
07:00 mcmillhj joined
ufobat_ maybe there should just be once place in the documentation which covers this topic? 07:01
jmerelo ufobat_: Yep, maybe. Main differences is that returns will probably be obsoleted and it does not work with constant values (verbatim from above)
ufobat_ i am reading through it :) 07:02
jmerelo p6: sub favorite-number returns 42 { say "Whatever"; }; favorite-number;
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed trait
at <tmp>:1
------> 3sub favorite-number returns7⏏5 42 { say "Whatever"; }; favorite-number
jmerelo p6: sub favorite-number( --> 42 ) { say "Whatever"; }; favorite-number;
camelia Whatever
ufobat_ if --> is the way to go, and the pod documentation doesn't mention how to quote the > in C<...> it might be not possible 07:03
jmerelo ufobat_: but maybe we should say "different and not equivalent" instead of "many" ways.
ufobat_ ack! 07:04
jmerelo ufobat_: yep, that's the other end of your question. I can't say off the top of my head. Either escaping or equivalent unicode char or quoting should work... But would have to check it out. 07:05
ufobat_: maybe ask in StackOverflow? ;-)
07:06 mcmillhj left
ufobat_ hah! 07:06
07:11 mcmillhj joined
jmerelo ufobat_: have you tried it? It seems to work, although in a weird way... 07:13
ufobat_ tried what?
i just wrote the stackoverflow question
moritz you can use C<< stuff with --> in it >>
ufobat_ moritz, what about writing a stack overflow answer :p 07:14
jmerelo ufobat_: thanks!
moritz done 07:15
ufobat_ \o/
07:16 mcmillhj left
moritz stackoverflow.com/questions/499954...d/49995512 for the record 07:21
El_Che ufobat_: I remember a discussion inclusing TimToady. He liked the '-->' (I like the returns) 07:22
07:22 wamba joined
moritz same here :-) 07:22
but --> has some advantages (like, it's obviously part of the signature)
also, people seem to downvote stackoverflow.com/a/49892419/14132 and I have no idea why
ufobat_ is "is export" part of the signature, technically?
El_Che there was an advantage I forgot. It was a really good point. 07:23
moritz ufobat_: no
El_Che: the other is about scoping
($x, $y --> returns $x * $y) { # side effect here }
argl
($x, $y --> $x * $y) { # side effect here }
(I don't think that's implemented yet)
lizmat clickbaits p6weekly.wordpress.com/2018/04/23/...u-station/ 07:24
yoleaux 06:54Z <nine> lizmat: github.com/ugexe/zef/issues/241#is...-383823558
07:25 mcmillhj joined
moritz lizmat++ 07:28
also, more people should play Tau Station. I love it :-)
07:29 darutoko joined 07:30 mcmillhj left
moritz ufobat_: if the answer works, please accept it 07:34
ufobat_ how can i accept it? 07:35
moritz there should be a grayed-out checkmark next to the answer, I think 07:36
stackoverflow.com/help/someone-answers
Geth doc: 4cff3850e4 | (Luca Ferrari)++ | doc/Language/variables.pod6
Little improvement to the list assignment regarding my and our.

Related to issue #1958
synopsebot Link: doc.perl6.org/language/variables
Geth doc: 16cc56d4a1 | (Luca Ferrari)++ | doc/Language/variables.pod6
More on list variables with my and our.

See issue #1958
ufobat_ ah, thanks moritz 07:37
07:41 mcmillhj joined 07:42 dakkar joined 07:45 mcmillhj left
buggable New CPAN upload: CPAN-Uploader-Tiny-0.0.5.tar.gz by SKAJI modules.perl6.org/dist/CPAN::Upload...cpan:SKAJI 07:49
07:58 mcmillhj joined 08:03 mcmillhj left
Geth doc: e12f54f39f | (Luca Ferrari)++ | doc/Language/variables.pod6
Modify "package scoped" with something that should sounds better.

See issue #1958
08:03
synopsebot Link: doc.perl6.org/language/variables
Geth doc: 9f6390b851 | (Luca Ferrari)++ | doc/Language/variables.pod6
Reword my scope according to our section.

See issue #1958
08:13 mcmillhj joined 08:17 mcmillhj left 08:25 rindolf joined 08:29 wamba left 08:30 wamba joined 08:31 mcmillhj joined
Geth doc: 707ee5acff | (JJ Merelo)++ | doc/Language/variables.pod6
Solving conflict refs #1958. I think it can be closed
08:33
synopsebot Link: doc.perl6.org/language/variables
08:36 mcmillhj left 08:38 xtreak left, xtreak joined 08:39 xtreak left 08:44 pmurias joined 08:47 w_richard_w left 08:48 mcmillhj joined 08:53 mcmillhj left 09:01 xtreak joined 09:07 mcmillhj joined 09:12 mcmillhj left
jmerelo Some help with NativeCall? stackoverflow.com/questions/499975...-in-perl-6 09:19
09:24 mcmillhj joined
stmuk_ odd question title! 09:25
09:25 stmuk_ is now known as stmuk
ufobat_ does is native(Str) make sense? 09:25
isn't the thing between the () the library name?
i think the title means "wtf - how to troubleshoot this" 09:26
Geth doc: 8101444030 | (Jonas Kramer)++ | doc/Type/IO.pod6
Mention that without arguments slurp uses $*ARGFILES as fallback.
09:27
synopsebot Link: doc.perl6.org/type/IO
09:29 mcmillhj left
jmerelo ufobat_: That shouldn't be the problem. It's the syntax used for calling native functions that are not in any external library. 09:35
stmuk: well, it's rather unforgiving. Make any mistake, dumps core. 09:36
I haven't debugged cores since the 90s. Pretty much around the time I started to use Perl.
jnthn Using NativeCall successfully pretty much means knowing at least something about C programming. 09:37
moritz and C is simply too untyped for most kinds of automated checks 09:38
09:38 mcmillhj joined
jmerelo jnthn: but it's not too obvious that to get a CPointer you just need to instantiate a CSstruct. 09:38
jnthn It's not actually Rakudo that dumps core, it's the C code you called dumping core because you called it wrong.
jmerelo jnthn: Yep, I know. Maybe it should be the "Rather unforgiving nature of the C code called from NativeCode", but it didn't have the same ring to it. 09:39
09:39 scimon joined
jnthn "How to correctly call clock_gettime with NativeCall" would have been even better ;-) 09:40
jmerelo jnthn: stackoverflow.com/questions/499975...-interface 09:41
jnthn: way I see it, the main problem is that I'm using a CPointer instead of a CStruct. But, in fact, clock_gettime uses a pointer to a struct linux.die.net/man/3/clock_gettime 09:43
09:43 zakharyas joined
jnthn jmerelo: A CStruct instance is already implicitly a pointer to a struct though 09:44
jmerelo jnthn: in fact, you are also creating a new instance, which I don't, but it coredumps all the same if I keep using CPointer and I try to instantiate it.
jnthn: OK, I need to document that, then. Then what's the use case for CPointer? 09:45
jnthn CPointer is when you just want an opaque pointer to something
But don't have any data stored within it
It should probably complain if you declare something with CPointer and it has attributes
jmerelo jnthn: as in void*
09:45 mcmillhj left
jmerelo jnthn: a complain by NativeCall would have made it less unforgiving. 09:45
jnthn Yeah, file an issue about that 09:46
void* - well, maybe, but it's more useful when the C library does all of the memory allocation itself and you don't ever need to look inside of the structure.
You just need to receive and pass the pointer 09:47
09:51 eliasr joined
jmerelo jnthn: done github.com/rakudo/rakudo/issues/1767 09:52
There are apparently no uses of CPPStruct "in the wild" 10:07
Only one I've found is github.com/FROGGS/p6-Box2D/tree/fc...1f9424e7/t by FROGGS but it's not too clear to me how it's actually loading the library. 10:08
10:12 Actualeyes left
jmerelo I find also curious the use of native(Str) for functions already loaded. It does not seem to work with native(Mu) or native(Cool). Anyone knows why? 10:15
10:15 Actualeyes joined
jmerelo he, IntStr also works... 10:15
pmurias I get a 'Hash keys must be concrete strings' exception when trying to build rakudo-moar 10:18
jmerelo p6: use NativeCall; sub getppid(--> long) is native(Str) {*}; say getppid; 10:19
camelia 811
jmerelo p6: use NativeCall; sub getppid(--> long) is native(IntStr) {*}; say getppid;
camelia 811
jmerelo p6: use NativeCall; sub getppid(--> long) is native(RatStr) {*}; say getppid;
camelia 811
jmerelo He
jnthn Just because it's type-constrained to accept some subtype of Str there 10:20
jmerelo p6: use NativeCall; sub getppid(--> long) is native(Stringy) {*}; say getppid;
camelia 5===SORRY!5=== Error while compiling <tmp>
No appropriate parametric role variant available for 'NativeCall::Native'
at <tmp>:1
jnthn At a C level it'll be mapped into a NULL argument to loadlib (or dlsym, forget off hand) 10:21
jmerelo jnthn: yep, I imagined as much. But I don't really get the rationale after using Str and not Any or Mu. Or the empty string.
p6: use NativeCall; sub getppid(--> long) is native {*}; say getppid;
camelia 811
jmerelo OK, it can use the empty string.
jnthn Right, that's the neater way :)
Empty string is a bit too likely to be an accident rather than intended 10:22
jmerelo Is this the code? github.com/rakudo/rakudo/blob/b07e...ll.pm6#L69
If you change that to "Mu" will it break everything asunder? 10:23
jnthn No
(as in, no, that's not the right place)
Why do you want to change it? Just use the `is native` form without an arg :)
jmerelo jnthn: not really. I just want to know the rationale after using precisely Str and not Mu or just leave it empty. 10:24
jnthn I suspect it may almsot be an accident that Str means that 10:26
*almost
jmerelo jnthn: probably so :-) 10:27
OK, since I got that figured out, thanks to jnthn, next question is: Is there any CPPStruct ready to use without compiling an external C++ program? 10:29
As in, some part of the POSIX interface that's actually written in C++, or part of MoarVM, or Rakudo, or anything in general.
I suspect not, since the rakudo tests actually have to compile an external library, but just in case. 10:30
10:30 markong joined, timo joined, timo is now known as Guest8740 10:31 Guest8740 is now known as timotimo
jmerelo jmerelo: maybe I should put this in some other way. Is there any way of knowing what's readily available from the is native(Str) interface in the form of callable functions or (C|CPP) structs? 10:32
Maybe I should go to StackOverflow for that?
.tell jmerelo you definitely should
yoleaux jmerelo: Talking to yourself is the first sign of madness.
jkramer Is there are a way to make s/// return the modified value instead of modifying the lhv in place? Like s///r in P5? 10:33
Or any other way to do .subst(' ', '', :g), but shorter? :) 10:34
jnthn (S:g/' '// given $var) 10:35
jmerelo: Not sure you'll find any CPP structs. I guess the various things from libc and other posix-y things can be relied on if you're on such a platform. 10:36
jmerelo jnthn: OK, created the question anyway stackoverflow.com/questions/499995...rom-the-na 10:38
jkramer What's uppercase S? Can't find it on docs.perl6.org/language/regexes
moritz return the string with the substitutions, instead of modify-in-place 10:39
jmerelo jnthn: but, theoretically, you can access more layers than just posix, right? At least MoarVM and Rakudo, although this last one is probably not very native. 10:40
jnthn You could I guess find MoarVM functions, yeah
jmerelo And MoarVM is actually written in C, right?
jnthn Rakudo is written in Perl 6, not C, so you won't find its internals that way :)
Yes, MoarVM is C
timotimo finding the functions inside moarvm for its internals will do you little good unless you also find where the MVMInstance lives :P 10:41
or one of the MVMThreadContexts
well, i suppose a pointer to one of those will usually be on the stack 10:42
jnthn But you could create an instance ;-)
jmerelo timotimo: and they will be available as VMStruct, right?
jnthn MoarVM in MoarVM :)
timotimo what's a VMStruct? 10:43
jmerelo timotimo: nothing. I seemed to remember there was something like that in the NativeCall interface. 10:44
jkramer moritz: I thought so, what I meant was: where's the documentation? :)
jmerelo jkramer: please create an issue. I haven't been able to find the documentation either. 10:45
jkramer jmerelo: Will do 10:46
jmerelo timotimo: repr('VMArray'), that's what I remembered... there is no repr('VMstruct') (I guess)
10:48 Zoffix joined
jmerelo jnthn: there are a bunch of NativeCall::Compiler classes, most of which include CPPStructs. Could that be used? 10:48
jkramer: thanks.
Zoffix jkramer: docs.perl6.org/language/operators#...bstitution 10:49
timotimo moarvm is written in C, its structs are just C structs, there's no need for a VMStruct representation or something like that 10:50
Zoffix
.oO( a tool where you type characters and it filters a list of possible Perl 6 ops/constructs those characters might be from, and links them to the docs )
jmerelo Zoffix: maybe the problem is that it's not indexed. That whole page is not indexed, anyway.
timotimo: but there's a VMArray... 10:51
jnthn jmerelo: Used for what exactly? 10:52
jkramer Zoffix: Ah, too late, already created the ticket :)
jmerelo jnthn: github.com/moritz/perl6-all-module...f8.pod6#L7 here, for instance. Just the first instance in search. 10:53
11:00 joy_ joined
timotimo yeah, VMArrays are very different from CArrays. what's the problem? 11:02
i see no reason to patch gcc, clang, and MSVC just so we can invent a VMStruct thing for moarvm 11:03
jnthn VMArray is just the representation of a resizable array provided by the VM 11:07
It's best treated as an implementation detail
I'd especialy treat types like utf8 being based on VMArray as an implementation detail
11:10 athenot joined 11:12 araraloren joined 11:13 athenot_ joined 11:14 athenot left 11:19 ggherdov left 11:20 ggherdov joined, ggherdov left 11:22 ggherdov joined, ggherdov left 11:25 AlexDaniel joined 11:29 wamba left
Geth doc: 69165a7a7c | (Luca Ferrari)++ | doc/Language/operators.pod6
Introduce difference between lower case and upper case substitution.

Waiting for upper case opertors like S/// to be indexed, provide a quick note to explain the difference between the two forms, so that readers can seek further documentation already present.
See issue #1959
11:30
synopsebot Link: doc.perl6.org/language/operators
11:34 raynold left 11:39 pnu__ left, pnu__ joined 11:48 mcmillhj joined 11:58 xtreak left
El_Che ufobat_, moritz: about returns: docs.perl6.org/type/Signature#inde...turn_Types -> "(1) This form is planned for future removal. (2) This form does not work with constant values" 12:12
ufobat_ jup, i've seen that :) 12:22
Geth doc: 704c7f7361 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/Signature.pod6
s/planned/proposed/;

The removal of `returns` trait was only ever proposed by TimToady and jnthn was against it. Currently, `grep -FR 'returns' | wc -l` gives 11,263 matches, so unless TimToady wants to invoke Rule 1, feels like the ship for making this change has sailed.
synopsebot Link: doc.perl6.org/type/Signature
doc: b1d633206b | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Language/operators.pod6
s/downcase/lowercase/;
12:31
synopsebot Link: doc.perl6.org/language/operators
12:36 Zoffix left 12:53 delgreco joined 12:57 Herby_ left 13:07 Herby_ joined 13:20 cog_ left
jkramer Are methods usually documented in any specific order? Seems pretty random to me, but maybe there's a system behind it. :) 13:25
13:32 skids joined 13:35 rodarmor left 13:36 rodarmor joined
lizmat jkramer: I think the system is: "whatever felt most logical at the time" 13:37
but jjmerelo might have a better idea about that 13:38
13:38 [Sno] joined
jkramer lizmat: Ok, so if I want to add docs for a method it's cool to just add it at the end? 13:38
lizmat if you consider that the most logical place, yes :-)
sorry if I'm not more specific, but if you look at CPAN, you see that the standard =head2 sections are usually in a specific order 13:39
but outside of that, really anything goes
13:40 sno left
jkramer lizmat: It's about a method in Any, which to me looks like a collection of random, mostly unrelated methods :) 13:41
lizmat yeah, then at the end seems like a good place
ooc, which method are you talking about?
jkramer Any.batch. I just added an issue (github.com/perl6/doc/issues/1960) but I thought I could just do it myself 13:42
Geth doc: 1073e7635f | (Will "Coke" Coleda)++ | 3 files
fix typos & learn new words

Use hyphenless variant of sigilless - we have it in many other places in the docs
13:43
lizmat jkramer: could you also add it to List, just like e.g. grep? 13:45
jkramer lizmat: Just copy/paste? 13:48
lizmat jkramer: if you look at docs.perl6.org/routine/grep you'll see that the Any version basically just mentions it calls .List.grep on it 13:50
and that the List.grep lemma contains the whole deal
13:51 curan left
jkramer Ah ok. I was confused because .batch is implemented for Any, not in List 13:51
Hmm this is getting more and more complicated. :) In the List docs, should I use the definition multi method batch(Any:D: Int:D $batch --> Seq) or rather List:D (or just leave that out)? 13:52
13:55 Zoffix joined
lizmat jkramer: good question 13:55
since jjmerelo is working on the documentation for a TPF grant, I think he should be the one to answer that
I have not been following the work in that area very closely lately :-( 13:56
Zoffix [Coke]: did those words ("absolutepath", "stdlib") get detected as not spelt right on HEAD of docs? I added them last night to xt/code.* words and the maketest was clean: github.com/perl6/doc/commit/936dd0...b5fed55ecb
jkramer Since most methods in Any currently don't mention Any:U/D in the definition I'll just leave it out for now 13:57
Zoffix [Coke]: also IIRC my version of aspell was detecting `sigilless` as an error last night; though only in that one place. Weird
13:58 cog_ joined
Zoffix "Are methods usually documented in any specific order" <-- FWIW, on any new docs I've always used alphabetical order. Much easier to look up details for a methods who name you know 13:59
With the exception of constructor, which goes first in the list. docs.perl6.org/type/IO::CatHandle.html 14:00
Geth doc: d0323e2c8d | (Jonas Kramer)++ | 2 files
Add documentation for Any.batch / List.batch.

See issue #1960
14:01
jkramer In List I put the batch docs right after .rotor since they're kinda similar, hope that's correct 14:02
Zoffix: Ah sorry, I read that too late
14:03 zakharyas left, zakharyas joined
Zoffix jkramer: I don't think that's a rule that's followed by most of the docs 14:04
There's also D#1331 ; IMO attributes/methods should be separated into separate sections 14:06
synopsebot D#1331 [open]: github.com/perl6/doc/issues/1331 [JJ TPF Grant][build][docs][site] Need clear documentation of public attributes
14:07 athenot_ left, Sgeo_ joined, athenot joined, zakharyas left 14:09 Sgeo__ left
[Coke] Zoffix: oops - I had fixed those locally yesterday, and didn't notice your changes, and they didn't conflict. I've been putting things that match actual methods or programs in words, and code was for rando code snippets from the examples. 14:09
(which is why I had them in my file and not yours - doesn't really matter, though, they can be removed from either one, np) 14:10
I'll clean it up. my bad.
Zoffix Ah 14:11
I've been putting stuff in =begin code or C<> into xt/code
[Coke] I tried to doc the purposes of each in xt/aspell.t, which is arguably the wrong spot. 14:13
Geth doc: 03bb3782c1 | (Will "Coke" Coleda)++ | xt/code.pws
Remove dupes

  Zoffix++
14:14 pilne left
[Coke] my original goal in splitting them was to make it obvious which words were obviously made up and just there to make the spellchecker hapy 14:14
*happy
14:15 epony left, epony joined 14:21 mcmillhj left 14:24 mcmillhj joined 14:35 cog_ left 14:36 Actualeyes left 14:38 Actualeyes joined, mcmillhj_ joined 14:41 dct joined 14:51 mcmillhj_ left, mcmillhj_ joined 14:52 mcmillhj_ left 14:53 mcmillhj_ joined 14:54 mcmillhj_ left, mcmillhj_ joined, mcmillhj_ left 14:55 mcmillhj_ joined 14:57 mcmillhj_ left 14:58 mcmillhj_ joined, mcmillhj_ left, mcmillhj_ joined, mcmillhj_ left, mcmillhj_ joined 15:02 Zoffix left 15:06 dct left, khw joined 15:10 cog_ joined 15:18 mcmillhj_ left 15:19 mcmillhj_ joined, dct joined, comborico1611 joined 15:24 dct left 15:25 araraloren left 15:26 simpleseeker joined
jmerelo releasable6: status 15:26
releasable6 jmerelo, Next release will happen when it's ready. 0 blockers. 266 out of 266 commits logged
15:27 dct joined 15:29 pharv joined 15:34 cog_ left, domidumont left 15:36 zakharyas joined 15:39 wamba joined, athenot left, athenot_ joined 15:40 cog_ joined, mcmillhj left 15:43 pharv left 15:44 simpleseeker left 15:46 pharv joined
Geth doc: a5e8797687 | (JJ Merelo)++ | 2 files
Adds a section for 'is repr'

For the time being, just `CStruct` is specified, but I'll (or someone will) be adding the rest. Refs #1863
15:47
buggable New CPAN upload: Algorithm-LibSVM-0.0.3.tar.gz by TITSUKI modules.perl6.org/dist/Algorithm::L...an:TITSUKI 15:49
jmerelo That's pretty cool. Another addition to the machine learning suite in Perl 6 15:50
15:50 amalia___ joined 15:52 dct left 15:53 zakharyas left 15:54 pharv left, simpleseeker joined 15:57 simpleseeker left 16:00 simpleseeker joined 16:01 pharv joined, dct joined 16:03 simpleseeker left, athenot joined, pharv left, cog_ left 16:04 pharv joined 16:06 athenot_ left 16:09 robertle left 16:12 lizmat left 16:13 dct left 16:16 lizmat joined 16:21 comborico1611 left 16:24 mcmillhj_ left 16:29 scimon left, dakkar left
Geth doc: fa60a76a63 | (JJ Merelo)++ | Makefile
Eliminate --parallel for htmlify.p6

Since it's not actually improving speed, and it causes hangs in some operating systems such as OpenBSD. This would close #1947, and refers to #1823 and also #1938, only I don't close that one since I guess the point of it is to fix it.
16:33
¦ doc: JJ self-assigned Check for unqualified Pod structures github.com/perl6/doc/issues/1914 16:35
16:36 domidumont joined
Geth perl6.org: f4953341fa | (Zoffix Znet)++ (committed using GitHub Web editor) | source/fun/index.html
List "The Principle of Charity" article and paper in -OFun

Probably conducive to the -OFun effort...
16:39
16:39 natrys joined
AlexDaniel huggable: star 16:40
huggable AlexDaniel, Estimated Rakudo Star releases for 2017: .01, .04, .07 & .10
AlexDaniel huggable: star :is: Estimated Rakudo Star releases: .01, .04, .07 & .10
huggable AlexDaniel, Added star as Estimated Rakudo Star releases: .01, .04, .07 & .10
AlexDaniel I think?
ye 16:41
16:51 espadrine_ joined 16:52 simpleseeker joined
jmerelo Perl6 questions in StackOverflow going up-ish github.com/JJ/TPF-Grant/blob/maste...canvas.png 16:54
16:54 simpleseeker left
jmerelo Um, scratch that. Nothing to see there. 16:54
AlexDaniel haha 16:55
16:56 dct joined
APic ,o0(Itchy versus Scratchy from the Simpsons) 16:56
16:57 mcmillhj joined
jmerelo You can look now github.com/JJ/TPF-Grant/blob/maste...stions.png 16:58
APic Good. 16:59
Very fine Graph!
17:01 athenot left
[Coke] jmerelo: note that fa60a76a63 doesn't actually eliminate the use of parallel. it just makes it implicit instead of explicit. 17:02
jmerelo [Coke]: The question is, it seems to actually solve the problem in the issue it closes... It does not solve the other issue, though. 17:04
[Coke] jmerelo: but when you run it without that option... you're defaulting to exactly that option. 17:08
So, I believe you, but am super confused as to how it could happen.
github.com/perl6/doc/blob/master/h...fy.p6#L175
note that he says on 1947 that he still has problems with parallel, but not explicitly with parallel=1 17:09
17:10 dct left
[Coke] parallel > 1 is definitely broken, (and parallel=1 is also broken, but *much* more subtly) 17:10
jmerelo [Coke]: that's right. 17:11
[Coke]: htmlify.p6 needs a major refactoring and I am happy to see you're working on that. Let me know if I can help. 17:13
17:14 athenot joined
[Coke] Roger. 17:14
17:24 ChoHag left 17:32 dct joined 17:34 simpleseeker joined 17:39 zachk joined, zachk left, zachk joined 17:46 delgreco left
El_Che releasable6: status 17:49
releasable6 El_Che, Next release will happen when it's ready. 0 blockers. 266 out of 266 commits logged
El_Che Zoffix: I have an updated rakudo-pkg README.md for the repo info for debs en rpms (github.com/nxadm/rakudo-pkg/blob/p...sitories). I don't want to change the rakudo site to not break the layout, but I think the repos should be mentioned (repos will be life with the release of 2018.04) 17:52
(if someone know how to enable the bintray for rpms, ping me. Debs do use gpg) 17:53
meant: (if someone know how to enable gpg for bintray rpms, ping me. Debs do use gpg) 17:55
17:57 FROGGS joined
FROGGS o/ 17:58
El_Che /o/ 17:59
buggable New CPAN upload: I18N-LangTags-0.0.1.tar.gz by UFOBAT cpan.metacpan.org/authors/id/U/UF/...0.1.tar.gz
El_Che jnthn: today used Cro as a http client. Nice! 18:02
jnthn: today I used Cro as a http client. Nice!
18:07 wamba left, pharv left
buggable New CPAN upload: I18N-LangTags-0.1.0.tar.gz by UFOBAT cpan.metacpan.org/authors/id/U/UF/...1.0.tar.gz 18:09
jnthn El_Che: Cool, glad you found it nice. :-) 18:12
El_Che jnthn: I found it so nice, that I think it should be part of the stdlib (like in Go) :) 18:14
18:20 pharv joined, natrys left 18:24 pharv left 18:25 pharv joined 18:28 sauvin left 18:32 natrys joined 18:39 Zoffix joined
Zoffix El_Che: you could file that as an issue :) 18:39
Just 'cause I helped with site migration doesn't mean I'm forever gonna be the only dev of it. 18:40
(also, IMO it should shouldn't be a link to a wall of text, but two select boxes that gen the right code/repo URLs to use)
18:43 comborico1611 joined
Zoffix As for breaking layout; just `git clone github.com/perl6/rakudo.org; cd rakudo.org; cpanm -vn --installdeps .; ./morbo` and preview the changes before pushing. No breakage 18:46
18:49 darutoko left 18:52 pharv left, pharv joined
stmuk I hadn't noticed perl6.services/ before ... maybe perl6.org needs a link to commercial services? 18:53
Zoffix +1 on some sort of "these companies/people make money thanks to Perl 6" 18:55
jmerelo El_Che: great.
18:57 zakharyas joined 18:59 cog_ joined, domidumont left 19:00 jmerelo left, pharv left 19:01 pharv joined, pharv left, pharv joined 19:02 wamba joined 19:04 |Sno| joined 19:07 aindilis left, [Sno] left, amalia___ left
El_Che Zoffix: ok, I'll send a PR 19:09
Zoffix El_Che: you should have a commit bit. Just commit directly and stick [REAPP] as the first thing in the commit title to have the updater cron job restart the app 19:11
El_Che Zoffix: ok, I went for the cautious approach, because webdevs are often kind of protective of layout :). Will do, thx 19:14
(will test it locally first, of course)
19:14 natrys left
El_Che 6pm looks nice. I wonder if it can run with PERL6LIB instead of its own "exec", like Perl 5's Carton. Giving it a spin soon. 19:16
19:16 simpleseeker left 19:20 zakharyas left 19:22 zakharyas joined 19:25 mcmillhj_ joined 19:26 mcmillhj_ left, mcmillhj_ joined, mcmillhj_ left, mcmillhj_ joined 19:28 athenot left, mcmillhj_ left 19:29 mcmillhj_ joined 19:31 athenot joined 19:38 hankache joined 19:40 Juerd is now known as nick_colors, zacts left 19:42 hankache left, nick_colors is now known as Juerd 19:43 hankache joined 19:49 aindilis joined 19:50 MasterDuke left 19:53 dogbert17 joined 19:55 hankache left 19:56 natrys joined 20:06 robertle joined
comborico1611 "comb" puts things in a list, not an array, correct? 20:09
(I tried to find out on Docs, but too confusing.) 20:10
Is Perl6 closer to Lisp than Ruby? 20:11
timotimo comb returns a Seq 20:13
moritz Lisp is homoiconic, but Ruby and Perl 6 are not. In this regard, Perl 6 is closer to Ruby 20:14
comborico1611 timotimo: Thanks! 20:15
20:16 FROGGS left
comborico1611 Is a "sequence" what Lisp calls a "list"? 20:16
moritz a sequence is closer to an iterator 20:17
comborico1611 Is there anything closer to a Lisp list than sequences in Perl6?
timotimo lisp lists are only cons cells, right? 20:18
no, wait, that was haskell
comborico1611 Correct, to the best of my newb knowledge.
moritz List is closer
comborico1611 moritz: Thanks!
20:21 Zoffix left
comborico1611 The main reason I came back to Perl6 over Common Lisp was readability via concise-ness. 20:23
What is returned when you use substr beyond bounds? 20:28
The REPL just did a blank nothing. Is that undefined? 20:29
timotimo m: say "foo bar".substr(100, 1) 20:30
camelia Start argument to substr out of range. Is: 100, should be in 0..7; use *-100 if you want to index relative to the end
in block <unit> at <tmp> line 1
timotimo m: say "foo bar".substr(1, 100)
camelia oo bar
timotimo m: say "foo bar".substr(7, 100)
camelia
timotimo m: say "foo bar".substr(8, 100)
camelia Start argument to substr out of range. Is: 8, should be in 0..7; use *-8 if you want to index relative to the end
in block <unit> at <tmp> line 1
timotimo m: say "foo bar".substr(8, 100).^name
camelia Failure
timotimo ok, so it's a lazy exception
comborico1611 m: my $dream = "I have a dream"; say $dream.substr(14); 20:33
camelia
comborico1611 m: my $dream = "I have a dream"; say $dream.substr(15);
camelia Start argument to substr out of range. Is: 15, should be in 0..14; use *-15 if you want to index relative to the end
in block <unit> at <tmp> line 1
comborico1611 [14] is newline? Hmm. 20:34
timotimo no, the newline comes from the say sub
say puts a newline after everything
comborico1611 So why no error on [14]?
timotimo because it's still in the string
just at the very end 20:35
comborico1611 What is it?
m: my $dream = "I have a dream"; $dream.chars;
camelia ( no output )
moritz m: my $dream = "I have a dream"; say $dream.chars;
camelia 14
comborico1611 Is [14] nil? 20:36
timotimo how do you mean?
20:36 zakharyas left 20:37 pharv left
comborico1611 m: my $deam = "I have a dream"; say $dream.substr(14).WHAT; 20:37
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$dream' is not declared. Did you mean '$deam'?
at <tmp>:1
------> 3my $deam = "I have a dream"; say 7⏏5$dream.substr(14).WHAT;
comborico1611 I'm just confused that there are only 13 characters in that string, but the system says there is 14.
timotimo how do you get that impression? 20:38
20:38 pharv joined
comborico1611 I just hand counted. There are 14 chars, but the last one is a space or something. 20:39
mcmillhj_ I'm a little confused about Hash#push. my %h; %h.push('a' => 'b'); # works %h.push(c => 'd'); # doesn't work
^ why is the quoting required here?
timotimo no, there are exactly 14 chars in that text, only three of those are spaces 20:40
mcmillhj_: a pair with an autoquoted key in a parameter list will be taken as a named argument, which Hash#push doesn't do anything with
if you want, you can add a second set of parenthesis, then you don't have to quote inside 20:41
mcmillhj_ hmm okay, is that related to the method signature of Hash#push? Or does that apply generally to all parameter lists? 20:42
20:43 pharv left
timotimo it applies to all parameter lists, it's just that methods by default have a slurpy hash parameter so you won't get an error if you add named arguments it doesn't expect 20:43
mcmillhj_ I also see this syntax in the docs my %h; $h.push: (a => 'b'); # works
Ugh, just noticed this in the docs: "Please note that Pairs or colon pairs as arguments to push will be treated as extra named arguments and as such wont end up the Hash. The same applies to the sub push.". Sorry for the un-needed question :) 20:44
timotimo no problem 20:45
20:46 pharv joined
mcmillhj_ well actually, what does the colon do exactly? Just used to disambiguate? 20:46
20:47 pharv left, pharv_ joined
timotimo well, a sub call without parenthesis is a statement prefix which will gobble the rest of the line up if it can, but method calls without parenthesis are very common (because attribute accesses are method calls, too) so if you want them as statementlist prefix you have to put something, and that something is the colon 20:48
tobs comborico1611: when you substr at index 0, you can read a string of up to 14 chars. When you start at index 14, you can read a substring of 0 chars, which is what you get.
comborico1611 How can you read no character? 20:50
mcmillhj_ timotimo: I understood some of that :) but I take it to mean it is an alternative syntax with which you can call a method. Is that an accurate summary?
timotimo yeah, that's fair 20:52
comborico1611 is topical variable ($_) always associated with "for"? 20:53
moritz no
mcmillhj_ timotimo: cool, thanks for the help !
comborico1611 Thanks!
Kaiepi when should you use latin1 instead of utf8-c8 with encodings for nativecall? 20:57
20:57 zacts joined
Kaiepi with one library i know to use utf8-c8 since it changes the locale to utf8, but what about those that don't? 20:58
timotimo depends entirely on what you want to do with the data 21:00
comborico1611 m: for "25-12-2016".split("-") -> $bob; say $bob; 21:02
camelia 5===SORRY!5=== Error while compiling <tmp>
Invalid typename 'say' in parameter declaration.
at <tmp>:1
------> 3or "25-12-2016".split("-") -> $bob; say7⏏5 $bob;
timotimo ; is valid in parameter lists 21:03
comborico1611 for "25-12-2016".split("-") -> $bob {say $bob}
evalable6 25
12
2016
comborico1611 What are the braces doing?
21:03 |oLa| joined
comborico1611 Is there an alternative synatax? 21:03
timotimo they are the block part of the pointy block that you started with ->
comborico1611 Ah, hence the name. I was wondering why it was called a block 21:04
timotimo yes, you can use postfix-for, i.e. say $_ for "25-12-2016".split("-")
block is a kind of code
comborico1611 So every use of -> requires { } ?
timotimo off-hand i can't think of one that doesn't 21:05
comborico1611 (In the context of pointy-blocks, not including other uses.)
I see. Thanks. I'm just trying to get a feel of how things are.
Kaiepi wdym timotimo
can you give some examples? 21:06
AlexDaniel well, sometimes you can get away with WhateverCode
not with for though, but in other cases
m: say <1 5 8 2 3 4>.grep: { $_ < 3 }
camelia (1 2)
AlexDaniel m: say <1 5 8 2 3 4>.grep: * < 3 21:07
camelia (1 2)
comborico1611 I see.
AlexDaniel m: say <1 5 8 2 3 4>.grep: -> $x { $x < 3 }
camelia (1 2)
timotimo Kaiepi: if you don't care about treating it as text, use latin1
m: say "☺".encode("utf8").decode("latin1")
camelia Can not decode a utf-8 buffer as if it were latin1
in block <unit> at <tmp> line 1
timotimo m: say "☺".encode("utf8").list.Buf.decode("latin1")
camelia No such method 'Buf' for invocant of type 'List'
in block <unit> at <tmp> line 1
timotimo m: say Buf.new("☺".encode("utf8").list).decode("latin1") 21:08
camelia âº
timotimo if it's okay with you to get this kind of string from that kind of input, use latin1
Kaiepi ah
so when would latin1 be appropriate to use? 21:09
timotimo when you only want to shove data from one piece of code to another without even something simple like counting how many characters are in it
comborico1611 .say for split ", ", "Jan, Feb, Mar" # Is .say shorthand for something else here? What is long version? 21:10
evalable6 Jan
Feb
Mar
timotimo $_.say is the long version 21:11
comborico1611 Thanks!
Kaiepi so i'm guessing it's not very useful
comborico1611 Danggit. It was the next line in teh book...
Man, this chapter on Strings is super dense. 21:12
timotimo another reason to have latin1 is when you absolutely don't want it to error out when data doesn't look like correct utf8
i'm not sure if utf8-c8 still complains about unicode codepoints outside the valid range 21:13
21:13 mcmillhj_ left
Kaiepi it doesn't 21:14
i think
m: "\x1FFFF".encode('utf8-c8') 21:15
camelia ( no output )
Kaiepi m: dd "\x1FFFF".encode('utf8-c8')
camelia Blob[uint8].new(240,159,191,191)
Kaiepi m: dd "\x1FFFF".encode('utf8')
camelia utf8.new(240,159,191,191)
Kaiepi wait 21:16
hold on lemme find one of the astral codepoints
m: dd "\xDC80".encode('utf8') 21:18
camelia Error encoding UTF-8 string: could not encode Unicode Surrogate codepoint 56448 (0xDC80)
in block <unit> at <tmp> line 1
Kaiepi m: dd "\xDC80".encode('utf8-c8')
camelia Error encoding UTF-8 string: could not encode Unicode Surrogate codepoint 56448 (0xDC80)
in block <unit> at <tmp> line 1
Kaiepi oh
m: dd "\xDC80".encode('latin1')
camelia Error encoding Latin-1 string: could not encode codepoint 56448
in block <unit> at <tmp> line 1
21:18 ufobat_ left 21:20 skids left
Kaiepi oh wait i know how to test this properly 21:20
timotimo that's the wrong way around :)
moritz m: say Buf.new(0xDC, 0x80).decode('latin1')
camelia Ü
Kaiepi hm maybe i don't 21:26
only way i've had encoding errors happen is screwing up with nativecall
21:33 robertle left 21:35 athenot left, athenot joined 21:40 yqt joined 21:43 simpleseeker joined
El_Che comborico1611: I update the PATH doc for now (branch will be live when v2018.04 releases) 21:45
comborico1611: github.com/nxadm/rakudo-pkg/tree/p...t-the-path
21:47 mcmillhj left 21:50 pharv_ left, espadrine_ left 21:52 rindolf left 21:54 mcmillhj joined 21:55 pharv joined 21:59 HaraldJoerg joined, HaraldJoerg left
comborico1611 El_Che: Thanks! 21:59
21:59 mcmillhj left
Kaiepi m: my @codepoints := 'abcdefghijklmnopqrstuvwxyz'.ords; dd @codepoints>>.chr 22:01
camelia Type check failed in binding; expected Positional but got Seq ($((97, 98, 99, 100, 1...)
in block <unit> at <tmp> line 1
Kaiepi m: my @codepoints = 'abcdefghijklmnopqrstuvwxyz'.ords; dd @codepoints>>.chr
camelia ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
Kaiepi is there an easier way to split a string by each character?
AlexDaniel m: say 'abcdefghijklmnopqrstuvwxyz'.comb
camelia (a b c d e f g h i j k l m n o p q r s t u v w x y z)
Kaiepi ohh
timotimo comb has many cool features
m: say 'abcdefghijklmnopqrstuvwxyz'.comb(2) 22:02
camelia (ab cd ef gh ij kl mn op qr st uv wx yz)
timotimo m: say 'abcdefghijklmnopqrstuvwxyz'.comb(3)
camelia (abc def ghi jkl mno pqr stu vwx yz)
AlexDaniel Kaiepi: buuut what is a “character” for you?
Kaiepi well, codepoint
timotimo oh
for that you need something else
AlexDaniel that's more difficult
timotimo but still not hard
m: say 'abcdefghijklmnopqrstuvwxyz'.NFD.list.chrs 22:03
camelia abcdefghijklmnopqrstuvwxyz
22:03 yqt left
timotimo m: say 'abcdefghijklmnopqrstuvwxyz'.NFD.list.>>.chr 22:03
camelia (a b c d e f g h i j k l m n o p q r s t u v w x y z)
timotimo m: say 'äbcdefghijklmnöpqrstüvwxyz'.NFD.list.>>.chr
camelia (a ̈ b c d e f g h i j k l m n o ̈ p q r s t u ̈ v w x y z)
AlexDaniel m: say 'äbcdefghijklmnöpqrstüvwxyz'.codes».chr
camelia ()
AlexDaniel m: say 'äbcdefghijklmnöpqrstüvwxyz'.ords».chr
camelia (ä b c d e f g h i j k l m n ö p q r s t ü v w x y z)
timotimo be advised that .ords gives you the base ords for every character 22:04
so if you have something very combined, pieces will get lost
Kaiepi so i'd have to use .codes?
timotimo more likely .NFD or .NFC
AlexDaniel Kaiepi: ok well, what are you trying to do in the first place? Why do you need codepoints?
Kaiepi i don't :^) 22:05
timotimo getting at the codepoints under a string is not as easy as getting at the graphemes for a reason: you'll shoot yourself in the foot
Kaiepi i was just curious
for what i'm doing i'm only dealing with ascii
AlexDaniel Kaiepi: so typically .comb will do what you want, yeah
especially if it's ascii-only 22:06
22:06 mcmillhj joined
Kaiepi perfect, thanks 22:08
22:08 lucasb joined 22:11 mcmillhj left
Herby_ \o 22:19
timotimo o/
22:20 dct left 22:22 dct joined
Herby_ timotimo: how goes it? 22:22
timotimo not great; slept on an uncomfortable pillow last night :\ 22:23
how about you?
El_Che Specially Linux newbies, feedback appreciated for the rakudo-pkg README at github.com/nxadm/rakudo-pkg/tree/pre2018.04
Herby_ that's no bueno. and i'm doing good, just sat down with some coffee :)
El_Che: I'm definitely a Linux newbie... 22:24
El_Che Herby_: critic away, then :)
22:26 mcmillhj joined
lucasb eagerly awaits this month release 22:27
jnthn Me too, then I can merge all my branches! /o\ ;-) 22:28
El_Che oooh 22:29
timotimo i have a branch or two, too
El_Che there is always .1 ;) 22:30
22:30 mcmillhj left 22:32 dct left 22:39 lucasb left 22:43 mcmillhj joined 22:48 mcmillhj left 22:51 pilne joined, natrys left
Herby_ El_Che: my initial thought is it looks great :) I'm not able to do an install following the commands right now, so I submitted a PR for a few typos I noticed 22:53
22:53 stee3 joined 22:54 pmurias left 22:55 simpleseeker left 22:56 stee left 23:03 mcmillhj joined 23:04 simpleseeker joined
timotimo hooray for union-find 23:06
23:08 mcmillhj left, skids joined
tobs m: my $m = try { die } ␤ || try { "ok" } 23:10
camelia ( no output )
tobs m: my $m = try { die } ␤ || try { "ok" }; $m.say 23:11
camelia (Any)
tobs m: my $m = try { die } || try { "ok" }; $m.say
camelia ok
tobs this ruined my test >_>
comborico1611 El_Che: My suggestion for Line 171: "add this to the hidden file in your home folder called .profile"
timotimo m: || say "hi" 23:12
camelia hi
timotimo that seems to be two prefix:<|> in a row, it seems like 23:13
i wonder why it wouldn't complain about useless use here
tobs I kind of liked my operators at the BOL of multiline statements 23:14
m: my $m = try { die } || ␤ try { "ok" }; $m.say
camelia ok
tobs at the end works
well, that's a lesson learned the hard way 23:15
timotimo yeah, } at the end of line is usually implied end-of-statement, but not for things like if-else
23:15 mcmillhj joined
tobs of that I heard. 23:16
I think it was in the context of feed operators, which *should* be used at the end, then, if you do "=> map {} => ␤" kind of things 23:17
s/=>/==>/ 23:18
timotimo right
of course there's also unspace
we used to require unspace before method calls that you wanted to put on the next line
23:18 thundergnat left
tobs oh, I was confused. So putting the operator at the end of line is safe in both cases. 23:19
noted
23:20 mcmillhj left
tobs m: my $m = try { die } \␤ || try { "ok" }; $m.say 23:21
camelia ok
23:23 markong left 23:29 raynold joined, MasterDuke joined 23:32 mcmillhj joined 23:36 mcmillhj left 23:38 comborico1611 left
tobs timotimo++ # just now realised that your comment about }␤ was relevant in my case 23:44
in my defense, it's already late
timotimo it is! 23:45
not too late for me to do some work :D
23:47 mcmillhj joined 23:52 mcmillhj left