»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_log/perl6 | UTF-8 is our friend! 🦋
Set by Zoffix on 25 July 2018.
tobs m: sub prefix:<±> (Numeric $x) { $x|-$x }; say so 1/0 ~~ ±Inf; say so -1/0 ~~ ±Inf 00:00
camelia True
True
Elronnd I'm using this perl6intro.com/#_assignment_vs_binding and in the part about binding it says my $a; my $b; $b := $a. When I type that into the repl, it gives me an error message of "Cannot use bind operator with this left-hand side" 00:04
tobs Elronnd: try to write it all in one line 00:05
(I don't know why but then it doesn't throw over here)
benjikun m: my $a; my $b; $a := $b;
camelia ( no output )
timotimo yes, the REPL is often a bit wacky 00:06
Elronnd ok 00:07
benjikun Yeah, works fine if you type it out in a program in any way
Elronnd awww 00:09
it would be *really* nice if I could do $x := $y; $y = x + 1 and then evaluating $y leads to stack overflow 00:10
timotimo what you want is a symbolic math package
buggable: eco symbolic
buggable timotimo, Math::Symbolic 'Symbolic math for Perl 6': modules.perl6.org/dist/Math::Symbol...ub:raydiak
timotimo i believe this hasn't been updated in a while
benjikun I don't think he does
Elronnd can I have multidirectional bindings like $x := $y; $y := $z and then if I modify one both of the others are also modified? 00:13
timotimo binding means two variables now serve the same underlying object
so when you bind $x := $y and $y := $z, you'll have $x point at what $y used to have, but $y will now share only with $z 00:14
if you want all three to share the same thing, you need $x := $y; $z := $y
Elronnd ahh ok
benjikun m: my ($x, $y, $z); $y := $x; $z := $y; $x = 5; say $x, $y, $z; 00:16
camelia 555
00:19 DarthGandalf left 00:24 AlexDani` joined, p6bannerbot sets mode: +v AlexDani`
AlexDani` . 00:25
00:25 AlexDani` left, AlexDani` joined, verne.freenode.net sets mode: +v AlexDani`, p6bannerbot sets mode: +v AlexDani`, AlexDaniel left, AlexDani` is now known as AlexDaniel 00:27 Kaypie joined, Kaiepi left 00:28 p6bannerbot sets mode: +v Kaypie 00:34 astj joined, p6bannerbot sets mode: +v astj 00:38 lizmat left, astj left
Elronnd why is return type of a function with an arrow specified within the parens? why sub bla(x --> T), not sub bla(x) --> T? 00:42
AlexDaniel m: sub foo() returns Int { 42 }; say foo 00:43
camelia 42
Elronnd yeah but why with the arrow notation must it be within the parens?
AlexDaniel Elronnd: I guess a short answer is that it's part of the signature
m: sub foo(Str $x --> Int) {}; say &foo.signature 00:47
camelia (Str $x --> Int)
Elronnd junctions are neat
also the answer to the people who said if (x == 5 || 6 || 7) in another language (and thus potentially dangerous :P) 00:48
Zoffix m: sub prefix:<±> (Numeric $x) { $x|-$x }; say so 0/0 ~~ ±Inf; 00:49
camelia False
Zoffix m: sub prefix:<±> (Numeric $x) { $x|-$x }; say so $_ ≠ $_ with 0/0; 00:50
camelia True
Zoffix :)
timotimo Elronnd: you can have return type annotations in pointy block's signatures, too 00:51
00:51 Zoffix left, rdococ14 joined
timotimo m: my &bloop = -> $a, $b --> Int:D { $a + $b }; bloop(1, 2) 00:51
camelia ( no output )
timotimo m: my &bloop = -> $a, $b --> Int:D { $a + $b }; say bloop(1, 2)
camelia 3
00:52 p6bannerbot sets mode: +v rdococ14 00:57 rdococ14 left 01:05 colomon_ joined, rindolf joined, p6bannerbot sets mode: +v colomon_ 01:06 colomon left, colomon_ is now known as colomon, p6bannerbot sets mode: +v rindolf 01:09 DarthGandalf joined, p6bannerbot sets mode: +v DarthGandalf 01:22 jeromelanteri joined, p6bannerbot sets mode: +v jeromelanteri 01:23 Ven` joined 01:24 p6bannerbot sets mode: +v Ven`
Elronnd what's the difference between for bla -> \i and for bla -> $i? 01:25
timotimo $i will hold the value in "item context", and \i allows you to keep something in any context that it happens to already be in
Elronnd huh? 01:27
so \i will overwrite an existing $i if it exists, but $i will create a new $i just for this scope?
01:28 Ven` left
benjikun m: my $i = 1; -> \t { t++; }($i); say $i; 01:29
camelia 2
benjikun m: my $i = 1; -> $t { t++; }($i); say $i;
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
t used at line 1
01:29 astj joined
benjikun m: my $i = 1; -> $t { $t++; }($i); say $i; 01:29
camelia Cannot resolve caller postfix:<++>(Int); the following candidates
match the type but require mutable arguments:
(Mu:D $a is rw)
(Int:D $a is rw)

The following do not match for other reasons:
(Bool:D $a is rw)
(Bool:U $a …
benjikun w/e I think you get the point
01:29 p6bannerbot sets mode: +v astj
Elronnd yeah 01:30
01:34 astj left
tobs m: -> $s { say [+] $s }(1...10) ; -> \s { say [+] \s }(1...10) 01:44
camelia 55
10
tobs Elronnd: think that's the aspect timotimo talked about
can you figure it out? :) 01:45
Elronnd hmmm 01:46
m: -> \s { say \s}(1...10)
camelia \((1, 2, 3, 4, 5, 6, 7, 8, 9, 10).Seq)
Elronnd what is the ␤? 01:49
benjikun Newline
Elronnd m: say [+] \((1, 2, 3, 4, 5, 6, 7, 8, 9, 10).Seq)
camelia 10
benjikun `say` leaves a \n or newline on the end
Elronnd m: say [+] \((1, 2, 3, 4, 5, 6, 7, 8, 9, 10))
camelia 10
Elronnd I do not understand 01:50
tobs btw, in addition to what you're reading, I recommend this advent calendar door perl6advent.wordpress.com/2017/12/...ntainers/. I for one read it three times since last Christmas
benjikun m: my $number = 0; sub foo(\n) { n += 5; }; foo($number); say $number; 01:52
tobs Elronnd: the 1...10 is a Seq. If you stuff it into a scalar container using the "-> $s" signature, it will be "itemized" and the [+] hyperop treats it as one single thing. Since + is a numeric operator, it will coerce the entire Seq into a number, in that case 10, the number of its elements.
camelia 5
tobs But if the argument is sigil-less, "-> \s", it won't be itemized and [+] treats it as the Seq it is and iterates over it, taking the sum 01:53
benjikun m: say [+] \(1, 2, 3); 01:54
camelia 6
benjikun m: say [+] \((1, 2, 3));
camelia 3
benjikun m: \((1, 2, 3)).elems 01:55
camelia ( no output )
benjikun m: say \((1, 2, 3)).elems
camelia 1
01:55 ddstreet26 joined
benjikun See why it did that now, Elronnd? 01:55
`\((1, 2, 3))` treats (1, 2, 3) as one item in the list 01:56
01:56 p6bannerbot sets mode: +v ddstreet26
benjikun m: say \((1, 2, 3))[0]; 01:56
camelia (1 2 3)
01:57 ddstreet26 left
benjikun I think that's what you were asking :P 01:58
Elronnd ohh ok I see now
m: say +\(1, 2, 3)
camelia 3
tobs hrm, I might have said something wrong? (not uncommon at 4am.) Seems it's not only the sigil-lessness in the signature but the \ when it's used. 02:00
tobs queues the fourth reading of the advent calendar 02:01
benjikun It's a capture thing 02:02
tobs I see! 02:03
benjikun m: my $a = \(1, 2, 3); say $a.WHAT;
camelia (Capture)
02:05 sauvin joined, p6bannerbot sets mode: +v sauvin
tobs so, what I said was complete bogus and even the wrong way around :-/ 02:06
benjikun :P 02:08
tobs m: -> $s { say "-$_-" for $s }(1...10) 02:12
camelia -1 2 3 4 5 6 7 8 9 10-
tobs m: -> \s { say "-$_-" for s }(1...10) 02:13
camelia -1-
-2-
-3-
-4-
-5-
-6-
-7-
-8-
-9-
-10-
tobs now I think what I said earlier applies to this example and before I'm proven wrong, I'll hit the hay o/ 02:14
benjikun night
02:33 abraxxa joined, spycrab0 left, p6bannerbot sets mode: +v abraxxa 02:37 abraxxa left 02:48 w_richard_w joined, p6bannerbot sets mode: +v w_richard_w 02:52 abraxxa joined 02:53 p6bannerbot sets mode: +v abraxxa 02:54 drudgesentinel joined, p6bannerbot sets mode: +v drudgesentinel 03:06 aborazmeh joined, aborazmeh left, aborazmeh joined, p6bannerbot sets mode: +v aborazmeh 03:07 p6bannerbot sets mode: +v aborazmeh 03:09 Guest14099 joined 03:10 p6bannerbot sets mode: +v Guest14099, Guest14099 left 03:12 abraxxa left 03:24 Ven` joined, p6bannerbot sets mode: +v Ven` 03:27 araraloren joined, p6bannerbot sets mode: +v araraloren 03:29 Ven` left 03:49 drudgesentinel left 03:50 mdk10 joined, mdk10 left
Geth doc: 2dbf66ef11 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Language/modules.pod6
Reword module installation info

