»ö« 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 Zoffix on 25 May 2018.
00:00 lizmat joined
MasterDuke if you're using `race for`, do you need the `start`? 00:01
Bowlslaw Hm, I don't know. 00:02
00:05 benchable6 joined
MasterDuke benchable6: compare HEAD my $a = "hello there"; for ^200_000 { $a.chop } ||| my $a = "hello there"; for ^200_000 { $a.substr(0,*-1) } 00:05
benchable6 MasterDuke, starting to benchmark the 1 given commit
MasterDuke, gist.github.com/77ce84efaf247a09c0...ccb6e3e0a9 00:06
MasterDuke timotimo: ^^^
Bowlslaw What do you guys think of Andrew Shitov's, "Perl 6 Deep Dive"? Only $10 for the ebook on Packt right now and I am considering purchasing it. 00:10
00:11 mcmillhj joined
MasterDuke i haven't read it, but his blog posts are good 00:12
00:16 mcmillhj left 00:29 proc left 00:32 lookatme joined 00:33 markoong joined
lookatme .tell Zoffix yeah, but why QX (eg. `dd QX("ls")` ) add newline to the command output ? 00:36
yoleaux lookatme: I'll pass your message to Zoffix.
lookatme dd QX("ls")
evalable6 "3rdparty\nbin\nconfig-default.json\nconfig.json\nCONTRIBUTING.md\ndata\nirc-backup.tar.gz\njunk\nlib\nLICENSE\nlogs\nmaintenance\nMETA6.json\nREADME.md\nSakefile\nsandbox\nservices\nstdin\nt\n"
lookatme shell("ls") 00:37
evalable6 3rdparty
bin
config-default.json
config.json
CONTRIBUTING.md
data
irc-backup.tar.gz
junk
lib
LICENSE
logs
maintenance
META6.json
README.md
Sakefile
sandbox
services
stdin
t
00:38 markoong left 00:41 mcmillhj joined 00:46 mcmillhj left
geekosaur it's not so much that it's adding it, as that it's failing to remove it 00:47
which is what chomp is for, in both p5 and p6
lookatme hmm, maybe ls added it, some command has different behavior with tty/pipe 00:48
geekosaur pretty much every command's output ends with a newline. if you naïvely split on newline, there will be an empty element at the end for the final newline 00:49
shells like zsh (and apparently very recent bash) even warn you with a reverse video character if some command's output didn't end with one 00:50
lookatme hmm, the output is different on my pc
shell("ls") and dd shell(:out, "ls").out.slurp;
evalable6 3rdparty
bin
config-default.json
config.json
CONTRIBUTING.md
data
irc-backup.tar.gz
junk
l…
lookatme, Full output: gist.github.com/95a487a60de37e4295...825056e4d7
lookatme yeah, I am using zsh 00:51
Bowlslaw zsh master race
00:52 mcmillhj joined
geekosaur can you provide an example somewhere of what you;'re seeing and what you expect? that evalable6 output there looks correct to me 00:53
lookatme hmm, okay
output of the ls in zsh: build-directorys firefox qtcreator-4.6.2 worklog 00:54
geekosaur yes, ls does multicolumn to a tty by default
lookatme perl6 -e 'shell("ls")': build-directorys firefox qtcreator-4.6.2 worklog
the same as ls
geekosaur right, and both end with newlines, you just tend to forget about the final one :) 00:55
lookatme but this perl6 -e 'dd QX("ls")' : "build-directorys\nfirefox\nqtcreator-4.6.2\nworklog\n"
geekosaur yes
00:56 AlexDani` joined
geekosaur it has a final newline. just like the others do. the prompt isn't being emitted right after "worklog", after all 00:56
timotimo if you don't get a final newline, zsh will put a % with inverted color to tell you about it
lookatme why the newline added ? is it because it's not tty ?
geekosaur (or with a reverse % marker right after it like zsh does)
it's always added
timotimo fish also has a marker
geekosaur apparently everything I have said made no sense to you
timotimo try "echo -n hi" to see what something without final newline looks like
00:56 mcmillhj left
geekosaur pyanfar «work*master» Z$ ls | tail -1 | od -c 00:57
0000000 u t i l \n
lookatme I mean \n between "build-directorys" and "firefox"
geekosaur that's columnizing because tty
try ls -C
00:57 AlexDaniel left
geekosaur or the opposite, ls -1 in tty 00:58
lookatme yeah, I just mean this
00:58 fake_space_whale joined
lookatme not the last one 00:58
yeah, I faced this problem when I am using `cp`, so I know this, but not sure
anyway, thanks geekosaur timotimo 00:59
geekosaur otherwise, perl 6 would have to use a pty instead of a pipe, which is harder and more expensive and rarely worth the effort
lookatme yeah, maybe that's the user wanted 01:00
geekosaur (I don't think there's a ready way to do that currently in perl 6, largely because it's nonportable. Windows has no concept of this, for example)
01:00 AlexDani` left
lookatme oh 01:00
Bowlslaw ahahha, I just learned about 'with' and 'orwith' 01:02
01:03 mcmillhj joined
lookatme m: with "lookatme" { say "I am online"; } 01:03
camelia I am online
01:07 raschipi joined 01:08 AlexDani` joined, mcmillhj left 01:10 AlexDani` is now known as AlexDaniel 01:13 mcmillhj joined 01:14 raschipi left 01:17 Actualeyes joined 01:18 mcmillhj left 01:21 zachk left
Bowlslaw what is the difference between sub my-sub returns Int 01:22
and sub my-sub --> Int
geekosaur none, and I think 'returns' is being deprecated at some point 01:23
lookatme m: sub f() return 1 { }
camelia 5===SORRY!5=== Error while compiling <tmp>
Invalid trait modifier (did you mean 'returns'?)
at <tmp>:1
------> 3sub f() return7⏏5 1 { }
Bowlslaw really? but...why? it's clearer than -->
lookatme m: sub f( --> 1) { }
camelia ( no output )
lookatme m: sub f() returns 1 { } 01:24
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed trait
at <tmp>:1
------> 3sub f() returns7⏏5 1 { }
lookatme m: sub f( --> 1) { }; say f
camelia 1
lookatme you can declare return value using `-->`
geekosaur there also used to be trait_mod:<of>, which had an obscure difference from trait_mod:<returns> 01:25
lookatme returns and of doesn't provide this feature
Bowlslaw oooh
geekosaur I don't like it being deprecated either, but I'm not the one who makes the decisions. (my take is that if it's not part of dispatching, it's confusing to have it in the Signature) 01:26
Bowlslaw so when I see a method definition with something like, "sub my-sub($var) --> Int:D"
that means it has to return a Int type which is defined 01:27
but, does Int:U make sense? how can something be undefined, but be an Int?
timotimo you can derive types from Int and return that from a function
lookatme :U means a type object
timotimo i.e. types are undefined objects
lookatme Bowlslaw, If you don read the Perl 6 weekly p6weekly.wordpress.com/ 01:28
Bowlslaw thanks
lookatme I recommend you read this blog
every week 01:29
01:29 Actualeyes left
b2gills Note that Perl 6 also has syntax for creating a signature value, and it only allows --> 01:31
m: my $sig = :( --> Int ); say $sig.returns
camelia (Int)
01:35 molaf_ joined
b2gills Bowlslaw: Int is an object that represents an arbitrary integral number, not a native number 01:37
m: class Foo is Int {}; my $v = Foo.new(42); say $v ~~ Foo
camelia True
b2gills m: my int $a; say $a; say defined $a; # This is a native int, and as such cannot be undefined 01:39
camelia 0
True
geekosaur and typed "undefined" values can be useful. both as sentinel values for value types, and as "class objects" on which you can invoke class methods like .new
01:39 molaf left
Bowlslaw hmm 01:43
01:43 BenGoldberg joined
b2gills m: $_ = [*] 1..100; say "this requires $_.msb() bits: $_" 01:44
camelia this requires 524 bits: 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000
01:46 mcmillhj joined 01:47 thowe joined
b2gills Bowlslaw: You may want to watch one of jnthn's talks on parallelism www.youtube.com/watch?v=JpqnNCx7wVY The slides are available at jnthn.net/papers/2015-yapcasia-concurrency.pdf 01:50
Bowlslaw yaaaya 01:51
thanks
haha!
I already found that slide yesterday
not the talk though, thanks
01:51 mcmillhj left, girst joined
b2gills I just searched for "jnthn asynchrony". There are three videos with the same talk; that is the most recent, and I remember it never cutting away from the projection screen. 01:56
01:56 kalkin-- joined 01:57 subroot left 01:58 Zoffix joined 02:00 mcmillhj joined
Zoffix Bowlslaw: you don't need that `start` inside. `race for` already parallelizes 02:03
yoleaux 00:36Z <lookatme> Zoffix: yeah, but why QX (eg. `dd QX("ls")` ) add newline to the command output ?
Zoffix m: for ^(64*4) { sleep 1/64 }; say now - ENTER now
camelia 4.0409769
Zoffix m: race for ^(64*4) { sleep 1/64 }; say now - ENTER now
camelia 1.0702571
02:05 mcmillhj left
Bowlslaw ok 02:06
cool 02:07
02:10 jeromelanteri left
Bowlslaw man 02:15
Perl 6 is neato torpedo
p: say map -> {$x**5}, <1 2 3 4 5> 02:17
p6: say map -> {$x**5}, <1 2 3 4 5> 02:18
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$x' is not declared
at <tmp>:1
------> 3say map -> {7⏏5$x**5}, <1 2 3 4 5>
Bowlslaw p6: say map -> $x {$x**5}, <1 2 3 4 5>
camelia (1 32 243 1024 3125)
Bowlslaw O
;O
p6: say map -> $x {$x**5}, [+] <1 2 3 4 5> 02:19
camelia (759375)
Bowlslaw ahahhaha
02:20 tardisx joined 02:21 aindilis joined 02:23 kurahaupo_ joined
Bowlslaw lol, why do you have backward feed? 02:24
02:27 kurahaupo left 02:31 perlpilot left 02:32 mcmillhj joined 02:37 mcmillhj left 02:43 Kaypie joined, Kaiepi left 02:46 mcmillhj joined 02:50 mcmillhj left 02:59 kybr joined 03:07 fake_space_whale left 03:13 lizmat left 03:21 mcmillhj joined 03:23 Bowlslaw left
Juerd p6: say <1 2 3 4 5> »**» 5 03:23
camelia (1 32 243 1024 3125)
03:26 mcmillhj left
Zoffix m: say <1 2 3 4 5>»⁵ 03:33
camelia (1 32 243 1024 3125)
03:34 mcmillhj joined 03:39 mcmillhj left 03:44 rouking joined
rouking What's the correct way to call a subroutine as if it were a method? I'm trying to do something like `(1..20)>>.factorise` 03:44
geekosaur m: sub xd(Int $x --> Int) { $x + 3 }; say (1..5)>>.&xd 03:47
camelia (4 5 6 7 8)
rouking geekosaur: thanks 03:50
03:52 Ven` joined 03:56 Ven` left 03:59 mcmillhj joined 04:01 sno left 04:03 mcmillhj left 04:12 mcmillhj joined 04:17 mcmillhj left 04:23 eliasr left 04:30 xtreak joined 04:35 sno joined 04:37 kaare_ left 04:40 mcmillhj joined 04:45 mcmillhj left 04:46 Zoffix left 04:50 curan joined 04:52 sno left 04:54 jmerelo joined 04:57 uzl joined
uzl m: my $c = 'ABNTUOBP'.comb.Bag; 04:59
camelia ( no output )
uzl m: my $c = 'ABNTUOBP'.comb.Bag; say $c;
camelia Bag(A, B(2), N, O, P, T, U)
uzl How would I find the most element in a set? 05:00
m: 2 (<=) Set(1, 2,3) 05:01
camelia WARNINGS for <tmp>:
Useless use of "(<=)" in expression "2 (<=) Set(1, 2,3)" in sink context (line 1)
uzl m: say 2 (<=) Set(1, 2,3)
camelia True
uzl m: (set(1, 2), 3).Set 05:02
camelia ( no output )
uzl m: say (set(1, 2), 3).Set
camelia set(3 set(1 2))
uzl m: say set(1, 2) (<=) (set(1, 2), 3).Set 05:03
camelia False
benjikun uzl: What do you mean the "most element"? 05:05
the highest value?
uzl benjikun: It was meant to say the most common element. My bad!
or the highest I guess. 05:06
05:07 mcmillhj joined
uzl Another question: How would I check if a set is a subset of a set containing other sets? 05:07
going to bed, good night! 05:08
05:08 uzl left
benjikun dangit 05:08
05:10 sauvin joined 05:12 mcmillhj left 05:15 lizmat joined 05:17 molaf_ left, kaare_ joined 05:20 ufobat joined 05:21 skids left 05:28 BenGoldberg left 05:34 cog joined 05:36 jerome__ joined 05:38 fake_space_whale joined 05:39 mcmillhj joined 05:44 mcmillhj left
jmerelo .tell uzl you can also ask your questions in StackOverflow, better format for searching and more asynchronous answers 05:45
yoleaux jmerelo: I'll pass your message to uzl.
05:47 jerome__ left 05:48 fake_space_whale left 05:49 cog left, xtreak_ joined, cog joined 05:52 xtreak left 05:58 Ven` joined 05:59 mcmillhj joined 06:03 Ven` left, mcmillhj left 06:08 fake_space_whale joined 06:15 psychoslave joined 06:18 fake_space_whale left 06:20 espadrine left 06:29 sno joined 06:30 darutoko joined, Actualeyes joined 06:32 broquaint joined 06:36 mcmillhj joined 06:41 mcmillhj left, mienaikage joined, lance_w[m] joined 06:46 ilmari[m] joined 06:57 sarna joined 06:58 zakharyas joined 07:00 mcmillhj joined 07:04 dakkar joined 07:05 mcmillhj left 07:10 lookatme left, lookatme joined
Geth doc: 36314524f5 | (JJ Merelo)++ | 2 files
Adds data on Pointers refs #1513
07:12
doc: c29056583c | (JJ Merelo)++ | doc/Language/nativetypes.pod6
Adds documentation for void type

