»ö« 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.
El_Che with the alpine package a rakudo base image goes from a 150mb to 37mb 00:43
comborico1611 El_che, i can sympathize to the "with pain my heart I started rewriting the wrapper in go". 00:57
lookatme :) I don't like golang. 01:11
phogg languages that assign with := are all suspect 01:12
lookatme yeah, and the function signature syntax is uncomfortable 01:13
for me 01:14
samcv TimToady: okay thanks. i will fix the test then 01:18
i was 95% it was incorrect but wanted to double check since it was in roast
comborico1611 Anyone know about Java here? 01:40
lookatme I wrote a p6 script find source file like `find` 02:00
But it is too slow, so I rewrite it with nqp
lookatme And it is still slow than find, So I want use NativeCall improve it 02:02
But I faced some problem, here is the code: ideone.com/3i6Mv3 02:03
The readdir_r version always return nothing. And the readdir can not get .name or it will Segment fault 02:04
What's the problem with my code ?
MasterDuke comborico1611: i've done some java programming, you have a question about it? 02:05
comborico1611 Is it okay to learn Java 6 instead of 7? 02:06
lookatme Why you want learn the old one ?
comborico1611 Just to keep it in my back pocket, in case a job opportunity comes. 02:07
MasterDuke there's obviously lots of overlap, but all the java i've seen recently has been 7 or 8 02:07
comborico1611 And i don't have much money for new version book.
90% overlap? 02:08
MasterDuke i wouldn't worry about buying a new book. the differences should be easy to learn about from online resources
comborico1611 That was my thinking. Thanks! 02:09
geekosaur lookatme, the Dirent will already be passed as a pointer. sub readdir_r(DIR, Dirent, Pointer[Dirent] is rw --> int32) is native(Str) { * } 02:10
lookatme I will try 02:12
comborico1611 My order has been submitted. It's always exciting when you know a book is on its way. 02:16
comborico1611 Goodnight! I will remember this day, how i was discouraged but received hope from talking with some guys on #perl6! 02:22
lookatme :) 88 02:23
comborico1611 :-))
Big smile with some double-chin action. Night! 02:24
lookatme geekosaur, not working. I think the problem is `Str $.name`. The C side need consequent memory space. 02:40
geekosaur that is possible, NativeCall assumes Str behaves a certain way on the C side. Probably need a buf[uint8] and marshal/unmarshal from Str in the class 02:41
and preallocate the buf
AlexDaniel m: BEGIN {use nqp;put nqp::getlexdyn(‘$/’)} 03:05
camelia BEGIN {use nqp;put nqp::getlexdyn(‘$/’)}
AlexDaniel that's still far from 28 :(
still cool though. 03:06
AlexDaniel huggable: quine :is: BEGIN {use nqp;put nqp::getlexdyn(‘$/’)} 03:16
huggable AlexDaniel, Added quine as BEGIN {use nqp;put nqp::getlexdyn(‘$/’)}
dansimon Hi there! Can you do something like if (/firstline/ .. /lastline/){ print; } in perl6? 03:22
Juerd dansimon: Look for ff
AlexDaniel dansimon: what are you trying to do exactly? 03:24
dansimon Juerd: Ah, interresting... AlexDaniel: I'm trying to print a section of a file
More spesifically print from a matching line to an empty line 03:25
AlexDaniel wow, you actually need ff! :) 03:27
although you can maybe do it with a regex also, like /^^firstline$$ .*? ^^lastline$$/ (or something similar) 03:28
AlexDaniel but docs on ff conveniently give the example for exactly that use case :) docs.perl6.org/language/operators#infix_ff 03:29
dansimon thanks guys :) 03:30
Juerd AlexDaniel: ff is very useful in one liners; I use the equivalent quite often in Perl 5. 04:23
In any larger program, I find its hidden state annoying. 04:24
lookatme . 04:44
u-ou hi 04:45
lookatme hi ?
u-ou u-ou joined (sid257727@gateway/web/irccloud.com/x-ahbyooofghomedvy) 04:46
lookatme Still have some problem, but it can get other info except the name of file 05:07
ideone.com/G7vOaQ
The script `segmentation fault` when access name field 05:09
lookatme I think it has some bug of NativeCall, it can not handle array in C struct 06:03
ideone.com/HpjtHV
ZzZombo I'm going crazy. WHAT ON EARTH CAN MAKE IDENTICAL STRINGS NOT COMPARE SO? 09:00
ZzZombo For the past days I've been debugging a very specific problem, in a list of objects I need to find ones with a particular name, so I `.grep` the array that holds them with `*.name eq $name`, but somehow the check fails, so I get no results. I'm sure I do have matching objects in the array. 09:03
I can dump it, add debug output at the place where I populate it, and it all confirms that. Hell, I can copy the string I use to search for, and the name of matching elements from the debug output I've added, and run a simple `say <str1> eq <str2>` on camelia, and it yields `True` as expected. 09:05
But in the very specific method that searches for named objects it all fails bizarrely! I'm at the point of giving up. 09:06
I have no more ideas to check.
pmurias ZzZombo: maybe check that the strings are equal while extracting them from the array with a manually specified path? 09:09
pmurias ZzZombo: dumping the strings might be changing them 09:10
ZzZombo Can it be somehow related to encoding? The file that is used to parse and populate the array is in UTF-16LE, while the rest of the project is in UTF-8. 09:22
I can't find much info on encoding in the docs.
pmurias ZzZombo: try extracting the elements from the array using the indexes and see how they compare 09:23
ZzZombo I parse it using my hand-written `Grammar`, with the corresponding encoding supplied to `parsefile`. 09:23
I'll try it now.
ZzZombo `True`... 09:25
that is, the names' equal. 09:26
piojo ZzZombo: are they equal if you encode them both to binary (utf-8)? $a.encode eqv $b.encode 09:29
pmurias ZzZombo: if all things fail maybe golf your buggy program and nopaste it somewhere so we can tak a look?
piojo ZzZombo: last time I had a problem like that, it was because of a BOM which was invisible in text editors. A hex editor showed it to me. That may or may not be applicable. 09:30
pmurias ZzZombo: did you check that the .grep is actually trying to do the comparision? 09:32
ufobat___ is this spectest actually right? github.com/perl6/roast/blob/master...win.t#L319 on the first test I would expect C:\/ (where / is the "path") 09:48
for example, a "dir C:/" is not the same as "dir C:\" in the windows command line 09:49
ZzZombo piojo: yes, they are. 09:50
piojo ZzZombo: are the strings equivalent? $a eqv $b? 09:53
ZzZombo: If not, you can find which string is "funky": check $a.encode.decode eqv $a and $b.encode.decode eqv $b
Oh, you can do that check with '===' and not worry about 'eqv' 09:55
piojo Next, you can find out if there's part of a substring that's causing it to not match. First, check the whole string (to prove `substr` isn't changing the result): $a.substr(0..*) === $b.substr(0..*) 09:55
then use a binary search to find which region of the string doesn't match. preferably, just one character 09:56
ZzZombo guys... do you fancy zero width spaces? Because I surely don't. IS THEM TO BLAME!! 10:19
IT IS*
pmurias dislikes all the fancy unicodes 10:21
ZzZombo Man, I was really going crazy, it's driving you insane when you see impossible things happen, like if `$a === $a` yielded false w/o screwing with overloading and whatnot. 10:34
araraloren HI 11:14
El_Che twitter.com/nxadm/status/928947538618613760 <-- alpine pkgs for Rakudo == smaller docker images 11:29
El_Che sorry, that was meant for lizmat: twitter.com/nxadm/status/928947538618613760 <-- alpine pkgs for Rakudo == smaller docker images 11:38
lizmat El_Che++
pmurias El_Che: rakudo.js strategy question: to get travis to work with rakudo.js I should try to get node.js to work on top of the java travis? 11:40
yoleaux 11:14Z <Zoffix> pmurias: yes, there's a bug in moarvm with num stringification. It loses at least 1 digit of precision
araraloren If I do a post operator to server, I get a 302 status code. How I know what should I do next ? 11:50
araraloren GET the Location url in the header or ? 11:51
araraloren I use the module HTTP::UserAgent, it do a POST after get a 302 response code 11:52
araraloren And someone can help me ensue is this a bug of NativeCall: ideone.com/HpjtHV 11:55
The lib code is inside the script 11:56
araraloren :) Anyone interest on it please try that code . 11:59
pmurias <:Name> matches characters that have a name? 12:08
El_Che pmurias: I don't know enough (yet) about rakudo.js. Is it built on top of node?
pmurias El_Che: I'm running it on top of node.js 12:09
jnthn araraloren: Not a bug, because `char array[128];` in the struct means the values are stored directly in the struct body, but `has CArray[int8] $.array;` is a pointer to the array
araraloren jnthn, so what should I create that Struct ? 12:10
El_Che pmurias: docs.travis-ci.com/user/languages/...th-nodejs/ <-- it seems built in
jnthn araraloren: char *array;
El_Che pmurias: but you need to build regular moarvm rakudo as well? 12:11
pmurias: I just took the generic images, and put everything I needed in a container 12:12
pmurias El_Che: moarvm nqp
araraloren jnthn, I mean in Perl 6 side
jnthn araraloren: Not sure if that's possible yet
araraloren: As for the HTTP 302 question, I researched those a while back, and yeah, 302 means do a GET: github.com/croservices/cro-http/bl...t.pm6#L351 12:13
araraloren Actually I want solve this problem about `struct dirent` : ideone.com/G7vOaQ
El_Che pmurias: well, looking at my ubuntu 14.04 img (github.com/nxadm/rakudo-pkg/blob/m...64-14.04), the only thing needed is build-essential
and git
maybe wget to download the source 12:14
jnthn lunch, bbiab 12:14
araraloren Hmm, oh so it must do GET after get 302 , thanks
El_Che 14.04 packages (what travis run) are built by the image above and this script: github.com/nxadm/rakudo-pkg/blob/m..._rakudo.pl (you can ignore the pkging part)
the sub build does what you want, and that could be just a few lines of shell 12:15
El_Che so, yes, get the nodejs image, add build-essential, git and wget packages on top 12:16
and build away :)
the other way round is get the rakudobrew perl6 travis integration and install nodejs on top 12:17
ZzZombo What? There is rakudo.js? What's that? 12:18
araraloren jnthn, I think we are wrong, the wiki said GET is not a standard implement: en.wikipedia.org/wiki/HTTP_302 12:19
pmurias ZzZombo: in the js branch of rakudo
jnthn araraloren: Well, that's the difference between standards and what the real world does; the latter tends to be more useful :) 12:20
pmurias ZzZombo: it's rakudos JavaScript backend
araraloren jnthn, yeah, I know :) anyway thanks
ZzZombo That is, Perl 6 implemented in Javascript and usable from it?
pmurias It's Perl 6 compiled to Javascript 12:25
El_Che pmurias: it all depends what matrix you want to test 12:32
pmurias: against different node releases? against different rakudo releases? etc
AHoboWithAShotgu interesting. hexchat us acting up 12:50
i'm looking for a word,. when something doesnt need to know about something else, it is <xxx> to that something else. 12:51
AHoboWithAShotgu ah come on, i KNOW that word. i just can't get hold of it. 12:55
like "ignorant of" but more computer sciency
El_Che no patience 12:56
pmurias El_Che: testing against the newest node would be enough (and the js backend is part of rakudo so testing it against different rakudo releases doesn't make sense) 12:57
HoboWithAShotgun no, still here
HoboWithAShotgun as i said, hexchat acting up. 12:57
El_Che HoboWithAShotgun: Loosely Coupled? 12:58
HoboWithAShotgun nope
El_Che HoboWithAShotgun: separation of concerns? 13:00
HoboWithAShotgun no, i'm looking for an adjective. 13:00
El_Che separation-of-concernish?
:)
HoboWithAShotgun lol
thundergnat HoboWithAShotgun orthogonal perhaps? 13:01
El_Che not an adjective: Principle of Least Knowledge
ZzZombo eh, if my sub argument has a default value, shouldn't passing Nil into it make use of the said default instead of setting it to `(Any)`?
El_Che Law of Demeter
[Coke] ZzZombo: what's your sub sig? 13:05
ZzZombo sub loadKV_simple(Str:D $filepath,Grammar::VDF::Actions $parser=Grammar::VDF::Actions,|params) 13:05
MasterDuke HoboWithAShotgun: idempotent? 13:28
ZzZombo [Coke]: ^
HoboWithAShotgun m: sub x($y = "z"){ say $y; }(Nil);
camelia Nil
HoboWithAShotgun m: sub x($y = "z"){ say $y; }("a");
camelia a
HoboWithAShotgun m: sub x($y = "z"){ say $y; }(); 13:29
camelia z
HoboWithAShotgun interesting word, MaterDuke but no 13:30
MasterDuke agnostic? 13:31
HoboWithAShotgun yes. 13:47
that's it :)
ZzZombo #perl6, anybody with an answer to my question? 13:59
gfldex m: sub f($a = 42){ my $b = 'answer'; $b = $a; say $b }; f Nil; 14:01
camelia (Any)
gfldex m: sub f($a is raw = 42){ my $b = 'answer'; $b = $a; say $b }; f Nil;
camelia (Any)
gfldex ZzZombo: I'm undecided. 14:02
m: sub f($a is raw = 42){ my $b is default('answer'); $b = $a; say $b }; f Nil; 14:04
camelia answer
gfldex m: sub f($a is raw = 42){ my $b is default('answer'); $b = True; $b = $a; say $b }; f Nil;
camelia answer
gfldex ZzZombo: I would say the answer to your question is: It's complicated. 14:05
ZzZombo: The default value of a container (that is what concerns Nil) is not the very same as the default value of a parameter. 14:06
gfldex takes note of the ENOTDOC 14:07
lizmat it would make object creation quite a bit faster if it were, but the slightly different semantics make this 6.d material 14:08
ZzZombo I want it... it was a nasty surprise. 14:09
comborico1611 Morning, everyone. 14:11
jnthn The Nil returning a Scalar to its default value is a semantic of assignment, but signatures are bound 14:12
So while we might call both defaults, they have no mechanism in common at all
timotimo we currently set default values based on "how many positionals were passed" and "which named parameters were used", not at all "which values were passed", fwiw 14:13
that also allows us to throw out default value initialization code in spesh by knowing only the callsite; we can completely ignore what values were actually passed, since we know which were passed and which were left out
lizmat remembers the discussion with jnthn again 14:14
scratch the idea for is default for parameters :-)
timotimo in theory we could allow a syntax like sub foo($a //= "lol")
jnthn There's what Timo said, but also at the moment it's easy to explain when the default runs and people can rely on it meaning *nothing at all was passed" 14:15
jnthn //= in signatures is something I've wanted before :) 14:15
timotimo i have an idea how to implement, but not the wrists to do it 14:24
jnthn An RFC ticket is probably a decent idea 14:26
timotimo 6.d only? 14:27
jnthn There may be issues with the idea that I didn't think of
m: sub foo($x //= 1) { }
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed parameter
at <tmp>:1
------> 3sub foo($x7⏏5 //= 1) { }
expecting any of:
constraint
jnthn We could require use v6.d to get access to it
But it won't break anything
timotimo that's fair
funny exception messages when you run a 6.c that doesn't yet have it, though
comborico1611 I really like the name choice of slurp and spurt! 14:36
gfldex ZzZombo: filed as github.com/perl6/doc/issues/1669 14:37
comborico1611 I can picture Stroustrup objecting to the informal names. That's how he comes off to me anyway. A VERY professional formal guy. And that's okay.
gfldex where would the RFC ticket go? 14:38
jnthn gfldex: Rakudo issue tracker will be fine 14:53
El_Che AlexDaniel: I spent some time tuning the rakudo alpine packages and no failing tests so far. (You asked me to ping you before 2017.11 in case of alpine trouble) 14:57
AlexDaniel El_Che: sounds great! Thank you! 14:58
releasable6: status
releasable6 AlexDaniel, Next release in 8 days and ≈4 hours. No blockers. 0 out of 147 commits logged
AlexDaniel, Details: gist.github.com/20502fb599f6b4c340...42061cbbff
El_Che still time for some blockers :) 14:58
AlexDaniel yeah :)
robertle comborico1611: I was in a talk by stroustrup a while ago, when C++11 came out. he was talking about reasons why C++ is a great language, and the weird thing is that all the time htroughout the talk I was thinking larry would have said teh same thing about perl! very odd experience 15:02
it was all about community, long-term outlook, maturity, a powerful language, what aprts of the language should be verbose adn which should not... 15:03
census how do i read it 2 different variables from an input file? my current code reads in only 1 15:14
for example. input: pastebin.com/amWSE9dZ. i want the first variable to be $id. the second to be $term 15:15
code: pastebin.com/3mkbHq8p
lizmat census: contain the lines comma separated fields ? 15:31
census lizmat i'm not sure what you mean exactly. do you mean make it a .csv and not .txt ?
because i can control the input file
also it says length() has been dropped? 15:32
lizmat m: my ($id,$term) = "529,Hemophilia B".split(","); dd $id,$term # is that what you need ?
camelia Str $id = "529"
Str $term = "Hemophilia B"
lizmat m: say "a".length 15:33
camelia No such method 'length' for invocant of type 'Str'. Did you mean any of these?
chars
codes

in block <unit> at <tmp> line 1
lizmat usually you want .chars in that case
census lizmat yes i think the split command is what i want? how would i incorporate that though with my current code when i only had the disease name as in my @terms = "listpatentreo.txt".IO.lines.map: *.subst(:g, " ", "+").&uri_encode 15:34
that is, lizmat, how do i read it in from a .txt ?
lizmat well, I think you first need to figure out which steps you are taking: 15:36
lizmat I see: 1. read lines 15:36
then I guess: 2. split into id / term
then 3: uri_encode ?? 15:37
census lizmat how does the split command work? i'm looking at perl doc. can i just split on the comma? 15:39
lizmat yes, you can 15:40
census my ($id,$termname) = $term.split(",");
lizmat if $term contains "529,Hemophilia B", yup
census lizmat my code is pastebin.com/Gz9aacRP however it's outputting the words like "Hemophilia B" as "Hemophilia+B" 15:44
timotimo that's url encoding 15:49
though i would have expected %20 but i suppose both mean the same thing?
timotimo ah, + is only equivalent to %20 in the query part, not the path part? 15:51
timotimo at least the URI::Encode module always uses %20 for spaces 15:55
which module are you using to get the uri_encode function?
timotimo oh it does look like you're using URI::Encode 15:55
timotimo ... you are replacing spaces with + yourself 15:56
ZzZombo why? 16:02
m: sub x($a --> Str(Cool)){$a};say x('asd');say x(1)
camelia Str<51413496>
Int<51413616>
ZzZombo Isn't it supposed to turn it into strings? 16:03
Not into whatever is that.
timotimo i think coercion types as return type constraints aren't implemented yet 16:03
ZzZombo but the docs say otherwise then. 16:04
timotimo link please? 16:05
ZzZombo "...only implements them in signatures, for both parameters and return types."
timotimo huhk
ZzZombo docs.perl6.org/language/functions#...cion_Types
timotimo oh, haha 16:06
m: sub x($a --> Str(Cool)){$a};say x('asd').^name;say x(1).^name
camelia Str
Str
timotimo those are both strings
how is it doing it though? because it looks like it calls WHICH rather than .Str as it should
m: sub x($a --> Int(Cool)){$a};say x('999');say x(1 16:07
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in argument list; couldn't find final ')' (corresponding starter was at line 1)
at <tmp>:1
------> 3 --> Int(Cool)){$a};say x('999');say x(17⏏5<EOL>
timotimo m: sub x($a --> Int(Cool)){$a};say x('999');say x(1)
camelia Unable to coerce the return value from Cool to Int; no coercion method defined
in sub x at <tmp> line 1
in block <unit> at <tmp> line 1
timotimo pretty strange 16:09
timotimo like, what do our tests look like for this feature? 16:09
Geth perl6-most-wanted: bf3f303c4d | (Tom Browder)++ (committed using GitHub Web editor) | most-wanted/modules.md
update

remove published module Geo::Ellipsoid, add wanted module RTF::Writer
16:17
MasterDuke timotimo: there are some in S06-signature/definite-return.t
timotimo "definite" return, eh? that doesn't sound like the right file for coercion types in return 16:18
lizmat sorry census: was afk for a bit
ZzZombo I have been using a variation of 16:22
m: sub x($a){$_ ~~ Numeric ?? .Numeric !! .Str with val $a};say x('')
camelia 0
ZzZombo to save values as numbers where possible, but it turned out empty strings are converted to 0, but that's undesirable, what would be the easiest way to circumvent it? 16:23
ugexe m: sub foo($a) { say $_.Numeric }; foo(69) 16:26
camelia Use of uninitialized value of type Any in numeric context
0
in sub foo at <tmp> line 1
ugexe where is $_ coming from?
ZzZombo `with`
ugexe ah, thats a hellova statement to parse heh
comborico1611 robertle, that is interesting! Thanks. 16:28
timotimo ZzZombo: maybe use "val"? 16:29
m: dd val(""); dd val("abc"); dd val("999")
camelia IntStr.new(0, "")
"abc"
IntStr.new(999, "999")
ZzZombo did the `val` sub change this year or earlier? Because I don't remember it saying to return the string itself if it fails to parse a number... maybe it was just docs not completely up to date.
timotimo hmm.
it was always supposed to work on anything, i believe 16:30
ZzZombo Yeah, timotimo, I see now in the docs I can just use `val` w/o anything else for my purposes.
I swear it wasn't so back then I wrote this piece of code. In fact, I recall some of our channel regulars suggesting me this code for my problem, when I asked about it here. 16:31
MasterDuke c: all dd val("abc") 16:36
committable6 MasterDuke, gist.github.com/8bbf582d0d62d7ce03...ac9212c03b
Geth perl6-most-wanted: 32596209fc | (Tom Browder)++ (committed using GitHub Web editor) | most-wanted/modules.md
add WIP reference
16:43
gfldex ZzZombo: RFC filed as github.com/rakudo/rakudo/issues/1245 16:48
ZzZombo Good! 16:51
timotimo ZzZombo: be careful about the IntStr and similar objects, they will typematch Int and Str both, so your logic may need a bit of tweaking in some places 16:52
ZzZombo That's okay, I guess. 16:53
comborico1611 Ping 17:29
I guess I mean, reverse ping.
Or inverse ping?
moritz it's called "pong" :-) 17:31
comborico1611 You sure? When I'm just checking in, i send a ping but ping is usually when the other points to check-in on the "other guy". 17:33
I guess... 17:34
moritz ping is usually "ICMP echo request", and pong is "ICMP echo response". Works on IRC too :-)
[Coke] here, you typically ping someone, and they pong in response.
comborico1611 So I'm self-ponging! 17:35
TimToady both probably derived from the game of 乒乓 17:37
El_Che TimToady: you had to bring utf8 into the conversation, didn't you? :) 17:38
comborico1611 The ping is the initiator for a response, where checking-in is initiates nothing, it is not a response.
TimToady never thought of utf8; was thinking of Chinese 17:39
comborico1611 That looks like a graphic of a store-front.
With the the stores having lids for roofs. 17:40
moritz if you just want to announce your presence, a greeting is the usual way :-)
El_Che TimToady: :) 17:41
MasterDuke ftp.arl.mil/~mike/ping.html my dad's claim to computing fame is that he was roommates with Mike Muus in college 17:43
MasterDuke and if everybody hasn't already read it before, www.amazon.com/review/R2VDKZ4X1F992Q is great 17:43
comborico1611 Instead of given and when, i would have used is-it and this. So, isit $value {this 0..9 {say "one digit"} this $_ < 99 {say "two digits"}} 17:44
comborico1611 You'd read it as, "$value isit this? No. This? No. This. Yes! 17:46
moritz slightly confusing, because "this" in object-oriented code traditionally contains the invocant 17:47
comborico1611 That's how i read it in c++. The switch and... (Forgot the "when" equivalent) was confusing wording. 17:48
moritz case, probably
comborico1611 You're right. What about "that" ?
Yeah, case...
Switch and case are very foreign. Perl6 does much better. 17:49
moritz what's wrong with given/when? 17:50
"given a string, when it's 'x', print 42"
comborico1611 Stroustrup said switch statements are archaic. I think he meant obsolete. 17:50
moritz also "given" works without "when" too
comborico1611 He said that in his Programming book. 17:51
I see.
moritz m: given "abc" { say S/a/x/; .say }
perlpilot I'm pretty sure he didn't mean obsolete. There's still some good use case for the "simple" switch
camelia xbc
abc
moritz perlpilot: duff's device, eh? :-)
perlpilot :-0
er, :-)
comborico1611 I really don't have the experience to make the judgement call. I only read it naturally as "is it" and "this". 17:52
El_Che switch is a very ideomatic way to write if - if else - ... - else construction
in go by example
TimToady the main problem with switch/case from my perspective is that it's using nouns that name the construct rather than just using natural functor words for topicalization and conditionalization 17:53
TimToady it's as if, instead of "if", they used "conditional" 17:53
conditional $a == $b { say "True" } 17:54
moritz sounds very COBOLesque
El_Che mm
moritz just needs to shout it
TimToady at least COBOL had the sense to use verbs like PERFORM
moritz CONDITIONAL $a .EQ. $b { say "TRUE" }
El_Che TimToady: I had to read your sentence twice, but indeed. 17:55
TimToady comborico1611: the problem with "isit" is that it sounds like it's asking a yes/no question, when it's really just topicalization
perlpilot you know, I never really thought about why switch/case are named thusly or who came up with those names 17:56
El_Che perlpilot: that's TimToady's job :)
comborico1611 I don't have the experience to understand topicalization. Bravo, though, for whoever came up with slurp and spurt. 17:57
AlexDaniel hah :)
moritz slurp was easy 17:58
comborico1611 The way I learn how to program, is to speak the commands in English. And, if I cannot figure out how to phrase in English, I don't learn it.
moritz but all English verbs that relate to produce large amounts of output at once sound kinda dirty
TimToady yeah, spurt is just the least worst :) 17:59
perlpilot and it fits well with slurp 17:59
comborico1611 I never realized spurt is a word. But it describes the priest peculiar action very well.
Minus priest (Android keyboard) 18:00
TimToady was wondering what the priest was spurting...
timotimo hey TimToady, how do you like the syntax 'sub foo($bar //= "hi") { }' for values that get a default if anything undefined or if nothing at all is passed? 18:01
perlpilot timotimo: as opposed to? ;) 18:02
TimToady it seems relatively straightforward
comborico1611 The only reason i have any interest in perl is because of your Think Big interview videos on YouTube.
timotimo 'sub foo($bar = "hi") { }' which gives a default if nothing is passed, otherwise lets anything through, even Nil or Any
perlpilot: ^
AlexDaniel speaking of naming things, I'm constantly bothered by stuff that has different amount of characters. For example: True and False 18:03
timotimo True and Fals
perlpilot AlexDaniel: you'd rather Tru and Fal? ;)
comborico1611 Big Think*
moritz O_CREAT
postgresql uses t and f for true and false 18:04
AlexDaniel True and Nono? :) Well, there are these thingies: ⊨ ⊭ …
moritz (though "true" and "false" also work, iirc)
AlexDaniel u: ⊨⊭
unicodable6 AlexDaniel, U+22A8 TRUE [Sm] (⊨)
AlexDaniel, U+22AD NOT TRUE [Sm] (⊭)
perlpilot comborico1611: long before I knew who Larry Wall was, I was draw to perl because a) someone I admired suggested it and b) once I played with it, I was amazed at how "comfortable" it felt -- lots of power and easy to get into and minimal restrictions
comborico1611 I see. 18:05
TimToady still doesn't know who Larry Wall is...
AlexDaniel but I guess ⊨ ⊭ are used for a different purpose so not that great of an idea
El_Che TimToady: a famous guy with hawaii shirt and big hats 18:06
perlpilot TimToady: you can never know who someone is in the same way that you can never step in the same stream twice. 18:07
moritz it's funny how children tend to ask the hard questions, like "who are you?" 18:08
huf that's easy... compared to the 49th "why" 18:09
comborico1611 Alright, guys. I need to get ready for lunch. I'll have to tell my brother and wife that i spoke to the Larry guy today. Pretty neat!
wander perlpilot: perl is the best language of all bad languages, no language always be good :(
yoleaux 9 Nov 2017 20:46Z <Zoffix> wander: Yes: rt.perl.org/Ticket/Display.html?id...et-history You can see all open tickets on fail.rakudo.party (plus GitHub Issues: github.com/rakudo/rakudo/issues P.S.: we also have #perl6-dev
El_Che camelia: bon appetit 18:10
timotimo perlpilot: any opinion on the //= thing in signatures? 18:12
moritz botnom :-)
perlpilot wander: well ... it's just like when people ask "is this the best way to do X?"; you need some criteria for "best"--best along the "least memory usage" axis, best along the "fastest execution" axis, best because it's the simplest to understand, best because it's least likely to go wrong ... what's the criteria? All programming languages suffer this.
timotimo: +1
wander timotimo: so we have both `=` and `//=` ? 18:14
if implemented
timotimo yes 18:15
wander a new trap :P
perlpilot wander: trap?
moritz I'm not sure there is need for that, but if there is, I like the syntax 18:16
wander that how you imply 'default' parameter
gfldex m: multi s(Any:D $a) { say $a }; multi s(Any:U $a) { s 42 }; s Nil;
camelia 42
moritz more often, I'd like to say on the caller side "give me the default"
but //= is callee-side
timotimo jnthn pointed out he'd wanted that in the past 18:17
doing it on the caller side is a bit difficult, what with multiple dispatch and complicated signatures 18:18
moritz right
I guess it helps if you have two functions, and one mostly passes arguments to the second 18:19
wander more like `sub f($a is default(42)) { ... }` and keep consistency of Nil assignment (quite verbose though)
moritz then you can get away with declaring the default values only in the second, and use a simple ? to make them optional in the first
timotimo no, signature binding is binding, not assignment
gfldex m: multi s($a = 42){ say [$a ~~ Nil, $a.^name] }; s Failure.new("foo"); 18:20
camelia [True Failure]
timotimo interesting datapoint. if implemented naively, the definedness check in the //= will disarm a Failure object 18:22
m: my $foo = Failure.new("oh"); my $bar is default(99); $bar = $foo; say $bar; say $foo
camelia oh

Actually thrown at:
in block <unit> at <tmp> line 1
timotimo m: my $foo = Failure.new("oh"); say "test"; my $bar is default(99); say "test2"; $bar = $foo; say $bar; say $foo 18:23
camelia test
oh

test2
Actually thrown at:
in block <unit> at <tmp> line 1
timotimo m: my $foo = Failure.new("oh"); say "test"; my $bar is default(99); say "test2"; $bar //= $foo; say $bar; say $foo
camelia test
oh

test2
99
Actually thrown at:
in block <unit> at <tmp> line 1
timotimo hm, it doesn't say handled, eh?
perlpilot timotimo: what precipitated adding //= to sigs? (I know the topic if differentiating between the caller providing a value and providing a defined value keeps coming up, but I haven't really paid attention to the details) 18:25
timotimo it's annoying to use flattening to get the default value for some argument 18:26
tbrowder i just looked at wikipedia article on p6 and wonder if snake-case naming is worth a mention (it sure is handy for two-finger typists!) 18:44
timotimo but that's kebap-casing rather than snake-casing? 19:13
i *think* snake_casing is with underscores?
wikipedia tends to agree on that 19:15
TimToady I believe the reference is to a boa constrictor swallowing an elephant, as in stephaniebrewton.wordpress.com/201...r-talents/ 19:28
wander what's your opinions on documented Named Regexes? Should it be in /lang/regex, /lang/grammar, or both (for verbose is sometimes good). 19:44
perlpilot wander: redundancy is a good thing in this case IMHO 19:45
wander additionally, 'subrules' don't have to be named
comborico1611 oin: khw [2601:281:8380:7f0:a5f4:ab25:7b30:eeab] 19:46
<robertle> comborico1611: I was in a talk by stroustrup a while ago, when C++11 came out. he was talking about reasons why C++ is a great language, and the weird thing is that all the time htroughout the talk I was thinking larry would have said teh same thing about perl! very odd experience
<robertle> it was all about community, long-term outlook, maturity, a powerful language, what aprts of the language should be verbose adn which should not...
Wander, you reminded me of that which was said earlier today. 19:47
wander what's that
comborico1611 Stroustrup saying which parts of the language should be verbose, and which parts shouldn't. 19:48
I just received news on when the next Deitel C++17 (from Paul Deitel himself) will be released. 19:50
(Parentheses in a confusing place.) 19:51
tbrowder sorry, i meant kebab 19:54
wander emmmmm...now I am thinking about we ought to call them 'subrules' or something better 19:55
'Named regex' implies they should be named
wander and we actually have declarator 'regex', 'rule' and 'token', so call them 'subrules' a little improperly 19:56
m: my $pattern = regex { \w+ }; say "abc" ~~ $pattern 19:57
camelia 「abc」
comborico1611 let me preface this statement with this, I'm just giving my feedback as someone new to programming and you to Pearl 6. I don't actually think my way is the best way. No I'm going to write in that style. The topical variable is a bad name. Alias should be somehow used in the name. 20:09
You = new
ufobat m: IO::Path::Win32.new(:volume<C:>, :basename("/\x[308]")).absolute.say 20:09
camelia Cannot dispatch to method new on IO::Path because it is not inherited or done by IO::Path::Win32
in block <unit> at <tmp> line 1
comborico1611 No = though
ufobat huh!
comborico1611 But I'm liking Perl6 more and more. 20:10
ufobat m: IO::Path.new(:volume<C:>, :basename("/\x[308]"), :SPEC(IO::Spec::Win32).absolute.say 20:11
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in argument list; couldn't find final ')' (corresponding starter was at line 1)
at <tmp>:1
------> 3]"), :SPEC(IO::Spec::Win32).absolute.say7⏏5<EOL>
ufobat m: IO::Path.new(:volume<C:>, :basename("/\x[308]"), :SPEC(IO::Spec::Win32)).absolute.say 20:12
camelia IO::Path is disallowed in restricted setting
in sub restricted at src/RESTRICTED.setting line 1
in method new at src/RESTRICTED.setting line 32
in block <unit> at <tmp> line 1
ufobat is confused, this works on my box 20:13
comborico1611 Hmm. Mysterious call from San Jose... I wonder who they could be... 20:16
comborico1611 They said i just won a trip to the Bahamas. 20:23
ufobat my congratulations :-) 20:24
comborico1611 Heh. I think it's a scam. I don't even live in California. 20:27
Great production they put on.
jstuder hi everyone. 21:42
haven't been on irc yet 21:43
I've contributed a bit to the doc repo
as jstuder-gh (donkey picture) 21:44
and wanted to introduce myself
japhb jstuder: Hi there! You happened to have come to visit during a bit of a lull.
jstuder i see. no problem 21:45
japhb I normally don't follow this channel because it's much too fast most days. But since I happened to be here ... well, it's always nice to have someone respond when one says hello for the first time. :-)
jstuder I agree. Thanks
I figured that I should pop in here since i've been contributing but have never actually spoken to anyone :P 21:46
japhb We're a pretty friendly bunch.
But the mix of who is actually around varies pretty strongly by timezone and weekday v. weekend. 21:47
jstuder okay. thanks for the heads up.
ufobat welcome :-) 21:48
jstuder In the doc repo, I noticed in doc/language/syntax that the { } hash literal operator is used. Since Issue #1380 states the %() is the preferred style, I want to change it to that. 21:57
I'm not sure if I should include the { } delimiters as well. It's already documented in doc/Type/Hash
and I don't want to copy and paste the explanation as to why its not preferrable 21:58
jstuder i figure that if people want to they can check Hash to get the full story. 22:00
any objections? 22:01