To address concerns on github.com/perl6/doc/pull/2253
04:06
synopsebot Link: doc.perl6.org/language/modules
04:07 Zoffix joined, p6bannerbot sets mode: +v Zoffix
geekosaur contemplates a certain infamous StackOverflow in response to recent list mail 04:07
Zoffix hopes the snarky replies are not something P6 community will be known for :)
FWIW: my stock photos plan expires tomorrow. I still have 11 pics to download that must be downloaded tomorrow. If anyone thinks we need some stock for something, find it on depositphotos.com/ and gimme the URL to it (to the actual pic, not just search results). 04:08
I already got all I could think of and those 11 will likely go into generic stock that'll likely never get used anywhere. 04:09
(gonna be downloading stuff in ~16hr)
04:10 Zoffix left
Elronnd geekosaur: which StackOverflow? 04:17
geekosaur stackoverflow.com/questions/1732348/ 04:19
04:20 Kaypie left
Elronnd hah 04:20
I've always liked that one
04:20 Kaypie joined
Elronnd what does 'use v6' do? I've seen it on some online things 04:20
04:21 Khisanth left, p6bannerbot sets mode: +v Kaypie
geekosaur mostly it catches you if you accidentally run it with perl 5, which will throw an error about an unsupported perl version 04:22
04:23 insidious0 joined 04:24 p6bannerbot sets mode: +v insidious0 04:25 insidious0 left
Kaypie how can i throw a custom exception when a nativecall sub returns an error, but can return two different kinds of errors? 04:27
04:30 aindilis left 04:41 aborazmeh left 04:44 Khisanth joined, molaf joined, p6bannerbot sets mode: +v Khisanth 04:45 p6bannerbot sets mode: +v molaf 04:46 aborazmeh joined, aborazmeh left, aborazmeh joined, p6bannerbot sets mode: +v aborazmeh, kent\n left 04:47 p6bannerbot sets mode: +v aborazmeh
Juerd Kaypie: You could write a wrapper function 04:52
04:53 TodAndMargo joined, p6bannerbot sets mode: +v TodAndMargo
TodAndMargo What is this error? 04:53
$ReturnStr = qqx ( curl $TimeOutStr -L $Url -o $FileName; echo \$\? );
Malformed UTF-8
How do I tell it I do not care what the character are going into $ReturnStr? 04:54
The file does download perfectly. The error occurs after the download 04:55
AlexDaniel TodAndMargo: are you sure that it is on that line? 04:58
TodAndMargo Malformed UTF-8 in sub CurlDownloadFile at /home/linuxutil/CurlUtils.pm6 line 52 04:59
52: $ReturnStr = qqx ( curl $TimeOutStr -L $Url -o $FileName; echo \$\? ); # Note qqx need a space before the (
AlexDaniel the reason I ask is because it seems like your stdout is just a number
and qqx shouldn't really catch stderr 05:00
so what is malformed there I'm not sure
anyway
TodAndMargo I want it NOT to catch the STDERR. Curl sends its progrss bar to StdErr.
AlexDaniel what about 05:01
TodAndMargo I just saw this: `/bin/sh: -o: command not found`
hmmmmmm
AlexDaniel $ReturnStr = run('curl', $TimeOutStr, '-L', $Url, '-o', $FileName).exitcode;
not only you don't have to echo anything to get exit code, but it's also bug free because there's no possibility for shell injection through $TimeOutStr, $Url and $FileName 05:02
TodAndMargo All I want is the exit code anyway. Thank you! 05:04
wait, what if I want both SteOut and the error code? 05:06
AlexDaniel my $proc = run(:out, 'curl', $TimeOutStr, '-L', $Url, '-o', $FileName); say $proc.exitcode; say $proc.out.slurp; 05:07
TodAndMargo: oh yea, I think I understand now. Your $TimeOutStr was interpreted by shell
so `/bin/sh: -o: command not found` totally makes sense 05:08
in general, it's easier to avoid `shell` and `qqx`
TodAndMargo my $TimeOutStr = " "; if $TimeOut { $TimeOutStr = "--connect-timeout $TimeOut"; }
05:08 ponbiki left
TodAndMargo I want to see curl's progress bar 05:08
AlexDaniel ok it was $Url then and not $TimeOutStr :) 05:10
05:10 ponbiki joined
AlexDaniel maybe ‘&’ character or something like that 05:10
TodAndMargo Fixed it. It was the url.
$ReturnStr = qqx ( curl $TimeOutStr -L \'$Url\' --output \'$FileName\'; echo \$\? );
I had to single quote the url
AlexDaniel I… wouldn't call that a fix…
05:10 p6bannerbot sets mode: +v ponbiki
TodAndMargo curl really, really wants their url's in single quotes 05:11
AlexDaniel that has nothing to do with curl
it is about how shell is interpreting your single string that you gave it
TodAndMargo here is an example from firefox of downloading that same file: 05:12
curl --header 'Host: cdn09.foxitsoftware.com' --user-agent 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:58.0) Gecko/20100101 Firefox/58.0' --header 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' --header 'Accept-Language: en-US,en;q=0.5' --cookie 'FoxitWebsiteRef=25bcpOMBoY0h%2BI5u6Lqx48D6bh0Ek%2B9IVb4a94Dxl8yumDnG%2FCmGTXIXLQQGOHEvVk3OdA' --header 'Upgrade-Insecure-Requests: 1' 'cdn09.foxitsoftware.com
AlexDaniel if your $Url variable had a ' in it, it'd break immediately
that has nothing to do with curl, it's how shell works
TodAndMargo No single quotes in the url. No worries there
AlexDaniel also should have no single quotes in $FileName 05:13
I mean, you can avoid all that trouble by just using `run`
as simple as that
TodAndMargo a single quote in the file name wold drive me bananas! Since I am the one generating the $FileName, no worries there either 05:14
AlexDaniel my $proc = run(:out, 'curl', ($TimeOut ?? "--connect-timeout $TimeOut" !! Empty), '-L', $Url, '-o', $FileName); say $proc.exitcode; say $proc.out.slurp; 05:16
there
works perfectly, no need to backslash a bunch of stuff
no need to double check that your stuff doesn't have “disallowed symbols” 05:17
doesn't pass anything through shell so just a tiny bit more efficient too
moritz "--connect-timeout $TimeOut" will pass a single arg, needs «...» instead 05:18
TodAndMargo run kills my progress meter from curl 05:19
AlexDaniel moritz: ah, yeah. I was also thinking maybe --connect-timeout=5 but curl doesn't support that?
TodAndMargo This is my debug before calling qxx 05:20
TimeOutStr = <--connect-timeout 6600> Url = <www.foxitsoftware.com/downloads/la...nglish> FileName = </home/CDs/WindowsInternet/PDF/FoxitReader-9.2.0.9297_Setup_Prom_IS.exe>
05:21 araraloren_ joined, p6bannerbot sets mode: +v araraloren_
AlexDaniel TodAndMargo: I just tried it and I can see stderr without any issues 05:21
05:22 epony joined, p6bannerbot sets mode: +v epony
TodAndMargo Did you see it count across the screen? 05:22
05:22 astj joined
AlexDaniel TodAndMargo: for a different URL, yes 05:23
TodAndMargo How do I talk to you guys on HexChat? I could not find where to put the address in.
05:23 p6bannerbot sets mode: +v astj
TodAndMargo Huh. Mine is totally blank is I use run 05:23
05:24 araraloren left, Ven` joined 05:25 p6bannerbot sets mode: +v Ven`
AlexDaniel my $TimeOut = 6600; my $Url = ‘www.foxitsoftware.com/downloads/la...=English’; my $FileName=‘foo’; my $proc = run(:out, ‘curl’, ($TimeOut ?? (‘--connect-timeout’, $TimeOut) !! Empty), ‘-L’, $Url, ‘-o’, $FileName); say $proc.exitcode; say $proc.out.slurp 05:26
evalable6 % Total % Received % Xferd Average Speed Time Time Time Current
AlexDaniel, Full output: gist.github.com/6c8a5468fc4f38448f...27bc690d75
AlexDaniel heh, poor evalable6 :D
05:26 astj left
AlexDaniel ↑ although here you don't need stdout I think 05:27
TodAndMargo Huh? Thank you! 05:28
05:29 Ven` left
TodAndMargo Oh I get it. I wrote my own call to "run" where I run it together without the segments. I always return all three, which is why I am not seeing it. 05:29
05:30 aborazmeh left
xinming_ Hi, I''m a bit curious, why will the - be better to use as a delimiter? I'm feeling strange, before in perl5, I always use _ as the delimiter for subs, But after I switched to perl6, it supports - and I can get used to it really fast, and then, I feel - is a better delimiter. 05:32
What is the reason behind all this?
curious the reason behind why - is better for human to accept 05:33
:-)
TodAndMargo I'm confused 05:35
AlexDaniel xinming_: because it is a we-use-it-all-the-time-in-English delimiter? :) 05:36
xinming_: and you_never see_text_like_this 05:37
benjikun I don't think that's proper use of `-` if you want to use it by the english-way-of-using-it 05:38
:P
`_` substitutes a space in my mind 05:39
tbh either one works fine, just separates words
xinming_ benjikun: I know they both worked fine. But as a Chinese, before, I always use _ for word delimiter. 05:40
benjikun I use _ when I'm doing lower-level languages 05:41
xinming_ so, to me, _ and - are almost the same. I learnt lisp, But never programming much in it, it uses - as delimiter, I don't feel the difference. After came to perl6, I can choose both _ and -, And after using -, I feel that I don't like the _ anymore.
benjikun and likeThis for higher level ones
fooBar 05:42
xinming_ so, it makes wonder, what caused me that - is better.
I don't like the likeThis as function name. to me, It's worse than like_this. :-)
benjikun :P
I've gotten used to either way 05:43
maybe you like `-` more because it's more vertically symmetrical
xinming_ maybe
AlexDaniel benjikun: why not? Who defines what I can and cannot use as a compound adjective? Are you going to call the compound adjective police? :) 05:44
but yeah maybe you're right :P
05:45 lizmat joined 05:46 p6bannerbot sets mode: +v lizmat
TodAndMargo What am I doing wrong here. I kow that the caret before the \d is the issue, but why? 06:05
p6 'my $x="8627-2.2.19882.exe"; if $x ~~ m/ ^\d "-" (.*?) .exe / {say "Found"};'
Never mind. I forgot the + ^\d+ 06:06
Any idea why this is failing: 06:21
ShortEntry =<4626-2.2.19882.exe> BaseTag =<\d+> Extension = <.exe>
PrintGreenErr( "ShortEntry =<$ShortEntry> BaseTag =<$BaseTag> Extension = <$Extension>\n" ); if $ShortEntry ~~ m/ ^$BaseTag "-" (.*?) $Extension / {
This works: PrintGreenErr( "ShortEntry =<$ShortEntry> BaseTag =<$BaseTag> Extension = <$Extension>\n" ); if $ShortEntry ~~ m/ ^$BaseTag "-" (.*?) $Extension / {
ops: $ p6 'my $x="8627-2.2.19882.exe"; if $x ~~ m/ ^\d+ "-" (.*?) ".exe" / {say "Found"};' Found 06:22
06:22 lizmat left 06:23 Ven` joined 06:24 p6bannerbot sets mode: +v Ven`, jmerelo joined, p6bannerbot sets mode: +v jmerelo 06:25 breinbaas joined 06:26 imcsk8_ joined, p6bannerbot sets mode: +v breinbaas, imcsk8 left 06:27 p6bannerbot sets mode: +v imcsk8_
Elronnd I have a function sub print-and-copy(Str $s) {, and the compiler is choking up on the '$s' with "Variable '$s' is not declared" 06:27
wtf??
m: sub print-and-copy(Str $s) { say $s; }
camelia ( no output )
06:27 Ven` left
araraloren_ TodAndMargo ShortEntry =<4626-2.2.19882.exe> , This is the code ? 06:28
Elronnd wait, hmm, no
sorry, I fucked up, figured it out 06:29
TodAndMargo `4626-2.2.19882.exe` is the string being tested.
araraloren_ m: my $BaseTag = "\d+"; my $Extension = ".exe"; say "8627-2.2.19882.exe" ~~ m/ ^$BaseTag "-" (.*?) $Extension /; 06:31
camelia 5===SORRY!5=== Error while compiling <tmp>
Unrecognized backslash sequence: '\d'
at <tmp>:1
------> 3my $BaseTag = "\7⏏5d+"; my $Extension = ".exe"; say "8627-2
expecting any of:
double quotes
term
araraloren_ you mean this ?
06:32 molaf left
araraloren_ m: my $BaseTag = '\d+'; my $Extension = ".exe"; say "8627-2.2.19882.exe" ~~ m/ ^$(BaseTag) "-" (.*?) $Extension /; 06:33
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared name:
BaseTag used at line 1
araraloren_ m: my $BaseTag = '\d+'; my $Extension = ".exe"; say "8627-2.2.19882.exe" ~~ m/ ^$($BaseTag) "-" (.*?) $Extension /;
camelia False
araraloren_ m: my $BaseTag = '\d+'; my $Extension = ".exe"; say "8627-2.2.19882.exe" ~~ m/ ^$BaseTag "-" (.*?) $Extension /;
camelia False
araraloren_ m: my $BaseTag = '\d+'; my $Extension = ".exe"; say "8627-2.2.19882.exe" ~~ m/ ^<$BaseTag> "-" (.*?) $Extension /; 06:34
camelia 「8627-2.2.19882.exe」
0 => 「2.2.19882」
TodAndMargo It does not bomb out. It just says false 06:35
araraloren_ Do you mean using $BaseTag as a pattern, not a literal ?
I am not very understand what you want to do 06:36
you should take a look at docs.perl6.org/language/regexes#Re...erpolation
TodAndMargo the <> seemed to fix it. I am looping through a list of entires in a directory and pushing onto a stack the ones that pass the testa 06:38
araraloren_ yeah, if you want using the string as regex pattern, you should using <> 06:39
TodAndMargo Thank you! 06:40
araraloren_ but notice the document said, it causes implicit EVAL
06:42 panopticon joined, p6bannerbot sets mode: +v panopticon 06:43 panopticon left 06:44 lizmat joined, p6bannerbot sets mode: +v lizmat 06:57 nasm joined, p6bannerbot sets mode: +v nasm, nasm left 06:58 nasm joined, p6bannerbot sets mode: +v nasm 07:01 reu left 07:03 mephinet left
Elronnd I don't mean to presume, and it's ok if not, but would anyone mind looking over this small script that I made and noting if I'm doing something unidiomatic? github.com/Elronnd/Uploader/blob/m.../upload.p6 07:03
07:07 mephinet joined, p6bannerbot sets mode: +v mephinet 07:08 xq left 07:11 reu joined, p6bannerbot sets mode: +v reu
nasm silly noob question, does `Str $arg -> Str` define a parameter of type `Str -> Str` named `$arg` or name a type where the parameter has the name `$arg`? 07:12
07:14 erdic left, erdic joined, p6bannerbot sets mode: +v erdic
araraloren_ nasm I don't think so 07:16
there is not XX -> XX in Perl 6 , I think
nasm oh. there's no type constructor for functions? 07:17
moritz what's a type constructor?
moritz is a typo constructor
nasm I'm borrowing terms from other languages, sorry. It's kind of like a type, except parameterized. Like `'a list` (ML) or `List<a>` (C++/Java) 07:18
list or List is the type constructor
Elronnd how is that different from a normal constructor? 07:19
nasm constructor as in data constructor or the magical almost-method that builds objects? 07:20
Elronnd the difference being?
benjikun nasm: Is this what you're talking about? wiki.haskell.org/Constructor#Type_constructor 07:21
nasm yes. I was just kinda surprised at the syntax `Str $msg --> Str` for declaring a parameter that happens to be a function instead of having a more complex type appearing to the left and was trying to figure out what was going on. 07:23
nevermind, I misinterpreted the syntax completely. sorry. 07:24
benjikun `--> Str` means the function returns a Str
TodAndMargo is there a way to write `if a || b` and not evaluate b if a passes? 07:29
07:30 w_richard_w left
benjikun Does it TodAndMargo? 07:30
m: sub a { return True }; sub b { say "CALLED B" }; if a() || b() { say "." } 07:31
camelia .
TodAndMargo not sure what you said. 07:32
araraloren_ Elronnd It's pretty good, but I recomend you using MAIN to write the script
benjikun not sure what you mean
araraloren_ m: if 1 || do {"called".say;} { say "True"; } 07:33
camelia True
Elronnd TodAndMargo: the answer is yes, and that's to write `if a || b` 07:34
araraloren_: ok, thanks
araraloren_ TodAndMargo so what do you mean ?
TodAndMargo I have a test. If the first part passes, I do not want it to evaluate the second part as it will throw an error. It will only not throw an error if the first part fails 07:38
Elronnd yes, you can just use || because it already does that
TodAndMargo Unrecognized regex metacharacter - (must be quoted to match literally) at /home/linuxutil/EVAL_4:1 ------> anon regex { CimTrak⏏-Enterprise-Server} 07:39
Elronnd (this is a common practice in c to prevent null dereferences -- if (x && x->arr && x->arr[0] == bla))
araraloren_ Elronnd in Perl 6 we have .? for that 07:47
Elronnd that is simultaneously really nice and infuriating 07:49
because it's ?. in kotlin
benjikun lol
Elronnd now, I've never done any serious programming in kotlin, but I went through the official tutorial and that's the part I remember
07:50 epony left 07:54 nasm left
TodAndMargo I had to install some escapes to fix the issue `( my $EscBaseTag = $BaseTag ) ~~ s:global/ "-" /\\-/;` 07:55
08:00 agree joined 08:01 p6bannerbot sets mode: +v agree 08:05 lizmat left, agree left
Geth doc: 8e211b7f4e | (JJ Merelo)++ | doc/Language/faq.pod6
Reflow

