»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
Herby_ if I have a cloned library that I'm making adjustments to, how do I use my local install of the module instead of the 'zef installed' module? 02:49
if that makes sense
Herby_ bueller? 02:57
b2gills perhaps `use lib '.'` or `-I=.` 03:02
sacomo Herby_, you can use `use lib 'path/to/your/local/lib'`
Herby_ sacomo: thanks, that seemed to work 03:07
b2gills: thanks too 03:08
sacomo np 03:11
Herby__ ls 04:18
ls -l
whoops, ignore 04:19
smls m: for (1..6).race(:batch<1>) { sleep rand; .say } 08:08
camelia 1
2
3
4
5
6
smls Is hyper/race still meant to be used the same way, after jnthn's rewrite?
I can't seem to get it to parallelize.
smls m: for (1..6).race(:batch<1>) { sleep 1/$_; .say } 08:13
camelia 1
2
3
4
5
6
titsuki bisect: class A { has $!arg; has &!code; multi method F(Str :$!arg) { "str".say; }; multi method F(:&!code) { "code".say; } }; A.new.F(:arg(-> { Nil })) 08:25
bisectable6 titsuki, On both starting points (old=2015.12 new=d10d697) the exit code is 0 and the output is identical as well
titsuki, Output on both points: «code»
titsuki bisect: class A { has $!arg; has &!code; multi method F(Str:D :$!arg) { "str".say; }; multi method F(:&!code) { "code".say; } }; A.new.F(:arg(-> { Nil }))
titsuki bisect: class A { has $!arg; has &!code; multi method F(Str:D :$!arg) { "str".say; }; multi method F(:&!code) { "code".say; } }; A.new.F(:arg(-> { Nil })) 08:27
bisectable6 titsuki, On both starting points (old=2015.12 new=d10d697) the exit code is 0 and the output is identical as well
titsuki, Output on both points: «code»
titsuki bisect: class A { has $!arg; has &!code; multi method F(Str :$!arg) { $!arg.say; }; multi method F(:&!code) { "code".say; } }; A.new.F(:code(-> { Nil })) 08:30
bisectable6 titsuki, On both starting points (old=2015.12 new=d10d697) the exit code is 0 and the output is identical as well
titsuki, Output on both points: «(Str)»
titsuki bisect: class A { has $!arg; has &!code; multi method F(Str:D :$!arg) { $!arg.say; }; multi method F(:&!code) { "code".say; } }; A.new.F(:code(-> { Nil }))
bisectable6 titsuki, On both starting points (old=2015.12 new=d10d697) the exit code is 0 and the output is identical as well
titsuki, Output on both points: «code»
AlexDaniel` smls: no 09:04
I think it should be like this
m: race for (1..6).race(:batch<1>) { sleep rand; .say }
camelia 3
2
4
5
1
6
AlexDaniel` titsuki: the output seems to be stable across all releases since 2015.12 09:05
titsuki: if it's different on your setup, what rakudo version do you have?
smls AlexDaniel`: Interesting. 09:06
titsuki AlexDaniel: thanks for your advice, my output is same as bisectable's one. 09:07
AlexDaniel` Herby_: I have never seen a coding style guide for perl 6 09:08
Herby_: well, maybe one, but I really can't recommend it :)
smls Well, there's github.com/moritz/perl6-wtop/blob/...ctices.pod 09:09
AlexDaniel` yeah and a corresponding issue github.com/moritz/perl6-wtop/issues/2
Herby_: oh. Not a style guide, but perhaps very useful to people who are looking for a style guide: docs.perl6.org/language/traps 09:10
smls AlexDaniel`: Dunno, I think they're right about using junctions only locally to prevent action-at-a-distance. 09:12
AlexDaniel` smls: example? 09:13
smls AlexDaniel`: Well, junctions will cause functions/methods calls to be executed multiple times instead of just once. If the code in question didn't expect to get a junction, this break expectations. 09:16
*can break
AlexDaniel` hm 09:18
smls: I guess you are right 09:21
atroxaper o/ #perl6 11:41
Zoffix \\o 11:43
atroxaper I try to find a way to do "my $supply = Supply.interval(2); $supply.tap({ something; });", but with delay instead of interval. I mean I want to wait 2 seconds only after 'something' was done. For now I invented "sub foo() { something; Promise.in(2).then({ foo() }); }". What do you think? 11:49
AlexDaniel` atroxaper: maybe you need throttle docs.perl6.org/routine/throttle 11:52
Zoffix atroxaper: I'd just use your sub. Promise.in(2) is for exactly this sort of thing 11:55
atroxaper AlexDaniel`: throttle with 1 limit and sleep 2 seconds directly in callable. Maybe... 11:56
Zoffix: yeah. I think so. I prefer Promise.in instead of sleep. 11:57
atroxaper Thank you, #perl6 :) 11:58
Herby_ AlexDaniel`: thanks for the link 15:12
mst ilmari: obSproing ... I found one with sound! twitter.com/sneakerhax/status/9215...7056406528 18:33
rindolf Hi all! what is the equivalent of p5's [@$array_ref, 500] in p6? I cannot find it here - docs.perl6.org/language/5to6-nutshell 19:14
timotimo what does that do? 19:15
geekosaur looks like it makes a new arrayref with the contents of the old and something appended? 19:17
that's kinda p5-think, possibly it should be redesigned for real array objects
(yes, I know that could end up being a big job)
rindolf geekosaur: i am using an array var
geekosaur I think you can just say [|@arr, 500] (remember that you don't have arrayrefs as such in p6) 19:18
timotimo m: my @foo = 1, 2, 3, 4; my @otherfoo = |@foo, 500; say @otherfoo.perl
camelia [1, 2, 3, 4, 500]
timotimo m: my @foo = 1, 2, 3, 4; my @otherfoo = @foo, 500; say @otherfoo.perl
camelia [[1, 2, 3, 4], 500]
timotimo ^- only the outermost iterable gets iterated when assigning to an array like this
timotimo so by using | on the @foo you cause its innards to get iterated over in place of the array object itself 19:19
rindolf timotimo: ah\
timotimo: thanks
MadHatter42 hey 19:48
MadHatter42 does anyone knows of any good ORM in perl 6 that support mongo ? 19:49
raschipi MadHatter42: Even if you can't find one in Perl6, you can use Perl5 and Python ones. 19:59
MadHatter42 raschipi: i wasnt able to find a functional replacement for the laravel's eloquent thats why i asked here 20:02
mst I'm confused as to why you'd expect an object/relational mapper to make sense with a non-relational datastore
then again I'm also confused as to why anybody would use mongo in the first place
MadHatter42 mst: ever actually used mongo ? 20:03
mst yes.
MadHatter42 or have you just heard from your friends
then why do you ask
mongo is very powerful 20:04
mst it's just about usable for data that fits in RAM that you don't mind losing
MadHatter42 i strongly disagree
MadHatter42 and regarding the first question its for management and conevenience 20:05
mst but otherwise it seems to mostly be a lot like mysql around 4.0 - easy to get started with and then you pay in operational costs later
MadHatter42 same as "why would you use an ORM in the first place"
mst I can't honestly think of a use case at this point where it would be superior to postgres w/jsonb for the unstructured parts 20:06
MadHatter42 mst: i could also use bash files in a directory for what it matters but if you're making such points i assume you barely scratched the surface of mongo 20:07
i agree though that postgres is very powerful 20:08
mst "I assume you haven't done your research" is not an argument.
MadHatter42 would be more fare from you to say that "no, we dont have a ORM for perl6" 20:09
or "yes there is one, named XXX "
MadHatter42 rather than getting philosofical about why one would use mongo in general 20:09
Geth perl6-examples: ae4c62e84d | (Shlomi Fish)++ | categories/euler/prob612-shlomif.p6
Add solution to Euler #612.
20:10
MadHatter42 *fair
mst had somebody come along with a better/more concrete example I'd've let that conversation take over 20:12
MadHatter42 mst: that kinda makes sense, at least is better than the "switch to python" answer that someone mentioned 20:13
mst I would expect that you could use Inline::Perl5 to use the official MongoDB perl5 client
raschipi I didn't say you should switch to Python, just that you can make use of their modules in Pelr6 20:14
mst same principle as my comment then
MadHatter42 i'm just exited about perl6 and i have a microservice to write that i wanted to implemented in perl6 ( that i can also use perl5 directly ) 20:15
geekosaur basically we're too new to have much of an ecosystem, but we can use existing ecosystems as a workaround
so you can bind to and use perl 5, python, and a few other ecosystems' modules from perl 6
Zoffix eco: couch 20:16
buggable Zoffix, Nothing found
geekosaur or use NativeCall to bind directly to C APIs
Zoffix eco: mongo
buggable Zoffix, Found 2 results: MongoDB, BSON. See modules.perl6.org/s/mongo
Zoffix I guess "driver" is not an ORM. 20:17
chsanch Hi, I'm using the permutations routine, but I was wondering is there any way to get permutations by a given length?, i.e: permutations('ABCD', 2) to get: AB AC AD ...
moritz aren't those selections? 20:18
Zoffix m: say <a b c d>.combinations: 2 20:19
camelia ((a b) (a c) (a d) (b c) (b d) (c d))
rindolf Zoffix++ 20:34
chsanch I see, combinations is what I need. Thanks! 20:38
Geth doc: shlomif++ created pull request #1617:
Document the proper way to concat arrays.
21:15
doc: 5a09dedd7a | (Shlomi Fish)++ (committed by Zoffix Znet) | doc/Language/5to6-nutshell.pod6
Document the proper way to concat arrays. (#1617)

In 5to6 - it was not properly documented. Also spell "," as the comma.
This got me tripped when working on perl6-examples.
21:17
synopsebot Link: doc.perl6.org/language/5to6-nutshell
gfldex lolibloggedalittle: gfldex.wordpress.com/2017/10/22/th...same-time/ 21:21
rindolf gfldex: shouldn't the title read "than" and "at"? 21:24
gfldex rindolf: well spotted 21:25
timotimo gfldex: exectuion typo'd 22:54
gfldex timotimo: fixed 22:56
timotimo and i wonder if "botteling up" should be "bottleing up" instead, but that also looks wrong
"andprocess" wants to be split 22:57
and i think the line break after "since we don't got a react" is an accident?
teatime ("bottling", no?) 22:58
timotimo that looks a bit less wrong
timotimo and also it's probably "foot guns" rather than "food guns" 22:58
notostraca bottling
beer bottling and distribution plant 22:59
gfldex timotimo: all fixed. Please remind me to wake up before writing posts. :->
timotimo hah, it's no problem at all :)
timotimo this is more of a nitpick really: maybe "in place of a proper value" instead of "instread"? (actually, instread is also a typo) 23:01
good post in total 23:02
gfldex "in place" would be correcter if it would be more german
timotimo ah, my bias is showing :) 23:03
gfldex it feels like I'm missing something
timotimo i personally wouldn't have shown off Thread.new at all 23:04
timotimo pointing out that you're free to shove a custom class into $*SCHEDULER is too advanced for an introductory text 23:05
timotimo and supplies are more about handling already-existing concurrency than adding more; the emitting thread pays for the work that the supply block does 23:05
gfldex We can have as much advanced on Rosettacode as we like, as long as it's brief. 23:06
that's a good point. I will work on that part.
Do Junctions autothread already? 23:07
timotimo nope
i don't have a good idea for restructuring the code example to show it, but react is the less general form of supply, which is an extremely useful tool to process/combine streams 23:08
i mean, you can just emit .Str if try .open.slurp.contains('Rosetta') and have a react block whenever result-supply { say "found rosetta in {.Str}" }b 23:10
but that seems artificial
thundergnat gfldex: regarding your blog post - that where added -> that were added, custructs -> constructs, methods forms -> method forms, build-in -> built-in, we don’t got -> we haven’t got|we don’t have 23:39
Other than that, cool, glad someone is looking at updating older examples. 23:40