»ö« 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.
thundergnat .tell daxim Regarding the pronunciation of 𫇵. Can't really help with that, but I will leave this without further comment. twitter.com/henryfhchan/status/111...0864907265 00:03
yoleaux thundergnat: I'll pass your message to daxim.
Axeman Just letting somebody know that the website download for Win64 is broken. Keeps getting a 500 error. Thanks 00:11
cpan-p6 New module released to CPAN! LogP6 (1.5.2) by 03ATROXAPER 03:03
Xliff m: ^30.sum 05:28
evalable6 Potential difficulties:
Precedence of ^ is looser than method call; please parenthesiz…
Xliff, Full output: gist.github.com/48488d8879387fc8d4...da7ee185b4
Xliff m: ^(30).sum
evalable6 WARNINGS for /tmp/cu6e7qlxPk:
Useless use of "^" in expression "^(30).sum" in sink context (line 1)
Xliff m: (^30).sum
evalable6
Xliff m: (^30).sum.say
evalable6 435
Xliff m: (^45).sum.say
evalable6 990
holyghost . 05:42
yoleaux 24 Apr 2019 16:18Z <Xliff> holyghost: Sure! You have my email. Please remember I do NOT have a lot of resources on this VM, so that will limit what can be done.
patrickb .tell sena_kun I just added two PRs for croservices/openapi-model. 08:31
yoleaux patrickb: I'll pass your message to sena_kun.
skaji I hope this would be fixed. github.com/perl6/rakudo.org/issues/26 08:53
yoleaux 18 Oct 2017 22:33Z <HoboWithAShotgun> skaji: I hacked on mi6, check out github.com/skaji/mi6/pull/28
kawaii hm, is there any shortcut in comma to highlight a bunch of text and change the case? 08:56
i.e. uppercase to lower?
moritz currently powercycling the p6c.org server with a monitor attached 08:57
it said "IPMI Initializing" for a minute, now it says "System Initializing ...."
... but it said the same thing before the attempted powercycle 08:58
I'm going to wait a minute or two 08:59
lizmat moritz++ 09:04
moritz now with keyboard attached, doesn't seem to get any further :(
nope, looks toasted to me 09:06
nine I guess the hardware is out of warranty? 09:09
jnthn kawaii: iirc, Ctrl+Shift+U; it's Toggle Case on the Edit menu, and the shortcut should be displayed next to it
kawaii jnthn: much appreciated :) 09:10
moritz nine: yes. entered the DC 2014-12-04
so it's 4+ years old 09:11
nine So I guess it's time to rip out components and see if it boots then 09:13
wahnberger hi folks :) Is the are way to check whether a string has non-ascii chars or not? I am checking bunches of lists of domain names and sometimes there is a IDN domain name (eg with a cyrillic char or so)? 09:22
moritz m: say "möp" ~~ /<:!ascii>/ # for wahnberger 09:23
evalable6 「ö」
wahnberger due to performance issues i would like to do a conversion only if its non ascii 09:24
rba moritz: Are you able to see the hard drives from IPMI or Bios?
moritz rba: I don't even get to a mgmt interface in bios
and I have no idea how to use ipmi
so I guess I'll have to take it home, remove the hard drives, and mount them to another machine 09:25
wahnberger moritz: thx!
lizmat wonders if reseating things that haven't been soldered, might help 09:27
nine moritz: you can still try to remove components on location like memory modules. Maybe one is so faulty that it keeps the BIOS from initializing 09:28
moritz yes, I can 09:29
patrickb releasable6: status 09:41
releasable6 patrickb, Next release will happen when it's ready. 4 blockers. 61 out of 236 commits logged (⚠ 51 warnings)
patrickb, Details: gist.github.com/b3941a751d20d54b7f...753f355efc
El_Che moritz: in that case ipmi is not configured (users and the like), so it won't be an option 09:46
moritz: nine's suggestion makes a lot of sense. Disks and RAM breaks regularly. I broken disk won't stop you from being the BIOS. Broken RAM will. 09:48
(but you know all that, just to be sure)
atroxaper jnthn: sena_kun: I'm sorry, but I cannot download a plugin version of CommaIDE. commaide.com/subscriber/feedback/46 10:00
yoleaux 24 Apr 2019 17:00Z <lizmat> atroxaper: published link on /r/perl6, you could also consider posting it to Hacker News
sena_kun .oO ( everyone use Comma ) 10:01
yoleaux 08:31Z <patrickb> sena_kun: I just added two PRs for croservices/openapi-model.
sena_kun atroxaper, thanks, I'll ping jnthn...
atroxaper everyone use Comma! I'm working in JetBrains. Of course, I should use Comma :) 10:02
sena_kun atroxaper, we'll fix it in a moment... 10:05
atroxaper sena_kun: Thank you! 10:08
sena_kun atroxaper, done, thanks for report 10:12
atroxaper sena_kun: confirm
sena_kun: Now I'm going to test it and create the new bunch of tickets about macOS version :) 10:14
sena_kun atroxaper, thanks! Please do.
kawaii sena_kun: fwiw, I couldn't write perl 6 without comma now :) 10:19
sena_kun it's the same for me... 10:22
kawaii I use Comma for a lot of things now too, editing sql, json etc 10:29
trying to work out if Comma Complete is worth it for me 10:30
currently an expense I can't afford, but might be getting a new job soon so we'll see :)
sena_kun kawaii, good luck with a new job, if you'll decide to change one. 10:31
ugexe zef v0.7.3 one can use `zef install ...` with --/update (to disable all auto-updating if an existing ecosystem file exists), --/update=p6c to disable a specific ecosystem only, --update to force updating all ecosystems, and --update=p6c to update a specific ecosystem only 10:34
timotimo oh no, i hope it wasn't me who broke p6c; i did run afl which would have maxed out one core 10:37
ugexe++
sena_kun timotimo, the sites are responsive for me... 10:38
cpan-p6 New module released to CPAN! HTTP::Tinyish (0.1.4) by 03SKAJI
timotimo sena_kun: well, they are no longer hosted on www.p6c.org, or did something happen in the mean time? 10:40
sena_kun timotimo, a-ah, sorry, I thought you were referring to the backup droplet 10:41
sena_kun releasable6, status 10:44
releasable6 sena_kun, Next release will happen when it's ready. 4 blockers. 61 out of 236 commits logged (⚠ 51 warnings)
sena_kun, Details: gist.github.com/715be8df17a640fa29...6dac2e24f8
holyghost 64;1;2;6;9;15;18;21;22c64;1;2;6;9;15;18;21;22c 10:47
sorry pressed enter with a terminal overflow 10:49
kawaii is there a metaoperator I can use to add two hashes together when they share identical structure? 11:38
timotimo yeah 11:39
just hyper + it
if the structure is identical and you want to enforce it, use >>+<<
if the structures are similar, but sometimes one has a hole, <<+>> is fine
kawaii `»+«` oooh this looks fun
timotimo m: say { :1a, :2b, :3d } <<+>> { :10a, :20c, :30d }
evalable6 {a => 11, d => 33}
timotimo m: say { :1a, :2b, :3d } >>+<< { :10a, :20c, :30d } 11:40
evalable6 {a => 11, b => 2, c => 20, d => 33}
timotimo actually i was wrong
but yeah, look at that there and you should be able to tell what's going on
kawaii timotimo: »+« works perfectly, thank you!
timotimo \o/
kawaii and HYPER OPERATOR sounds really impressive so ++ 11:41
kawaii timotimo: can I loop until all values in a hash = X, even if I don't know what keys it has? 11:53
timotimo is the hash nested? 11:56
kawaii timotimo: nope! 11:58
timotimo cool 11:59
in that case just .values will do it
m: my %foo = { :1a, :2b, :3c, :5c }; while %foo.values.any != 2 { %foo.values.pick = 2; print "." }; say %foo 12:00
evalable6 Potential difficulties:
Useless use of hash composer on right side of hash assignment;…
timotimo, Full output: gist.github.com/ee2992946b84eca0f7...ffd950ea23
timotimo m: my %foo = :1a, :2b, :3c, :5c; while %foo.values.any != 2 { %foo.values.pick = 2; print "." }; say %foo
evalable6 {a => 1, b => 2, c => 5}
timotimo not quite
m: my %foo = :1a, :2b, :3c, :5c; say %foo.values.any
evalable6 any(2, 5, 1)
timotimo m: my %foo = :1a, :2b, :3c, :5c; say %foo.values.any != 2
evalable6 False
timotimo oh, right, negations 12:01
m: my %foo = :1a, :2b, :3c, :5c; while not %foo.values.all == 2 { %foo.values.pick = 2; print "." }; say %foo
evalable6 (exit code 1) Cannot modify an immutable Int (5)
in block <unit> at /tmp/wDG16UN0pu line 1
timotimo m: my %foo = :1a, :2b, :3c, :5c; while not %foo.values.all == 2 { %foo{%foo.keys.pick} = 2; print "." }; say %foo
evalable6 ...{a => 2, b => 2, c => 2}
timotimo m: my %foo = :1a, :2b, :3c, :5c; while not %foo.values.all == 2 { %foo{%foo.keys.pick} = 2; say %foo }; say %foo
evalable6 {a => 1, b => 2, c => 2}
{a => 1, b => 2, c => 2}
{a => 2, b => 2, c => 2}
{a => 2, b => 2, c => 2}
kawaii thank you timotimo :)
timotimo YW
woolfy Question: where can we read the backlog of this channel (and other Perl 6 related channels)? 13:08
lucs woolfy: See topic for this channel, others, I don't know. 13:09
woolfy lucs: thanks (of course I should have looked there first)
lucs :) 13:10
cpan-p6 New module released to CPAN! Acme::Cow6 (0.0.1) by 03ELIZABETH 13:11
El_Che woolfy: hallo from the log 13:13
skaji ugexe: gist.github.com/skaji/9b90b942bdfa...1d7e8660c7 13:24
patrickb Does `next` have any special meaning inside CATCH blocks? 13:25
jnthn patrickb: Not intentionally, at least :) 13:45
patrickb Ugh.. 13:52
I got a very ugly bug it seems. It's non golfable and expresses itself by `next` acting like it's a `.resume`. A quick search through rakudo issues yielded no results. 13:53
jnthn Well, next is in itself a control exception 13:54
Can probably stick a label on the loop in question and then `next LABEL`
patrickb jnthn: Using a label makes it work. Original behavior seems like a bug though. Not sure if it's worth a report, it's quite golf resistant... 14:33
Xliff A class cannot have attributes, but you tried to declare '$!p' 15:14
^^ LTA?
m: class A{ has $!p };
evalable6
Xliff m: class A { }; class B has A{ has $!p }; 15:15
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/CC2UriLtem
Unable …
Xliff, Full output: gist.github.com/f2536a7fb1db088e7c...b5146ab6ae
Xliff m: class A { }; class B is A{ has $!p };
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/kuyx5u71jv
A class…
Xliff, Full output: gist.github.com/4e90ab694139c142e6...4c7b536618
Xliff ^^ There we go. The error message hides the actual problem of the fact that a space needs to be between the A and { 15:16
kawaii I'm trying to `.round` the `%stats{$inc}` and `%stats{$dec}` here so that I don't end up with floats (I need Ints), but keep being told they're immutable, any ideas why? www.irccloud.com/pastebin/TONa1gQ0/ 15:48
(the `if $inc` and `if $dec` are there purely because they can sometimes (rarely) be `(Any)`, which is valid but causes issues) 15:49
m: say so (Any); 15:50
evalable6 False
lizmat m: my %h = a => pi; dd %h<a>.round
evalable6 3
lizmat kawaii: I guess I need more context?
kawaii lizmat: I'll provide a gist/example shortly 15:52
lizmat okido 15:53
kawaii `%stats` is a hash containing values that look like this: `{attack => 50, defence => 50, hp => 50, special-attack => 50, special-defence => 50, speed => 50}`
`$nature` contains a hash too, with keys like `increased-stat`
www.irccloud.com/pastebin/ch0D3nP4/ 15:54
I'm just not sure why these keys in this hash are immutable 15:55
If I remove the `.round` from `%stats{$inc}.round *= 1.1 if $inc;` it works but I get floats in the two keys we modified 15:57
cpan-p6 New module released to CPAN! Acme::Cow6 (0.0.2) by 03ELIZABETH 15:58
atroxaper What 'Acme' means? 16:03
lizmat kawaii: so how is that hash made ?
raschipi ACME means 'a company that makes everything'. 16:05
lizmat en.wikipedia.org/wiki/Acme_Corporation
in Perl context: Acme:: modules are modules that generally shouldn't be taken too seriously 16:06
atroxaper Oh. Thanks for explanation.
japhb kawaii: Where's your repo? (I did github.com/japhb/RPG-Base and a few system-specific variations for e.g. PFRPG, so your question caught my eye)
kawaii japhb: it's github.com/kawaii/p6-pokeapi but I still need to push this code to it 16:07
one moment
japhb: so if you use this example script - github.com/kawaii/p6-pokeapi/blob/...eration.p6 it uses my :Test datasource, so no need for a database 16:09
usage: `perl6 -I lib/ examples/full-generation.p6`
github.com/kawaii/p6-pokeapi/blob/...m6#L54-L73 16:10
^ the specific method
japhb kawaii: The problem with that method is that you want .round on the right, not the left. (.round does not produce an 'lvalue', which is a value that can appear on the left side of an assignment.) 16:12
raschipi You you'll need parens. 16:13
japhb So you'll probably need to longhand it a bit -- %stats{$inc} = (%stats{$inc} * 1.1).round if $inc.
raschipi Or*
japhb s/\.$/;/ 16:14
kawaii ah! I didn't know about that
thank you!
japhb np
raschipi %stats{$inc} = (%stats{$inc} * 1.1).round if $inc. # Should be if there? It's not supposed to run if it's False? Or it's about being undefined? 16:16
kawaii raschipi: yes, the `if` is there because sometimes that value can be `(Any)` 16:17
in which case we just do nothing
since you can't multiply by that :)
m: say so (Any);
evalable6 False
raschipi m: my $a = Any; say $a * 1.1 with $a; say $a * 1.1 if $a; $a = 0; say $a * 1.1 if $a; say $a * 1.1 with $a 16:23
evalable6 0
raschipi m: my $a = 0; say $a * 1.1 if $a 16:24
evalable6
raschipi m: my $a = 0; say $a * 1.1 with $a
evalable6 0
raschipi with tests for definedness instead of truth 16:25
cpan-p6 New module released to CPAN! FindBin (0.2.6) by 03LEMBARK 16:59
xinming What is the best way to control the number of processes to run in parallel? For example, There are 20 jobs to be done, But I want to run it with 5 max 17:39
sena_kun xinming, how do you running those? .race? 17:41
xinming ProcAsync IIRC 17:43
raschipi It would be easy if you run just normal normal processes but started multiple workers in Perl6 to wait for them. 17:46
xinming raschipi: But there are over 20, running them all causes cpu to be bloated 17:48
sena_kun m: react { my $batch-size = $*KERNEL.cpu-cores; my @queue = eager 0..10; sub do-one { with @queue.shift -> $el { sleep rand; say $el; do-one } }; do-one for ^$batch-size; }
evalable6 0
1
2
3
4
5
6
7
8
9
10
xinming So, I'm thinking wether it's possible to control the size.
sena_kun but in do-one you are running a Proc::Async, and inside of the same sub then you can do `whenever $proc.ready`, `whenever $proc.start { (call do-one here) }` 17:49
xinming I need to think about how your example work
sena_kun this way your Proc::Async jobs will be done in parallel with a fixed batch size
I wrote it with some working code, but if I add non-runnable pseudocode, it'll be like... 17:50
sub do-one { with @queue.shift -> $el { my $proc = Proc::Async.new(...); whenever $proc.out {} do-one } }; do-one for ^$batch-size 17:51
ugh
sena_kun sub do-one { with @queue.shift -> $el { my $proc = Proc::Async.new(...); whenever $proc.out { ...processing... }; whenever $proc.start { ...some post-processing... do-one() } } }; do-one for ^$batch-size 17:51
lucs zef questions: 1. Can I tell it to use a directory different from $HOME/.zef? 2. What config file is --config-path about? ("Load a specific Zef config file") 17:54
xinming I'm thinking, how can perl6 do so much magic. 17:55
I'll check doc about whenever and react
raschipi xinming: Alsdo check .race
xinming sena_kun: So, for whenever block without react is ok?
I thought whenever should be only used in react or supply block. 17:56
sena_kun xinming, no, react is necessary
xinming raschipi: Ok, WIll check, Thanks.
sena_kun: So, for second example, there should be a react block wrap all the code, right? 17:57
sena_kun xinming, ah, well, the second example is incomplete. I just shown how can `do-one` look like to be closer to your(probably) usecase, instead of dumb `sleep rand; say` thing. 17:58
to show that in your case you have to recurse not in the end of the block, but whenever the process ends
xinming sena_kun: For the second one, Where should I wrap the react? 17:59
all code? or only the after the Proc::Async.new(...); react { whenever $proc.out { ... }; whenever $proc.start { ...; do-one() } }; do-one for ^$batch-size
sena_kun xinming, you can just take the first one, then paste definition of do-one from the second one instead of the one from the first one. 18:00
give me a second...
xinming, gist.github.com/Altai-man/ca5412b2...005a895ac1 18:01
xinming Thanks. So, react block should be the top-level. 18:03
sena_kun yes
xinming If I understand right, in perl6, We can have only one react block per program, right?
So, We can't do something like this. if blabla { react { ... } } else { }; 18:04
sena_kun why not?
no
react block is just a thing that takes care of your `whenever` subscriptions
give me a second... 18:05
xinming So, all whenever subscribed things, will be shared globally?
hmm
sena_kun xinming, jnthn.net/papers/2019-gpw-react-sup...enever.pdf <- I recommend reading this
it is an awesome reading and it just explains the thing I remembered out of this paper... :)
xinming Ok, THanks. I don't know that material. 18:06
tony-o_ lucs: you can use somewhere else with the env var XDG_CONFIG_HOME so long as there is a child zef/config.json 18:17
tony-o_ --config-path allows you to use a custom config file, for example, if you want to muck around with some modules or write your own for fetching/updating/testing/whatever you could copy zef's %?RESOURCES<config.json> somewhere, modify it, and then use that config path temporarily 18:19
lucs, see: github.com/ugexe/zef/blob/master/l...ig.pm6#L21 18:20
lucs tony-o_: Gotcha. Thanks! 18:21
tony-o_ if you have trouble feel free to .tell me, ugexe is at PTS and i'm in tel-aviv 18:23
kawaii Using DBI, when I select a single column from a table and then do `my @stuff = $query.allrows;` I get a nested array each time like `[[hello], [world]], is there some operator I can use to prevent that? 18:46
sena_kun kawaii, just you `$stuff`? 18:50
oops
m: sub foo { [1], [2] }; my $a = foo; say $a
evalable6 ([1] [2])
kawaii well, I want to return a non-nested array 18:51
sena_kun m: sub foo { [1], [2] }; my $a = |foo; say $a
evalable6 ([1] [2])
sena_kun m: sub foo { [1], [2] }; my $a = foo.flat; say $a
evalable6 (1 2)
sena_kun kawaii, like a flatted one or?
kawaii eh I think, i.e. [hello, world, goodnight, world] instead of [[hello], [world], [goodnight], [world]] 18:52
sena_kun kawaii, try `flat`
either a method or a subroutine, as you see fitting... 18:53
kawaii sena_kun: perfect, thank you!
skids m: sub foo { [[1],[2]], [2] }; my $a = foo[*;*]; say $a # or that 20:14
evalable6 ([1] [2] 2)
skids ...which lets you choose flattening level
m: sub foo { [[1],[2]], [2] }; my $a = foo[*;*;*]; say $a
evalable6 (1 2 2)
Elronnd is there a good way to get namespaced enums? So far I've been doing module A is export { enum <X Y Z> }, but it would be nice to say something like 'better enum A<X Y Z>' 20:43
(so I can refer to A::X or A.X or something like that, not just bare X)
or, rather, so I'm forced to refer to it with the namespace 20:47
sena_kun m: enum Foos <F1 F2>; say Foos::F1; 20:48
evalable6 F1
sena_kun Elronnd, ^?
Elronnd m: enum Foos<F1 F2>; say F1 20:49
evalable6 F1
Elronnd I want ^^ to be illegal
sena_kun oh, I see... I don't think you can do it without a really black magic... so a module is a solution, likely 20:50
Elronnd ok
skids I remember fighting with this when trying an xcb module. something to do with package EXPORT::yada::yada { ... } 20:55
skids m: our package CWEnum is export(:DEFAULT,) { our enum CW is export(:enums) «:CWBackPixmap(5)»; }; say CWEnum::CWBackPixmap + 4 21:05
evalable6 9
skids m: our package CWEnum is export(:DEFAULT,) { our enum CW is export(:enums) «:CWBackPixmap(5)»; }; say CWBackPixmap + 4
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/lE5SBPNdZA
Undeclared name:
CWBackPixmap used at line 1
skids Elronnd: ^^^ 21:06
timotimo m: constant Foos = do { enum Foos <F1 F2 F3>; Foos }; say F1 21:17
evalable6 F1
timotimo m: constant Foos = do { anon enum Foos <F1 F2 F3>; Foos };
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/VkyXoL3RMu
Undeclared name:
Foos used at line 1
timotimo no, wrong way around
m: constant Foos = do { my enum Foos <F1 F2 F3>; Foos }; say F1 21:18
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/pplbNfnsSU
Undeclared name:
F1 used at line 1
timotimo m: constant Foos = do { my enum Foos <F1 F2 F3>; Foos }; say Foos::F1
evalable6 F1
timotimo Elronnd: i think this is the right way to do it
skids Well, with a package you can import into a local scope if needed. 21:21
m: our package A { our enum B is export «:F1(5)»; }; { import A; F1.say }; 21:25
evalable6 F1
skids m: our package A { our enum B is export «:F1(5)»; }; { import A; F1.say }; F1.say;
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/M9iIHVHVH6
Undeclared name:
F1 used at line 1
timotimo that's cool, but also rather a bit longer :) 21:28
m: constant Foos = do { my enum Foos <F1 F2 F3>; Foos }; { import Foos; say F1 }
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/fyDUhniav7
Undeclared name:
F1 used at line 1
timotimo m: constant Foos = do { my enum Foos <F1 F2 F3>; Foos }; { import Foos::; say F1 } 21:29
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/VwherJW4fO
Undeclared name:
F1 used at line 1
timotimo *shrug* :)
skids (Not that using a constant isn't clever :-) 21:30
Anyway, I'm free... free I say... so I'm driving home... 21:31
kawaii I have issues with DBIish that are probably easy to fix but complicated to explain 22:19
So I wrote a gist trying to explain it the best I could
gist.github.com/kawaii/66f2f21bc19...799ca5c8a2
sena_kun kawaii, one question... 22:43
maybe I don't understand something, but in `get-natures` you have `$_<name> => $_` for every row. 22:44
kawaii, but in your table select I don't see such a column. maybe you want `$_<nature> => $_`?
kawaii hmmmmmmmm!
how did I miss that
maybe because I'm really tired 22:45
sena_kun the error is saying that you are using Any in place of something that can be a Str.
kawaii, no problem, it happens sometimes. Take care and take your time to rest!
kawaii sena_kun: thanks, that fixed it - I really appreciate the support given in this channel by you and many others :) 22:46
sena_kun kawaii, you are welcome. :) 22:47
MasterDuke news.ycombinator.com/item?id=19750507 "Programming language ray tracing benchmarks project", me mentions wanting a perl sample. this seems like the sort of thing perl 6 would initially be very slow at, but judicious use of natives could make a large difference 23:16
*he mentions 23:17
MasterDuke timotimo: haven't you done some ray-tracing something in perl6 already? 23:23