With some comments on how to use it, mainly in the context of native calls. Which should be obvious, since they are native types. Closes #2130
synopsebot Link: doc.perl6.org/language/nativetypes
07:15 xtreak joined, kent\n joined 07:18 rindolf joined, xtreak_ left 07:19 sena_kun left, domidumont joined 07:20 mcmillhj joined 07:25 domidumont left, domidumont joined 07:26 mcmillhj left 07:28 wamba joined 07:35 xtreak left 07:38 xtreak joined 07:39 pmurias joined, mcmillhj joined 07:44 mcmillhj left 08:03 benjikun left 08:08 HaraldJoerg joined 08:14 mcmillhj joined 08:19 mcmillhj left 08:34 mcmillhj joined 08:39 mcmillhj left 08:40 xtreak left 08:51 Ven` joined 09:00 sno left 09:03 mcmillhj joined 09:04 Ven` left, Ven` joined 09:05 sno joined 09:08 mcmillhj left 09:10 MasterDuke left 09:14 wamba left
buggable New CPAN upload: InterceptAllMethods-0.0.1.tar.gz by ELIZABETH cpan.metacpan.org/authors/id/E/EL/...0.1.tar.gz 09:14
09:15 xtreak joined 09:18 mcmillhj joined 09:23 mcmillhj left 09:26 sarna left 09:29 dakkar left 09:41 dakkar joined
ecocode hello! I'm writing a script to download files from a belgian site. The project is at early start, but I don't feel comfortable with my coding inPerl6. Please comment gitlab.com/snippets/1728891 09:42
i.e. line 7 declares a constant URL prefix. Would you declare it the same way/place ? 09:45
lizmat ecocode: why "our $prefixUrl" ? why note "my $prefixUrl" ? 09:46
ecocode lizmat: both would work, and since it is a constant, I felt like using our
lizmat ah, ok, well, if it is a constant, why not make it a constant in the outer scope? 09:47
tobs ecocode: instead of "$.reference()" you can use "$!reference"
ecocode but even with my I don't like it to be there
El_Che ecocode: I told you that :)
lizmat my constant $prefixUrl = ...
El_Che $prefix-url would me more ideomatic
lizmat it wouldn't need to live inside the class { }
ecocode lizmat: exactly how I wanted it :) 09:48
lizmat ecocode: do you really need to await twice? (not sure)
I guess so: the first promise for when it has received the header, and the other when it has received all of the rest ? 09:49
ecocode tobs: line 31 needs it to be declared as $.reference(). or am I missing something?
tobs line 31 yes, but inside the class you can use $!reference. No need for parentheses in either case I think 09:50
lizmat ecocode: you don't need to change line 31, unless you're interested in performance (which I doubt there) 09:51
on line 28 I would put whitespace between Str: and $reference
ecocode lizmat: yep for 2 awaits. got that from the CRO docs ;)
lizmat argh: "Str" and ":$reference"
ecocode ok lizmat 09:54
tobs: replacing $.reference with $!reference gives errors 09:55
No such method 'CALL-ME' for invocant of type 'Str' 09:56
in method downloadFiles at ENOTgetfiles.p6 line 12
09:56 mcmillhj joined
tobs you can drop the parentheses. But if you want them there, I guess you need "$.reference" 09:56
ecocode ok. it works without the parentheses 09:57
tobs The "." twigil in the declaration "has $.reference" gives you a private scalar "$!reference" and automatically generates a public getter method by the name of "reference".
09:58 ExtraCrispy joined
ecocode does it increase performance to use $!reference instead of $.reference() 09:58
?
tobs Inside the class, you can use $!reference to avoid that indirection (if I'm not mistaken)
There's surely something about it in here docs.perl6.org/language/classtut#i...ry-twigils
ecocode also, does it make sense to always add parentheses after i.e. $.reference to indicate I'm calling a getter ? 10:00
tobs I don't know if it effectively increases performance to be frank. Maybe the optimiser is that smart
ecocode El_Che: yep, but I'm practicing here ;)
trying to find out the recommended way of coding Perl6 ;) 10:01
tobs I personally avoid parentheses where I can. Seeing them used there just jumped out at me
but I'm new to Perl 6 too
10:02 mcmillhj left
ecocode I posted a new version.. 10:04
I've added parentheses after $response.body too to indicate I'm calling a func 10:05
looks better to me
10:07 sno left
ecocode but hence I could remove them all, and try to get used to it 10:07
lizmat: you raised my curiosity ;) what could I change on line 31 to improve performance? 10:10
10:11 mcmillhj joined 10:15 mcmillhj left
El_Che ecocode: if the answer starts with nqp::, run away 10:25
10:27 xinming left 10:29 xinming joined 10:30 psychoslave left 10:33 sno joined
tobs m: say "{ .<1> } vs. { .{'1'} }" with "*0*1*00".comb.antipairs.categorize(*.key, :as(*.value)) 10:34
camelia Use of uninitialized value of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
vs. 3
in block at <tmp> line 1
tobs ^ I want to get the indices of "*"'s, "0"'s and "1"'s in the string, but it seems that .<1> uses "1" as an Int to index the return value of categorize? 10:35
m: my %h = 1 => 5; say %h<1> # works
camelia 5
10:37 Actualeyes left
tobs m: my %h = "*0*1*00".comb.antipairs.categorize(*.key, :as(*.value)); say "%h<1> vs. %h{'1'}" 10:37
camelia 3 vs. 3
jmerelo tobs: <> converts to string 10:38
tobs jmerelo: but it doesn't seem to work under `with' above 10:39
jmerelo m: say "{ .<1> } vs. { .{'1'} }" with "*0*1*00".comb.antipairs.categorize(*.key, :as(*.value)) 10:40
camelia Use of uninitialized value of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
vs. 3
in block at <tmp> line 1
jmerelo tobs: there must be something there that can't be stringified 10:41
tobs m: say "{ $_<1>:exists } vs. { $_{'1'}:exists }" with "*0*1*00".comb.antipairs.categorize(*.key, :as(*.value)) # more readable perhaps
camelia False vs. True
jmerelo Let me see
m: my %hash = "*0*1*00".comb.antipairs.categorize(*.key, :as(*.value)); say %hash.perl
camelia {"*" => $[0, 2, 4], "0" => $[1, 5, 6], "1" => $[3]}
jmerelo I would say the problem above is stringifying the $[0, 2, 4]. 10:42
m: my %hash = "*0*1*00".comb.antipairs.categorize(*.key, :as(*.value)); say %hash<1> 10:43
camelia [3]
jmerelo m: my %hash = "*0*1*00".comb.antipairs.categorize(*.key, :as(*.value)); say %hash<0>
camelia [1 5 6]
jmerelo m: my %hash = "*0*1*00".comb.antipairs.categorize(*.key, :as(*.value)); say %hash<0>.gist
camelia [1 5 6]
jmerelo m: say $_.<1>, " vs. ", $_.{'1'} with "*0*1*00".comb.antipairs.categorize(*.key, :as(*.value)) 10:44
camelia (Any) vs. [3]
jmerelo hum
tobs m: <1>.^name.say
camelia IntStr
tobs the Int part is what worries me, but I don't know if `with' can break indexing at that point 10:45
jmerelo m: say $_.perl " vs. ", $_.{'1'} with "*0*1*00".comb.antipairs.categorize(*.key, :as(*.value))
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3say $_.perl7⏏5 " vs. ", $_.{'1'} with "*0*1*00".comb.
expecting any of:
infix
infix stopper
postfix
statem…
jmerelo m: say $_.perl, " vs. ", $_.{'1'} with "*0*1*00".comb.antipairs.categorize(*.key, :as(*.value))
camelia (my Any %{Any} = "*" => $[0, 2, 4], "0" => $[1, 5, 6], "1" => $[3]) vs. [3]
jmerelo I mean, $_.<1> and $_.{'1'} should be exactly the same... 10:46
tobs as it's not an obvious mistake, might be worth opening an issue
jmerelo tobs: with is putting everything into $_, which is a Hash. Something seems to be breaking down since it's an Any %{Any} kind of hash. <1> is being converted to... Any... 10:47
tobs: boils down you shouldn't use with to lemmatize hashes, I guess. 10:48
timotimo m: my %h := {IntStr.new(1, "1") => "the intstr", "1" => "the str", 1 => "the int"}; say %h<1>
camelia the int
timotimo m: my %h := {IntStr.new(1, "1") => "the intstr", "1" => "the str", (1) => "the int"}; say %h<1>
camelia the int
timotimo m: my %h := {IntStr.new(1, "1") => "the intstr", "1" => "the str", (1) => "the int"}; say %h.perl
camelia {"1" => "the int"}
timotimo hah
m: my %h := :{IntStr.new(1, "1") => "the intstr", "1" => "the str", (1) => "the int"}; say %h.perl; say %h<1> 10:49
camelia :{IntStr.new(1, "1") => "the intstr", 1 => "the int", "1" => "the str"}
the intstr
timotimo as you can see here, %h<1> looks up what's stored under an IntStr of 1/"1"
tobs oh, that makes sense. I expected a Str --> Any hash, as normal, but categorizing from just some list doesn't give string keys...
timotimo so no, $_.<1> and $_.{'1'} are not exactly the same
that said, assigning into a %foo hash with a = will cause keys to be stringified 10:50
tobs m: say "{ $_<1>:exists } vs. { $_{'1'}:exists }" with "*0*1*00".comb.antipairs.categorize(*.key, :as(*.value), :into(my %h))
camelia True vs. True
tobs luckily, categorize is awesome
thanks jmerelo and timotimo
jmerelo tobs: thanks for asking these questions. We all learn with them (/me more than timotimo, I guess...) 10:52
10:57 psychoslave_ joined 10:59 scimon joined, wamba joined 11:02 Ven` left 11:03 lizmat left 11:05 jeromelanteri joined 11:06 Pheix joined 11:08 Pheix left 11:10 markoong joined
Geth doc: 8921b20494 | (JJ Merelo)++ | doc/Language/nativecall.pod6
Updates typed pointer info, refs #1513
11:17
doc: 89f1b00149 | (JJ Merelo)++ | 2 files
Adds clarification to void type

Follow @zoffixznet comment in rakudo/rakudo#1982.
synopsebot Link: doc.perl6.org/language/nativecall
RAKUDO#1982 [open]: github.com/rakudo/rakudo/issues/1982 "Unknown type NativeCall::Types::void used in native call."
11:19 mscha joined, Zoffix joined
mscha m: my $bh = BagHash.new-from-pairs('foo'=>10000000000000000000); say $bh<foo>; $bh<foo>++; say $bh<foo>; # oops 11:19
camelia 10000000000000000000
Cannot unbox 64 bit wide bigint into native integer
in block <unit> at <tmp> line 1
Geth doc: rafaelschipiura assigned to coke Issue Unify differences between `multi` and `multi sub` github.com/perl6/doc/issues/1189
ea187533aa | (Elizabeth Mattijsen)++ | doc/Type/Scheduler.pod6

And not as named argument.
11:22
Zoffix .tell benjikun Suggestions for next iterations of the survey: (1) For most wanted feature, invite people to be as specific as possible. 50 people saying "performance" is a lot less useful than a single person saying "performance of custom ops". (2) Add a comment field at the end "Suggestions to improve future versions of this survey"... ATM I don't even know if you're the right person to send this suggestion 11:25
yoleaux Zoffix: I'll pass your message to benjikun.
Zoffix to. Like who's the author of the survey?
.tell benjikun to. Like who's the author of the survey?
yoleaux Zoffix: I'll pass your message to benjikun.
Zoffix mscha: would you report it in: github.com/rakudo/rakudo/issues/new
11:25 lizmat joined
lizmat ecocode: I misread, there's nothing you can do there 11:27
line 30 though: "my project $project .= new(:$reference)" 11:28
mscha Zoffix: done. github.com/rakudo/rakudo/issues/1983 11:32
Zoffix Thankss. 11:33
11:34 Zoffix left 11:35 zakharyas left
ecocode lizmat: would that be faster? or just better code ? 11:36
lizmat it would be slightly slower atm, but it would be more idiomatic, more readable (I think), and in the future probably better optimizable 11:37
because it can then get rid of the runtime typecheck
but that's in the future :-)
but since this is not hot code (I would think) I would go for readability and idiomaticity 11:38
ecocode I'm kinda sceptic about readability... :$reference doesn't tell you clearly in what instance variable the value goes 11:40
reference => $reference does show that
lizmat well, to me that's just an opportunity for mistypings of the left side of the fat comma 11:41
but again, you asked for comments, TIMTOWTDI
there is no difference in codegen between reference => $reference and :$reference
ecocode of course I like the discussion ;)
lizmat likes not having to type the same thing more than once 11:42
ecocode you have point :)
but what when I later will add more instance variables ? 11:43
lizmat :$second, :$third 11:45
11:45 Ven` joined
ecocode is probably seeing problems that aren't real... 11:46
lizmat and: has $.second; has $.third
ecocode hmmm... docs.perl6.org/language/classtut#Constructors seems to prone fat comma 11:47
tobs ecocode: :$reference takes the name of the variable, uses it as LHS to "=>" and takes the value of the variable as the RHS. :$reference actually tells you clearly where the value goes: into the attribute of the same name as the variable
ecocode yep
I need to get used to that
definitely
tyil I got used to it quite quickly 11:48
11:49 psychoslave_ left, psychoslave_ joined
ecocode I think I will use it more often now that I understand it better ;) 11:49
lizmat: what's your opinion about parentheses or not ? 11:50
lizmat well, you need them inside the double quoted string
outside not so much... I usually don't put them when they are not needed
ecocode docs.perl6.org/language/classtut#Constructors seems to prefer parentheses too 11:52
tyil it is mostly a personal preference
I sometimes use them, sometimes I dont
mostly depends on what reads better to me
11:53 psychoslave_ left 11:54 psychoslave_ joined
ecocode just to test, I removed the parenthesis inside the double quoted string. Then it prints PROJECT: project<94853994570944>.reference 11:54
why is that ?
oh yes
got it
.reference is just a string
tyil yes 11:55
11:55 sena_kun joined
tyil ecocode: you could also wrap the $project.reference inside {} 11:59
say "PROJECT: {$project.reference}" 12:00
ecocode that looks more readable 12:01
El_Che ecocode: readability for the win 12:02
tyil when in doubt, go for readability 12:03
everyone who ever looks at the code will be thankful
even you in the future :>
12:09 sno left, jmerelo left 12:12 xtreak left
ecocode as I'm a rather occasional coder that seems to be a most valuable advice ;) 12:13
El_Che you are an eco-coder! 12:14
:)
ecocode coding is my main activity when I procrastinate ;) 12:16
12:16 sno joined
tyil same 12:32
coding is also my job, though
buggable New CPAN upload: Object-Trampoline-0.0.1.tar.gz by ELIZABETH cpan.metacpan.org/authors/id/E/EL/...0.1.tar.gz 12:34
12:35 skids joined
lizmat my second module today :-) 12:35
although it's a port of a Perl 5 module, this one has its uses in new Perl 6 code as well :-) 12:36
Ven` lizmat++
El_Che lizmat: saw your talk on youtube. It was nice. Did you get positive feedback? 12:39
12:39 mcmillhj joined 12:40 skids left
lizmat El_Che: yes, I got a lot of positive feedback from people at the conference 12:40
online, no direct feedback (yet)
Ven` the follow-up talk to your blog post?
lizmat but it's still at 0 reddit points last time I checked, with only 54% upvoted 12:41
Ven`: indeed
Ven` It was interesting. I'm happy you got positive feedback. The reddit comments were... a mixed bag.
lizmat so I guess a lot of people have just downvoted it without actually looking at it
El_Che lizmat: if you really wanted to trigger people, you should have called it the "Perl Jam #3"
:) 12:42
lizmat: online media comment bring the worst out of people, it seems
lizmat yeah :-(
12:45 mahafyi joined 12:48 robertle joined 12:53 zakharyas joined
synopsebot Link: doc.perl6.org/type/Scheduler
[Coke] Bowlslaw: I paid full price. 10 bucks is a huge bargain, I'd buy it again. :) 13:12
13:16 perlpilot joined 13:18 HaraldJoerg1 joined
Geth doc: 699d350a70 | (Elizabeth Mattijsen)++ | doc/Type/Scheduler.pod6
Mention the cancellation feature of ThreadPoolScheduler.cue
13:18
synopsebot Link: doc.perl6.org/type/Scheduler
[Coke] ff
13:19 aborazmeh joined, aborazmeh left, aborazmeh joined, HaraldJoerg left 13:20 HaraldJoerg1 is now known as HaraldJoerg
[Coke] lizmat: that cue code doesn't compile here. 13:21
------> $at, :$in, :$every, :$times = 1; :&catch⏏ -> $cancelation) {}
also: cancellation
lizmat 1 13:22
argh
[Coke] should it be "-->" ?
Geth doc: 47c0230bba | (Elizabeth Mattijsen)++ | doc/Type/Scheduler.pod6
Fix typoes, Coke++
synopsebot Link: doc.perl6.org/type/Scheduler
lizmat yeah it should :-)
[Coke] Now it's "Malformed return value" 13:24
I think that's got to be a type, not a var.
lizmat yeah, I guess 13:25
[Coke] Sorry. :(
Geth doc: 96ec0846c3 | (Elizabeth Mattijsen)++ | doc/Type/Scheduler.pod6
Return value should be a type, Coke++
synopsebot Link: doc.perl6.org/type/Scheduler
lizmat [Coke]++ # keeping an eye on me 13:26
[Coke] lizmat: All tests successful. 13:28
lizmat whee! :-)
13:28 xtreak joined 13:31 st_elmo joined 13:36 kaare_ left 13:41 jeromelanteri left 13:48 Kaypie left, Kaiepi joined 13:52 jo__ joined 13:55 st_elmo left 13:56 aborazmeh left
Juerd lizmat: I happen to have watched your talk yesterday. I liked it, but that's because I'm interested in almost everything you discussed. Someone who watches it because of its title, might have expected different content. 13:56
13:56 curan left
Juerd Or, actually, I did expect different content, but wasn't disappointed :) 13:57
lizmat Well, it was the title I submitted, and in the end, I *do* talk about the state it is in :-)
glad to hear you weren't disappointed
Juerd In the end, indeed :) 13:58
I doubt many people will have had the patience
lizmat well, yeah, there's that 13:59
patience appears to be in short supply in the world nowadays
14:00 xtreak left
Juerd I suspect there's a huge difference between actually being in the audience, and watching it online. 14:00
lizmat well, the audience didn't have a choice, really, apart from getting up and leaving 14:01
online there are so many more distractions :-) 14:02
Juerd I giggled when you asked the audience if anybody knew what the Plato system was. I thought: I know, but only because you once told me.
lizmat yeah... :-(
many times I look at mistakes people make with online materials, and realize that they are the same mistakes that were made with some PLATO lessons 40 years ago 14:03
not a lot changes :-(
daxim I knew it before, because game designer requnix spent his formative years on plato. his first three commercial games were modelled on a popular multi-player dungeon crawler. 14:04
14:05 psychoslave_ left
Ven` had never heard of PLATO before the talk 14:06
lizmat en.wikipedia.org/wiki/PLATO_(computer_system) 14:07
in case one is wondering :-)
specifically: en.wikipedia.org/wiki/PLATO_(compu..._community 14:08
14:11 robertle left
jo__ m: class tst { has int $.R is required; }; tst.new(R=>0).say; 14:12
camelia The attribute '$!R' is required, but you did not provide a value for it.
in submethod BUILDALL at <tmp> line 1
in block <unit> at <tmp> line 1
14:12 sno left
jo__ m: class tst { has Int $.R is required; }; tst.new(R=>0).say; 14:12
camelia tst.new(R => 0)
jo__ m: class tst { has int $.R is required; }; tst.new(R=>1).say; 14:13
camelia tst.new(R => 1)
14:13 Zoffix joined
Zoffix m: my $a2; 42 R!= $a2; dd $a2 14:13
camelia Potential difficulties:
Useless use of R!= in sink context
at <tmp>:1
------> 3my $a2; 42 7⏏5R!= $a2; dd $a2
Use of uninitialized value of type Any in numeric context
in block <unit> at <tmp> line 1
Any $a2 = Any
Zoffix This should be equivalent to `$a2 != 42`... ohhh, nm 14:14
brainfarted to ||= :)
Juerd jo__: Interesting. Looks like a bug :) 14:15
14:15 sno joined 14:16 kaare_ joined
jo__ m: my int $tst; $tst.say; 14:17
camelia 0
Zoffix m: class tst { has num $.R is required; }; tst.new(R=>0e0).say;
camelia The attribute '$!R' is required, but you did not provide a value for it.
in submethod BUILDALL at <tmp> line 1
in block <unit> at <tmp> line 1
Zoffix m: class tst { has num $.R is required; }; tst.new(R=>NaN).say;
camelia tst.new(R => NaN)
jo__ m: class tst { has int $.R is required; }; tst.new(R=>0).say; 14:18
camelia The attribute '$!R' is required, but you did not provide a value for it.
in submethod BUILDALL at <tmp> line 1
in block <unit> at <tmp> line 1
jo__ This is supposed to work?
Zoffix Filed as R#1985
synopsebot R#1985 [open]: github.com/rakudo/rakudo/issues/1985 `is required` native attributes fail to detect their init value if it's given as `0`
Zoffix jo__: yeah
m: class tst { has int $.R is required; submethod TWEAK(:$!R) {}; }; tst.new(R=>0).say; 14:19
camelia The attribute '$!R' is required, but you did not provide a value for it.
in block <unit> at <tmp> line 1
Zoffix wow, this existed since before The Christmas :O 14:20
jo__++ # finding teh bug
14:20 mscha left, wamba left
lizmat I seem to recall this is a known issue with native ints and nqp::attrinited 14:21
Zoffix ah
lizmat I think nqp::attrinited is faking it for native ints :-) 14:22
geekosaur and seems to me like it'd be a bit difficult :/
Zoffix m: my $a2; ($a2 R[||]= 42) += 10; dd $a2
camelia ===SORRY!===
Cannot find method 'ann' on object of type NQPMu
14:23 cedes08 joined 14:25 uzl joined 14:26 skids joined
Zoffix R#1986 14:26
synopsebot R#1986 [open]: github.com/rakudo/rakudo/issues/1986 [QAST] Explosion when `R`-metaopping `||`, `//`, `&&` meta-assigns
14:31 eliasr joined 14:36 molaf joined 14:40 dakkar left 14:41 dakkar joined, turdmonkey joined 14:42 turdmonkey is now known as Bowlslaw
Bowlslaw Hello 14:42
Zoffix \o
uzl Hello! 14:45
yoleaux 05:45Z <jmerelo> uzl: you can also ask your questions in StackOverflow, better format for searching and more asynchronous answers
Zoffix \o
uzl .tell jmerelo I'll look into creating an account. I've always shy away from SO because the bar to ask questions seems to be pretty high ;) 14:47
yoleaux uzl: I'll pass your message to jmerelo.
uzl Bowlslaw: From what I've read, the feed and backward feed operators make writing pipeline more intuitive in a sense. 14:50
Bowlslaw I can see the forward pipeline, but the backward seems silly. 14:51
Could you give an example where it is useful?
uzl Bowlslaw: Think Perl 6 devotes a section to them in chapter 14.
Bowlslaw hmmm
uzl the backward one allows to reverse the pipelining. It's more akin to the regular way one uses a pipeline (from right to left). 14:55
I guess it's just a matter of preference. Both of them achieve the same result. 14:56
tobs Bowlslaw: I used the backwards one just this morning. I chose it because it makes the important data easier to see github.com/taboege/p6-Gaussoids/bl...ion.p6#L53 14:57
(disclaimer: that repository is a mess)
Bowlslaw lol
thanks
15:01 Zoffix left
Geth doc: 33e27baf68 | (Juerd Waalboer)++ (committed using GitHub Web editor) | doc/Language/operators.pod6
Generator to ... is not an argument, but a value in the list

It doesn't even have to be a literal.
   > my $lhs = (5, { $_ * 2 });
   > say $lhs ... 40;
   (5 10 20 40)
15:04
synopsebot Link: doc.perl6.org/language/operators
15:07 jmerelo joined
Bowlslaw I got Perl 6 Deep Dive yesterday. $10 on Packt for the ebook 15:12
Not sure about Think Perl 6, though. It's for beginner programmers, right?
I'm afraid it will be too slow in the beginning and I will get bored. 15:13
Juerd Think Perl 6 is available for free as a PDF, so you can check it out before you buy it: greenteapress.com/wp/think-perl-6/
Bowlslaw :O 15:14
cool, will do, thanks
I enjoy supporting people that deserve it. 15:15
15:18 sno left 15:20 sno joined, n1ge left 15:24 Schepeers_ joined 15:33 domidumont left, fake_space_whale joined 15:37 n1ge joined 15:45 sno left 15:49 HaraldJoerg1 joined 15:53 HaraldJoerg left 16:01 HaraldJoerg1 is now known as HaraldJoerg
Bowlslaw Man, concurrecy is pretty cool. Never worked with threads before 16:04
I'm a babydev, haha. Been programming professionally for 6 months in a Perl shop
jmerelo Bowlslaw: congrats! 16:07
yoleaux 14:47Z <uzl> jmerelo: I'll look into creating an account. I've always shy away from SO because the bar to ask questions seems to be pretty high ;)
El_Che Bowlslaw: make sure not to overuse it when not needed. Concurrency kan make programs difficukt 16:08
jmerelo .tell uzl the Perl6 crowd is, in general, very welcoming. You'll feel at home.
yoleaux jmerelo: I'll pass your message to uzl.
Geth doc: 607c76d4fb | (JJ Merelo)++ | doc/Language/nativecall.pod6
Completes a subsection on Bufs/Blobs refs #1513
synopsebot Link: doc.perl6.org/language/nativecall
Bowlslaw El_Che: Yeah, I can see how needlessly complex it can make a program when misapplied. 16:12
El_Che it's fun, though :)
16:12 sno joined
Bowlslaw However, I believe my project is a perfect learning project for concurrency a web crawler 16:12
El_Che the fact that the threads do not have to communicate to each other makes it easier, certainly 16:13
16:15 uzl left
scimon lizmat: I thought your talk was great :) 16:20
Thread -> Thread comms is a LOT easier in Perl6 than most language (including go which is a big fan). Supplies and Channels (plus Promises returning values unlike fire and forget go routines) make life quite easy. 16:22
16:24 dakkar left
El_Che scimon: I use Channels in Perl 6 (and in Go) because they are very easy to understand 16:24
16:25 fake_space_whale left 16:30 Ven` left 16:31 wamba joined 16:33 Ven` joined 16:37 Actualeyes joined 16:38 Ven` left 16:41 domidumont joined
Geth doc: rafaelschipiura assigned to JJ Issue TBDs on nativecall page github.com/perl6/doc/issues/1513
rafaelschipiura assigned to Kaiepi Issue TBDs on nativecall page github.com/perl6/doc/issues/1513

add for clarity
16:42
16:50 Zoffix joined
Zoffix .tell rindolf FYI with HEAD rakudo, this script is now 23% faster: raw.githubusercontent.com/shlomif/...r_189-2.p6 16:51
yoleaux Zoffix: I'll pass your message to rindolf.
rindolf Zoffix: hi 16:52
yoleaux 16:51Z <Zoffix> rindolf: FYI with HEAD rakudo, this script is now 23% faster: raw.githubusercontent.com/shlomif/...r_189-2.p6
Zoffix \o
rindolf Zoffix: i cannot build rakudo here
Zoffix rindolf: what is the problem? 16:53
rindolf: you use rakudobrew, right? Do you use multiple rakudo versions at the same time?
rindolf Zoffix: no 16:54
Zoffix rindolf: no for versions, but yes for rakudobrew?
rindolf Zoffix: yes, i use rakudobrew
Zoffix And looks like there will be another perf win for that script when R#1951 is fixed
synopsebot R#1951 [open]: github.com/rakudo/rakudo/issues/1951 Improve empty hash creation performance with {}
Zoffix rindolf: OK, well, rakudobrew is a discouraged tool. It's possible your build problem is due to it. I suggest you nuke it and any paths you set up to make it work, and then just set up a small shell alias that will build from repo: github.com/zoffixznet/rd#linux 16:56
type `update-perl6` and it updates to latest HEAD
And if you want to use only stable releases instead, use this one: github.com/zoffixznet/r#linux
(got one extra line in it to checkout a release)
synopsebot Link: doc.perl6.org/language/variables
17:00 scimon left
b2gills .tell uzl `'abcccccd'.comb.Bag.max(*.value)` 17:02
yoleaux b2gills: I'll pass your message to uzl.
jmerelo b2gills++ for your answers in Stackoverflow, editing of my questions (I didn't know about the Perl6 highlight), and general enlightment of yours truly 17:03
b2gills: I mean, this is art stackoverflow.com/questions/441037...9#51046629 17:04
17:04 zakharyas left
Zoffix Don't see any more to do with rindolf's script that's at my skill... Need to get more EXP and level up 17:04
b2gills jmerelo: Technically there is no Perl 6 highlight. So it is just telling the highlighter to run in default mode. Which is better than nothing. Hopefully in the future when there is a highlighter for Perl 6 it will just work™. 17:05
jmerelo b2gills: I thought they were using GitHub's or Atom's or something...
b2gills That would be nice, but no. 17:06
17:07 zakharyas joined
Zoffix .tell MasterDuke just mentioning, in case these opts are JITable and you know how, but on this script from one of our users JIT bails on these: ctxouter, getcodename, setmethcache raw.githubusercontent.com/shlomif/...r_189-2.p6 17:07
yoleaux Zoffix: I'll pass your message to MasterDuke.
Zoffix
.oO( setmethcache, getmethcache, checkoutintorehab )
17:08
17:08 Zoffix left
b2gills jmerelo: I generally prefer not to use the `share` link within SO itself. Instead of stackoverflow.com/a/51083251/1337 I would use stackoverflow.com/questions/510814...1#51083251 17:13
kalkin-- I love it how in the 2018 survey most people answer in the Survey that they wish more speed 17:14
jmerelo b2gills: some reason? I mean, I just click on "share" and have it handy there...
kalkin-- The current performance is actually stopping me from proposing using perl6 in the company or using it for scripting in private
I.e: I hate using zef, it's even slower than DNF :) 17:15
b2gills It is for sharing on outside sites, and notice that the second number is your account number. So you get a badge for pointing to another answer which is on the same page
jmerelo b2gills: Ah, OK. Will fix. Thanks :-)
b2gills You get a badge for people clicking on the link
jmerelo b2gills: I love badges :-)
b2gills: but I see your point. 17:16
b2gills Well I have one that you can never have, the Beta badge
Note that you can shorten it to stackoverflow.com/questions/510814...1#51083251 As the site ignores everything between the 3rd and 4th / 17:19
17:21 robertle joined 17:22 zakharyas left
jmerelo b2gills: but I have a GitHub nick with two letters :-) 17:23
b2gills My computer's acting weird, Chrome isn't accepting my keyboard inputs. I guess I will force close it so that it will remember the tabs. While I'm at it I will probably do an update. (What's really weird is the YouTube video player is accepting my keyboard)
jmerelo: I've been using b2gills since the mid to late 90's 17:24
jmerelo b2gills: actually I didn't pay much attention to SO until a few months ago. I was mostly user...
b2gills The whole reason I got a FaceBook account is they were allowing custom user urls, so I got on it so that no one else could use facebook.com/b2gills 17:25
jmerelo b2gills: :-) 17:26
b2gills: changed to non-share link. I really didn't know all that... 17:27
17:38 domidumont left 18:01 pmurias left 18:02 wamba left, pmurias joined 18:03 wamba joined 18:06 perlpilot left 18:13 espadrine joined, [Sno] joined 18:15 sno left 18:20 MilkmanDan joined 18:24 domidumont joined 18:26 sauvin left 18:27 mcmillhj left
jmerelo goes AFK 18:33
18:33 mcmillhj joined, jmerelo left
Bowlslaw When are we going to have a definition, "The Perl 6 Programming Language" ? 18:34
Which book is currently the closest to it? Deep Dive? 18:35
a definitive*
hobbs books are so last century 18:37
moritz Bowlslaw: deep dive has the biggest breadth, afaict 18:38
dunno how deep it is though :)
Bowlslaw hobbs Yeah..it's difficult to justify buying a book when there is online docs
moritz the two differ in character :-) 18:39
a good book has some sort of arch and a learning curve 18:40
*arc I guess
Bowlslaw Yes I agree
I still love books
The book has to contribute something which the docs don't
moritz the docs contain good information, but they lack the cohesion
I think the regex book is pretty good on cohesion and arc; fundamenals less so 18:41
Bowlslaw Fundamentals is cool for experienced programmers and impatient people 18:42
it gives useful stuff, and if the reader misses anything, they can just go to the docs
18:42 wamba left
moritz thanks :) 18:43
Bowlslaw I really like how many examples of stuff it gives. Working with DBs, using SVG, etc.
18:44 domidumont left
kalkin-- Using $foo = await $foo-promise unless $foo.defined produces a MoarVM panic 18:53
MoarVM panic: Internal error: invalid thread ID 126803040 in GC work pass
timotimo that's likely some random memory corruption that happened earlier than that and just got exposed by the next GC run
make sure you're not causing resizing in arrays or hashes that are used by multiple threads at the same time 18:54
kalkin-- timotimo: looks really like a random corruption 18:55
now I can't reproduce it anymore
18:56 mahafyi left
kalkin-- thanks anyway 18:56
Geth doc: 83dcfc4b7a | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/IO/Path.pod6
Reword desc of IO::Path.child

6.e is too much future-telling and we might not do the originally-planned
  ".child-secure" stuff anyway since it's not bulletproof and still has a race
and we'll probably implement this feature through .open instead.
18:57
synopsebot Link: doc.perl6.org/type/IO::Path
19:01 psychoslave joined 19:09 wamba joined 19:14 zachk joined, zachk left, zachk joined
Geth doc: f1e49774ab | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/Str.pod6
Document .subst-mutate will be deprecated in future

Originally planned[^1] to be deprecated in 6.d for reasons[^1], but due to R#1289 [^2] we're postponing it for later language versions.
  [^1] github.com/perl6/6.d-prep/blob/mas...bst-mutate
  [^2] github.com/rakudo/rakudo/issues/1289
19:17
synopsebot Link: doc.perl6.org/type/Str
synopsebot R#1289 [open]: github.com/rakudo/rakudo/issues/1289 [6.d][severe] [6.d BLOCKER] Implement a Way to Know Caller's Language
19:18 darutoko left
Bowlslaw moritz: I just want you to know that your Perl 6 Fundamentals is the book that got me to REALLY like Perl 6 19:18
In fact, your chapters with DBI and SVG were directly relevant to a project I was working on 19:19
19:22 zakharyas joined
moritz Bowlslaw: that's great to hear, thanks 19:22
19:23 Grauwolf joined 19:31 jo__ left
Juerd gist.github.com/Juerd/7b684255e2bc...d53f12b063 # Which ways of calling 'join' am I forgetting? :) 19:32
moritz m: ','.&join(<a b c>) 19:34
camelia ( no output )
moritz m: say ','.&join(<a b c>)
camelia a,b,c
moritz Juerd: ^^
buggable New CPAN upload: Sparrowdo-Azure-Web-Cert-0.0.3.tar.gz by MELEZHIK modules.perl6.org/dist/Sparrowdo::A...n:MELEZHIK
moritz m: say ','.&join: <a b c> # hope this doesn't work
camelia a,b,c
Juerd Er, wow. moritz Wow. How does that even work? :)
Heh, input buffer fuckup :)
moritz Juerd: magic? :) 19:35
timotimo it just puth the invocant as first argument
Juerd Impressively obscure :) 19:36
19:36 cedes08 left
moritz what's the indirect method invocation syntax again? 19:36
say <a b c> join: ','
m: say <a b c> join: ','
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3say <a b c>7⏏5 join: ','
expecting any of:
infix
infix stopper
postfix
statement end
statement mo…
moritz nope
timotimo m: say join <a b c d>: ',' 19:37
camelia a,b,c,d
Juerd moritz: Already have indirect method invocation, join @a: $s and join(@a: $s)
geekosaur foo."$bar" ? not sure which usage of indirect here
timotimo that's how that works
moritz ah right
geekosaur foo(invo: args) ?
yeh
moritz m: say <a b c>."join"(',') 19:38
camelia a,b,c
timotimo remember, it's to give people the ability to "new FooClass: :a, :b"
that's why the method name goes in front
moritz right
moritz doesn't want to remember that syntax
Juerd thinks it's insane
moritz and of course you can go wild through the MOP 19:39
Juerd But it's a good example for what I'm demonstrating. That is: there are numerous ways to do it, but most ways aren't used much in practice.
mst hates indirect object notation just in general
moritz m: my @a = < a b c>; say @a.^find_method('join')(@s, ', ')
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '@s' is not declared
at <tmp>:1
------> 3= < a b c>; say @a.^find_method('join')(7⏏5@s, ', ')
moritz m: my @a = < a b c>; say @a.^find_method('join')(@a, ', ')
camelia a, b, c
Juerd And you can just postpone learning those ways until you first encounter them.
moritz m: my @a = < a b c>; say @a.^can('join')[0](@a, ', ') 19:40
camelia a, b, c
Juerd Just like you definitely don't need to know the entire English dictionary before having a conversation :)
masak indirect object notation hates
yoleaux 27 Jun 2018 14:59Z <lizmat> masak: could you please have a look at GH #1959
Juerd moritz: I'm excluding lookups and such :)
moritz Juerd: good :-)
masak GH #1959?
moritz m: say &::('join')(', ', <a b c>)
camelia a, b, c
moritz lists them anyway 19:41
masak ah, github.com/rakudo/rakudo/issues/1959
lizmat masak: jnthn has already answered 19:42
masak I added a small comment also 19:46
19:49 Zoffix joined
Bowlslaw guys 19:49
whenever you see Randal Schwartz, you must call him, "Doctor Randal Schwartz"
moritz doesn't call his father "Dr. Papa", even though he is one :-) 19:50
Zoffix moritz: the indirect invocant has the same syntax as method signature definition:
method foo(\Invocant: \arg1, \arg2) { }
say foo Invocant: arg1, arg2;
Bowlslaw At TPC, he told me a story about how he was to give a talk at Stanford against these guys with PhDs and stuff
he asked the registar lady if this meant he had an honorary doctorate from stanford, to which she replied, "you can say anything you want" 19:51
so now he's Doctor Randal Schwartz
Zoffix Juerd: depending on what you want the result to look like, you're missing about 80 ways to call join :) 19:52
timotimo m: my $c = \(<a b c>, "hi"); say join(|$c)
camelia hi
timotimo oops? 19:53
wrong way around, is ee
m: my $c = \("hi", <a b c>); say join(|$c)
camelia ahibhic
19:54 psychoslave left
Zoffix m: my @a = <a b c>; my $s = ", "; dd @a.+join: $s; dd @a.*join: $s; dd @a.?join: $s; dd @a».+join: $s; dd @a».*join: $s; dd @a."join"($s); my $m = &join; dd $s.$m(@a); dd $s.&{join |@_}(@a) 19:56
camelia ("a, b, c", "a, b, c")
("a, b, c", "a, b, c")
"a, b, c"
(("a",), ("b",), ("c",))
(("a",), ("b",), ("c",))
"a, b, c"
"a, b, c"
"a, b, c"
Zoffix Juerd: at least some of these even give the same answer as yours in the list :)
m: say +(«"" >>» X <. .? .+ .*> X <""() () : & $ @ Str::>) 19:59
camelia 56
Zoffix s/Str::/List::/
m: dd <a b c>.List::join: "meow"
camelia "ameowbmeowc"
Juerd Zoffix: Heh 20:00
Zoffix: I think I'm going to exclude meta-ops and things that look like meta-ops :P
Zoffix :) 20:01
20:07 Zoffix left
Juerd gist.github.com/Juerd/7b684255e2bc...d53f12b063 # updated 20:14
Bowlslaw i love the hyperoperator 20:18
m: my @a = 1..5; my @b = 6..10; my @c = @a <<*>> @b; 20:19
camelia ( no output )
Bowlslaw m: my @a = 1..5; my @b = 6..10; my @c = @a <<*>> @b; say @c;
camelia [6 14 24 36 50]
Juerd Bowlslaw: Why those intermediate variables?
Bowlslaw eh, just because 20:20
me: say (1,2,3,4,5) <<+>> (5,6,7,8,9,10)
m: say (1,2,3,4,5) <<+>> (5,6,7,8,9,10)
camelia (6 8 10 12 14 11)
Bowlslaw lol, i said me
wait what
Juerd And + instead of * 20:21
Bowlslaw oh, oops
wel the + was intention
m: say (1,2,3,4,5) <<+>> (6,7,8,9,10)
camelia (7 9 11 13 15)
Juerd m: say (7, 9 ... Inf)[^5]
camelia (7 9 11 13 15)
Bowlslaw m: say (1,2,3,4,5) <<+<< (6,7,8,9,10,11) 20:22
camelia (7 9 11 13 15 12)
20:22 perlpilot joined
Bowlslaw m: say (2,4) X (6,8) 20:23
camelia ((2 6) (2 8) (4 6) (4 8))
Bowlslaw PERL HAS ZIP!??!?! 20:24
say (2,4,6,8) Z (1,3,5,7)
evalable6 ((2 1) (4 3) (6 5) (8 7))
rouking Yes
and you can use it with another operator, e.g.
moritz m: say (2,4,6,8) Z+ (1,3,5,7)
camelia (3 7 11 15)
moritz m: say (2,4,6,8) Z~ (1,3,5,7)
camelia (21 43 65 87)
Bowlslaw WHAT
moritz m: say (2,4,6,8) Z** (1,3,5,7)
camelia (2 64 7776 2097152)
Bowlslaw OMG
rouking say 1..3 Z* 1..3
evalable6 (1 4 9)
rouking pretty great, right? 20:25
Metaoperators are fantastic
Higher-order functions as operators
Bowlslaw yes 20:26
that is really cool
I went through "Programming in Haskell" a few months ago and my mind was blown
this makes me happy
rouking I've found myself very frequently using Z, X, and the hyperoperator 20:28
Especially when doing any sort of mathematical list manipulation
Bowlslaw i'll bet
rouking Project Euler problems are a breeze
Bowlslaw haha
cheater ;p
rouking heh
I really feel like a cheater when I use the built-in `lcm` operator
Bowlslaw real men do Euler problems in C
rouking oh god
Bowlslaw c89
rouking I really don't feel like implementing Euclid's algorithm myself 20:29
It's not too bad, I suppose, but why bother
oh and the reduction metaoperator, [ ]
[lcm] 1..20
Bowlslaw yes, i've used the reduction operator a lot
it's fun
rouking that's problem 5 solved, right there 20:30
Bowlslaw geeze, this language is huge
rouking 10 chars
[Coke] m: say 15 lcm 30 20:37
camelia 30
[Coke] whee 20:38
20:38 ilbelkyr joined
[Coke] m: say [\+] 1..10 ; # bowlslaw 20:38
camelia (1 3 6 10 15 21 28 36 45 55)
[Coke] another nifty meta thing.
rouking yeah, "triangle" modifier 20:39
I haven't found myself needing that yet
Usually I'll use ... for list generation
20:46 perlpilot left 20:56 zakharyas left
b2gills Juerd: You do realize that = is a meta-op. 20:56
m: $_ = 2; $_ [+]= 40; say $_
camelia 42
[Coke] = isn't the meta there, I don't think. 20:57
Juerd b2gills: Yes. What's this about?
b2gills (03:00:48 PM) Juerd: Zoffix: I think I'm going to exclude meta-ops and things that look like meta-ops :P 20:58
Juerd b2gills: That was about gist.github.com/Juerd/7b684255e2bc...d53f12b063
b2gills [Coke]: Yes it is, why do you think this works: 21:00
m: sub infix:« ^_^ » ($l,$r) { "$l smiles at $r" }; $_ = 'Alice'; $_ ^_^= 'Bob'
camelia ( no output )
b2gills m: sub infix:« ^_^ » ($l,$r) { "$l smiles at $r" }; $_ = 'Alice'; $_ ^_^= 'Bob'; say $_
camelia Alice smiles at Bob
geekosaur it's not exactly a meta-op 21:01
21:01 SmokeMachine joined
geekosaur because metas are fairly mechanical but = involves some special handling 21:01
Juerd It's in the category "looks like meta-ops"
21:02 pmurias left
b2gills It's an operator that takes another infix operator as an argument, just like X[…] Z[…] «[…]» [[…]](…) 21:04
21:05 pmurias joined
geekosaur but has to do some special things so has restrictions that normal meta-ops don't. it's more of what lisp calls a "special form" 21:05
b2gills m: $_ = 40; $_ [&( *+* )]= 2; say $_
camelia Potential difficulties:
Useless use of [&( in sink context
at <tmp>:1
------> 3$_ = 40; $_ 7⏏5[&( *+* )]= 2; say $_
42
[Coke] ah, no, that's fair. I stand corrected. (even if it's not under the covers) 21:06
b2gills m: $_ = 40; my $ = ($_ [&( *+* )]= 2); say $_
camelia 42
masak geekosaur: I'm currently debating in 007 whether to turn infix:<=> into a statement form. it's certainly special-cased enough.
I'd lose the ability to do `1 + (c = 3)` and similar, but I'm not sure I'd mourn that 21:07
b2gills I've heard Larry say that “Perl 6 doesn't have any keywords…” but `if` is implemented the way you would a keyword. (I think he meant things like it are meant to be more like a built-in macro at the language level) 21:09
21:10 pmurias left 21:11 rindolf left, skids left
Juerd b2gills: Originally, if was designed as a subroutine, and some generic syntactical magic was planned so you could leave out the comma between the list and the block. 21:12
b2gills: Is that statement from before or after if became a specially parsed thing anyway?
masak: I've repeatedly hated Python for not letting me do assignments in expressions. 21:13
El_Che Juerd: it sounds more dramatic than a constant hate 21:14
b2gills I think I heard the quote I mentioned earlier was from a 2008 talk at google https://www.youtube.com/watch?v=JzIWdJVP-wo 21:15
Juerd b2gills: I think that predates the decision to make if special after all
But I can't find a reference to when this changed
b2gills I think the weasel words that followed that quote was something like “at least to a first approximation” 21:17
Juerd Hehe
b2gills I would assume he wanted it to be more like a macro really early on, but realized that may not be the best decision in an actual implementation. 21:18
21:23 MasterDuke joined 21:27 mcmillhj left
Geth doc: 0086826da1 | (Tom Browder)++ (committed using GitHub Web editor) | doc/Language/functions.pod6
add space before left curly brace for consistent style
21:33
synopsebot Link: doc.perl6.org/language/functions
21:37 girst left, girst joined 21:41 rindolf joined 21:46 robertle left
SmokeMachine is this write (it's here: doc.perl6.org/language/functions)? `Attempting to return values of another type will cause a compilation error.` it doesnt look compilation error for me, but runtime error... 21:53
21:54 Bowlslaw left 21:56 titsuki joined 22:01 mcmillhj joined 22:06 mcmillhj left
b2gills m: sub Foo (--> Str) { return Int } 22:08
camelia ( no output )
SmokeMachine m: sub Foo (--> Str) { return Int }; Foo 22:10
camelia Type check failed for return value; expected Str but got Int (Int)
in sub Foo at <tmp> line 1
in block <unit> at <tmp> line 1
b2gills Currently a runtime error, but that may mean there is another place for optimization. (the optimizer is where type based compilation errors occur)
SmokeMachine no `===SORRY===`
geekosaur doc should probably be updated to say it's a runtime error now but may become compile time in the future 22:13
SmokeMachine will it become a compiletime error? 22:14
22:16 perigrin joined
geekosaur ideally yes. will require more complex type analysis than is currently possible 22:21
if you're asking me to predict whether this will actually be done in X timeframe, my crystal ball is broken; try elsewhere
SmokeMachine no, no! I was just asking if its planned to, when its possible, to that become compiletime error 22:22
geekosaur it has been discussed, so peole are aware of it. what it'll take to be able to support it, I don;t know neough about rakudo internals to say 22:23
SmokeMachine but what will happen when the sub return something defined at runtime? 22:24
geekosaur in many cases it'll be possible to detect such code paths. in some it won't; but that may go as "since it's got a declared result type we disallow some operations that can't be statically checked". I couldn;t say 22:26
or those might become compile-time warnings as well as runtime errors
22:26 wamba left 22:27 sena_kun left
SmokeMachine this would get a compiletime error? `sub bla(--> Int) { class A {}; A.^add_method("a", Bool.pick ?? method { "bla" } !! method { 42 }) ; A.new.a }` 22:30
22:32 HaraldJoerg left
geekosaur that's the sort of thing it might refuse to compile because it's too dynamic. depends on how they decide to implement it 22:34
I guess what I said previously didn't make sense. sorry, I know a bit about compiler internals and what you can do there, but communicating that to someone unfamiliar is more difficult 22:35
perl 6 is dynamic enough that they may go with "static errors where possible", "static errors with warnings when not static", or "reject dynamic code when all static types specified" 22:36
and as soon as it sees .^add_method, it's seeing dynamic code and can change what it's doing, either emitting a warning or refusing to continue depending on how they decide to handle it 22:37
SmokeMachine that would be great 22:38
geekosaur I suspect they won't refuse it, but would make it possible to warn; perl 6's model is gradual typing, not full static typing
22:41 dct joined 22:50 perlpilot joined 22:54 dct left 23:00 rindolf left 23:23 perlpilot left 23:25 benjikun joined 23:28 raschipi joined 23:33 BenGoldberg joined
Juerd Heh, "while () { }" is infinite in Perl 5, runs 0 times in Perl 6. 23:35
Am I correct in thinking this is because () is an empty list, which are false?
raschipi Yes. You want 'loop { }' to get an infinite one in Perl 6. 23:36
Juerd Or something that's true :) 23:37
raschipi It pays to be idiomatic.
hobbs while (π > 3) { } 23:39
23:39 MasterDuke left
raschipi m: say pi; 23:39
camelia 3.141592653589793
hobbs if the great old ones come and bring their geometry with them, the program will stop 23:40
23:42 benjikun2 joined
geekosaur unless π > 3.1416 in their geometry 23:44
23:47 benjikun left 23:49 turdmonkey joined, turdmonkey is now known as Bowlslaw
Bowlslaw Hello again 23:50
Having fun with Channels and promises 23:51
I think I know how i'm gonna do it now
raschipi nice
benjikun2 Bowlslaw: that's good 23:52
glad it's going well for you
23:52 benjikun2 is now known as benjikun 23:55 MasterDuke joined
Juerd juerd.nl/i/43bdcc3033f1cd3fa217db709f726198.png # internal error that I have not been able to reproduce 23:55
23:55 lizmat left 23:57 Bowlslaw left