This also closes #2245 after successful upgrade. Should be working pretty soon.
08:10
synopsebot Link: doc.perl6.org/language/faq
08:27 sena_kun joined 08:28 p6bannerbot sets mode: +v sena_kun, erdic left, erdic joined, p6bannerbot sets mode: +v erdic 08:33 erdic left 08:34 kaare_ left 08:35 kaare_ joined, p6bannerbot sets mode: +v kaare_ 08:40 erdic joined, p6bannerbot sets mode: +v erdic 08:42 TodAndMargo left
Geth doc: d43e7a7ef3 | (JJ Merelo)++ | doc/Type/Int.pod6
Improves and adds examples, refs #2256
08:46
synopsebot Link: doc.perl6.org/type/Int
doc: 479add6b96 | (JJ Merelo)++ | 2 files
Adds polymod for Real, closes #2256
08:48 robertle joined 08:49 p6bannerbot sets mode: +v robertle 08:50 kaare_ left 08:52 RoBz13 joined 08:53 p6bannerbot sets mode: +v RoBz13, RoBz13 left 09:05 epony joined, p6bannerbot sets mode: +v epony 09:09 tobs joined, p6bannerbot sets mode: +v tobs 09:26 kent\n joined, p6bannerbot sets mode: +v kent\n 09:36 kerframil left 09:50 tobs left 09:51 erdic left 09:54 kaare_ joined 09:55 p6bannerbot sets mode: +v kaare_ 10:04 erdic joined, p6bannerbot sets mode: +v erdic, tobs joined, p6bannerbot sets mode: +v tobs 10:08 erdic left 10:10 robertle left 10:15 Kaypie left 10:38 robertle joined, p6bannerbot sets mode: +v robertle 10:45 Ven` joined 10:46 p6bannerbot sets mode: +v Ven` 11:00 molaf joined, p6bannerbot sets mode: +v molaf, erdic joined, p6bannerbot sets mode: +v erdic 11:22 xq joined, p6bannerbot sets mode: +v xq 11:28 HackMaster joined 11:29 HackMaster left
araraloren_ Hi, How I quit from a supply block ? 11:32
like I can `done` in that 11:33
11:35 Kaiepi joined, p6bannerbot sets mode: +v Kaiepi 11:44 jmerelo left
timotimo `quit` should quit, otherwise throw an exception i guess? 11:45
12:09 tokomer joined, p6bannerbot sets mode: +v tokomer
jnthn araraloren_: Just throw an exception 12:11
Any unhandled exception in a Supply block will be a quit
*supply
araraloren_ yeah, I see 12:12
and I have a trouble right now
evalable6: gist.githubusercontent.com/araralo...-supply.p6
evalable6 araraloren_, Successfully fetched the code from the provided URL
(signal SIGHUP) called
«timed out after 10 seconds»
araraloren_ with the first tap, the code hang on
Is something I am missing ? jnthn 12:13
It'll be fine if I add a done nameargument to the tap
sorry quit 12:14
evalable6: gist.githubusercontent.com/araralo...-supply.p6
evalable6 araraloren_, Successfully fetched the code from the provided URL
(exit code 1) 04===SORRY!04=== Error while compiling /tmp/zwWas44dzI
Undeclared routine:
ex used at line 19
12:15 vike1 joined
araraloren_ evalable6: gist.githubusercontent.com/araralo...-supply.p6 12:15
evalable6 araraloren_, Successfully fetched the code from the provided URL
(exit code 1) called
An operation first awaited:
in block <unit> at /tmp/aC1EyvPbn_ line…
araraloren_, Full output: gist.github.com/173c5372eb6876cf82...e399db0cce
12:15 p6bannerbot sets mode: +v vike1 12:16 vike left
jnthn araraloren_: Not sure what's happening there, maybe worth filing a Rakudo issue about. But I'd probably write it like this: gist.github.com/jnthn/d91b387c56d6...3a23ddca21 12:26
Which works
araraloren_ jnthn cool 12:27
I will setup a issue about that
12:33 kaare_ left 12:43 tobs left 12:47 tobs joined, p6bannerbot sets mode: +v tobs 12:53 kspencer5 joined, kspencer5 left 12:57 tobs left 12:59 erdic left 13:00 xinming_ is now known as xinming 13:02 rindolf left 13:03 kaare_ joined, p6bannerbot sets mode: +v kaare_ 13:04 rindolf joined 13:05 p6bannerbot sets mode: +v rindolf 13:07 tobs joined, p6bannerbot sets mode: +v tobs 13:11 erdic joined, p6bannerbot sets mode: +v erdic 13:31 Peetz0r16 joined 13:32 p6bannerbot sets mode: +v Peetz0r16, Peetz0r16 left 13:42 Some-body_ joined, p6bannerbot sets mode: +v Some-body_ 13:44 DarthGandalf left, Some-body_ is now known as DarthGandalf 13:58 jeromelanteri left 14:06 jeromelanteri joined, p6bannerbot sets mode: +v jeromelanteri, jeromelanteri left 14:13 jor2 joined, jor2 left 14:18 abraxxa joined 14:19 p6bannerbot sets mode: +v abraxxa
Geth marketing: fb6358672b | (Zoffix Znet)++ | 11 files
Add new stock
14:21
14:22 abraxxa left 14:27 Melody\Concerto2 joined, Melody\Concerto2 left 14:37 abraxxa joined 14:38 p6bannerbot sets mode: +v abraxxa 14:43 MilkmanDan left 14:44 MilkmanDan joined, p6bannerbot sets mode: +v MilkmanDan 14:47 BertolucciTalks left 14:48 Checking joined 14:49 p6bannerbot sets mode: +v Checking, Checking left 15:06 spycrab0 joined, p6bannerbot sets mode: +v spycrab0 15:10 zakharyas joined, Ven` left 15:11 p6bannerbot sets mode: +v zakharyas 15:16 MilkmanDan left, robinsmidsrod left, MilkmanDan joined, p6bannerbot sets mode: +v MilkmanDan 15:18 robinsmidsrod joined, p6bannerbot sets mode: +v robinsmidsrod, neptune joined 15:19 neptune left 15:25 jmerelo joined 15:26 p6bannerbot sets mode: +v jmerelo 15:27 O-dog1 joined 15:28 p6bannerbot sets mode: +v O-dog1, O-dog1 left 15:30 w_richard_w joined, p6bannerbot sets mode: +v w_richard_w 15:34 Ven` joined, p6bannerbot sets mode: +v Ven` 15:40 MilkmanDan left, MilkmanDan joined, p6bannerbot sets mode: +v MilkmanDan 15:41 natrys joined, p6bannerbot sets mode: +v natrys 15:57 Kaiepi left, Kaiepi joined 15:58 p6bannerbot sets mode: +v Kaiepi 16:03 raynold joined, p6bannerbot sets mode: +v raynold, raynold left 16:07 morsik25 joined, Libre joined 16:08 morsik25 left, p6bannerbot sets mode: +v Libre
Geth doc: cd5e7a1876 | Coke++ | doc/Type/Any.pod6
remove dupe word
16:08
synopsebot Link: doc.perl6.org/type/Any
16:20 Libre left 16:39 Ven` left 16:44 araraloren_ left 16:46 Ben643 joined, rindolf left, p6bannerbot sets mode: +v Ben643 16:47 Ben643 left 16:50 rindolf joined 16:51 p6bannerbot sets mode: +v rindolf
xinming For a non-required named params, Is it possible to set the default value for it? 17:07
17:08 zakharyas left
timotimo of course 17:08
m: sub no-need-for-names(:$name = "Unnamed") { say "the name is $name" }; no-need-for-names(name => "timo"); no-need-for-names() 17:09
camelia the name is timo
the name is Unnamed
xinming Got it, thanks
17:10 zakharyas joined 17:11 p6bannerbot sets mode: +v zakharyas 17:20 zakharyas left 17:22 w_richard_w left 17:30 hami joined, p6bannerbot sets mode: +v hami 17:31 silug left 17:35 Ven` joined 17:36 p6bannerbot sets mode: +v Ven` 17:37 pmurias joined 17:38 p6bannerbot sets mode: +v pmurias 17:39 Ven` left 17:41 hami left 18:02 luke-jr25 joined, p6bannerbot sets mode: +v luke-jr25 18:07 luke-jr25 left 18:13 mcspud20 joined 18:14 p6bannerbot sets mode: +v mcspud20, mcspud20 left 18:15 fryst17 joined 18:16 p6bannerbot sets mode: +v fryst17 18:21 fryst17 left 18:26 aindilis joined, p6bannerbot sets mode: +v aindilis 18:31 Sgeo__ joined, p6bannerbot sets mode: +v Sgeo__ 18:32 TreyHarris left 18:35 Sgeo_ left, Sgeo_ joined 18:36 Ven` joined, p6bannerbot sets mode: +v Sgeo_, p6bannerbot sets mode: +v Ven` 18:38 Sgeo__ left 18:41 Ven` left 18:47 TreyHarris joined, p6bannerbot sets mode: +v TreyHarris 18:48 tokomer left 18:49 Xliff joined 18:50 p6bannerbot sets mode: +v Xliff
Xliff Is there a better way to set proper usage than the following: sub MAIN(Int $num where 1..3) { 18:50
} --> Usage:
examples/pack_example.pl6 <num>
It works, but the usage message could be better defined. 18:51
18:54 zakharyas joined
Ulti Xliff you can do #`() comments on the parameters iirc 18:55
18:55 p6bannerbot sets mode: +v zakharyas
Ulti also sub USAGE lets you edit the string thats produced 18:55
18:56 kaare_ left
Ulti also #|(comment) for the actual MAIN if its a multi means you get docs for each command use 18:56
19:07 MasterDuke left
timotimo m: subset OneToThree of Int where 1..3; sub MAIN(OneToThree $value) { } 19:09
camelia Usage:
<tmp> <value>
timotimo hm, i thought it'd put the type name there
19:12 MasterDuke joined, p6bannerbot sets mode: +v MasterDuke, MasterDuke left, MasterDuke joined, herbert.freenode.net sets mode: +v MasterDuke, p6bannerbot sets mode: +v MasterDuke
Xliff Util: Thanks! I will have to remember that. Is there a writeup on how that should work? 19:18
Somewhere in the docs?
m: subset OneToThree of Int where 1..3; sub MAIN(OneToThree $value #`(1..3) ) { }
camelia Usage:
<tmp> <value>
Xliff Ulti ^^
AlexDaniel .tell Skarsnik rt.perl.org/Public/Bug/Display.htm...xn-1573999 19:28
yoleaux AlexDaniel: I'll pass your message to Skarsnik.
19:35 spycrab0 left 19:36 promote joined, p6bannerbot sets mode: +v promote 19:37 Ven` joined 19:38 p6bannerbot sets mode: +v Ven`
Ulti Xliff: yeah if you search for USAGE I think you get to the right bit of the docs 19:39
19:41 promote left 19:42 Ven` left 19:56 molaf left
xinming What module is recommend to get http data? LWP::Simple? 20:04
timotimo i think HTTP::UserAgent, or if you need some advanced stuff maybe Cro::HTTP has what you need 20:05
if you want something simple, go with WWW
xinming Thanks 20:06
Xliff You will find that as your project grows, you will need more of the features in Cro::HTTP than from any other module. 20:21
So if you are doing more than get requests, take the time to deal with the learning curve. It's not that hard.
xinming ^^ 20:22
20:28 Peng16 joined, p6bannerbot sets mode: +v Peng16
xinming Xliff: Thanks, Will try all of them. :-) 20:30
pochi what's the correct way to implement stingification of objects? 20:32
20:33 Peng16 left 20:38 Ven` joined 20:39 p6bannerbot sets mode: +v Ven` 20:42 sena_kun left, albel72729 joined
MasterDuke pochi: give them a .Str method 20:43
20:43 Ven` left, p6bannerbot sets mode: +v albel72729 20:44 albel72729 left
pochi MasterDuke: doesn't seem to work 20:48
MasterDuke m: class Foo { method Str() { "I am a Foo" }; }; my $a = Foo.new; say "I am a human, but |$a|" 20:58
camelia I am a human, but |I am a Foo|
pochi hm, I did it a bit different
m: class Foo { method Str() { "I am a Foo" }; }; my $a = Foo.new; say $a; 20:59
camelia Foo.new
MasterDuke m: class Foo { method Str() { "I am a Foo" }; }; my $a = Foo.new; say ~$a 21:00
camelia I am a Foo
21:00 x[LGWs4x4i]uG2N0 left
geekosaur pochi, "say" uses .gist 21:00
pochi but it had to do something to come up with "Foo.new" too?
geekosaur so define method gist if you want to override that 21:01
pochi there are two methods to stringify?
geekosaur one is actual stringification, the other is "produce something compact for human consumption"
pochi isn't that the same thing?
geekosaur no? 21:02
pochi put some characters on screen representing this object please
geekosaur stringify is the whole thing. if youre wokring with an HTML document, there;s a difference between rendering it and giving you the HTML as text
pochi yeah, but in this context both are text, no?
geekosaur .Str should produce the whoole thing in some form useful for other functions, .gist should produce a summary ("the gist of it") for people
pochi but I want stringification to be the same, no matter if you quote it or dont 21:04
MasterDuke m: class Foo { method Str() { "I am a Foo for a computer" }; method gist() { "I am a Foo for a human" }; }; my $a = Foo.new; say $a; say ~$a
camelia I am a Foo for a human
I am a Foo for a computer
21:04 x[LGWs4x4i]uG2N0 joined 21:05 p6bannerbot sets mode: +v x[LGWs4x4i]uG2N0
MasterDuke m: class Foo { method Str() { "I am a Foo for a computer" }; method gist() { self.Str }; }; my $a = Foo.new; say $a 21:05
camelia I am a Foo for a computer
MasterDuke m: class Foo { method Str() { "I am a Foo for a computer" }; method gist() { self.Str }; }; my $a = Foo.new; say ~$a
camelia I am a Foo for a computer
pochi thanks. that should be the default in my opinion 21:06
21:09 abraxxa left
geekosaur yes, just like everyone knows encodings don;t exist, all text is magically in their locale 21:10
MasterDuke e: my @a = ^1_000; say @a; say ~@a
evalable6 [0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 …
MasterDuke, Full output: gist.github.com/26730a6909821d5ada...8b326d0eb0
geekosaur "it's a difference I don;t happen to care about right now, its a difference nobody ever should care about" 21:11
MasterDuke pochi: ^^^ stuff like that is why there's both
geekosaur right up until you do need it and wonder why things don't work
21:13 abraxxa joined
pochi I would expect the same result for say @a and say ~@a 21:13
21:13 p6bannerbot sets mode: +v abraxxa
MasterDuke but what's the point of printing out its contents (in the context where you assume a human is looking at them) when it's that big? 21:15
geekosaur sigh
geekosaur has three channels all showinbg different forms of people unable to think past their own navels. lovely 21:16
MasterDuke e: my @a = ^1_000; put @a
evalable6 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 3…
MasterDuke, Full output: gist.github.com/4e5289a091ad9d495f...c0d3ef99e2
pochi MasterDuke: that's not the point I was arguing though
MasterDuke pochi: put uses .Str
pochi what? 21:17
I thought there only were two, say and print ...
21:18 natrys left
pochi so put @a and put ~@a outputs the same thing then 21:19
which makes sense
geekosaur to you, now
but then you've been studiously ignoring any possibility that your right now might not be right for all cases
pochi as does print @a and print ~@a it seems
so only say @a and say ~@a differs 21:20
MasterDuke docs.perl6.org/type/Mu#method_print and the next two entries (put and say) explain the differences
pochi ah, so it says not to use "say" 21:21
21:21 pmurias left 21:23 johnny5620 joined 21:24 p6bannerbot sets mode: +v johnny5620
MasterDuke say does some other niceties, like sort hashes 21:24
21:24 johnny5620 left 21:30 pmurias joined 21:31 p6bannerbot sets mode: +v pmurias 21:33 zakharyas left 21:34 irv9 joined, irv9 left 21:39 Ven` joined 21:40 p6bannerbot sets mode: +v Ven` 21:43 Ven` left 22:08 pmurias left 22:17 kerframil joined, p6bannerbot sets mode: +v kerframil 22:28 HaraldJoerg joined, p6bannerbot sets mode: +v HaraldJoerg 22:33 robertle left 22:38 rindolf left 22:40 Ven` joined, p6bannerbot sets mode: +v Ven` 22:45 Ven` left 22:57 lizmat joined 22:58 p6bannerbot sets mode: +v lizmat
lizmat waves from Glasgow 23:00
benjikun waves from North Carolina lol 23:04
lizmat \o/ 23:14
23:18 MilkmanDan left, MilkmanDan joined, p6bannerbot sets mode: +v MilkmanDan 23:25 lizmat left 23:34 HaraldJoerg left 23:40 Ven` joined 23:41 p6bannerbot sets mode: +v Ven` 23:45 Ven` left 23:49 SCHAPiE left 23:53 Ven` joined 23:54 p6bannerbot sets mode: +v Ven` 23:58 Ven` left