Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-04-06

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:00 kst joined #perl6
00:02 Guest76823 joined #perl6
00:06 skids joined #perl6
00:11 mcmillhj joined #perl6
00:21 perlawhirl joined #perl6
00:42 gdonald joined #perl6
00:51 TEttinger joined #perl6
00:51 Actualeyes joined #perl6
00:59 perlawhirl joined #perl6
01:05 Guest76823 joined #perl6
01:13 shdb joined #perl6
01:14 vendethiel joined #perl6
01:19 astj joined #perl6
01:20 perlawhirl joined #perl6
01:21 kyan joined #perl6
01:22 astj joined #perl6
01:28 jeek joined #perl6
01:40 cyphase joined #perl6
01:47 ilbot3 joined #perl6
01:47 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
01:55 Cabanossi joined #perl6
02:18 cibs joined #perl6
02:23 kyan joined #perl6
02:29 Cabanossi joined #perl6
02:29 noganex joined #perl6
02:31 mcmillhj joined #perl6
02:41 agentzh joined #perl6
02:45 labster joined #perl6
02:48 xtreak joined #perl6
03:09 astj_ joined #perl6
03:10 xtreak joined #perl6
03:15 vendethiel joined #perl6
03:24 u-ou is sleep() thread-safe?
03:27 xtreak joined #perl6
03:29 Cabanossi joined #perl6
03:36 llfourn m: my $foo = "foo"; my \t = (* =:= $foo); say $foo ~~ t; say t.($foo) # bug?
03:36 camelia rakudo-moar ad01ed: OUTPUT: «False␤True␤»
03:38 andrzejku joined #perl6
03:40 andrzejku hello!
03:41 u-ou hi
03:43 tempuser75545888 joined #perl6
03:44 tempuser6435457 joined #perl6
03:46 Cabanossi joined #perl6
04:05 cibs_ joined #perl6
04:06 mr-fooba_ joined #perl6
04:10 Grauwolf_ joined #perl6
04:17 shdb joined #perl6
04:19 lowbro joined #perl6
04:26 wamba joined #perl6
04:48 hobbs joined #perl6
04:49 curan joined #perl6
04:54 astj joined #perl6
05:00 rurban joined #perl6
05:02 Cabanossi joined #perl6
05:05 andrzejku john51_ hey
05:16 gdonald joined #perl6
05:42 cpage_ joined #perl6
05:46 RabidGravy joined #perl6
05:53 domidumont joined #perl6
05:55 andrzejku :)
05:59 domidumont joined #perl6
06:00 domidumont joined #perl6
06:01 Cabanossi joined #perl6
06:09 someone__ joined #perl6
06:21 perlawhirl joined #perl6
06:23 Actualeyes joined #perl6
06:26 notbenh joined #perl6
06:27 gdonald joined #perl6
06:27 ChoHag joined #perl6
06:32 wamba joined #perl6
06:33 japh__ joined #perl6
06:36 geekosaur joined #perl6
06:45 eater joined #perl6
06:47 Cabanossi joined #perl6
06:48 darutoko joined #perl6
06:55 rurban joined #perl6
07:01 andrzejku hello?;)
07:05 japh__ in perl6 REPL, how would we do something like ruby's object.methods to list available methods/functions?
07:08 huf .^methods?
07:16 movl joined #perl6
07:19 moritz or .^methods(:all) if you also want to include methods from Cool, Any and Mu
07:20 parv joined #perl6
07:23 rindolf joined #perl6
07:29 japh__ is rakudo-star 2017-03 coming soon or should we build rakudo without using the rakudo-star pack?
07:36 domidumont joined #perl6
07:37 dh7320 joined #perl6
07:37 dakkar joined #perl6
07:41 zakharyas joined #perl6
08:02 jonas1 joined #perl6
08:03 duncan_dmg joined #perl6
08:08 lizmat japh__: atm I don't think there are immediate plans for a Rakudo Star 2017.03
08:13 wamba joined #perl6
08:18 xtreak joined #perl6
08:27 dh7320 joined #perl6
08:27 salva joined #perl6
08:38 xtreak joined #perl6
08:46 Cabanossi joined #perl6
08:49 lowbro joined #perl6
08:49 lowbro joined #perl6
08:50 Ulti my bioinformatics tests are at around 0.8-0.85s so 20% speed up since the 1s mark about 9 months ago
08:51 ccntrq joined #perl6
08:52 Guest17930 joined #perl6
09:02 Ulti hoelzro the Docker example where you have: $ docker run -it rakudo-star -e 'say "Hello!"'  doesn't work for me I get an error there is no container command -e
09:05 domidumont joined #perl6
09:20 hobbs Ulti: yeah, actually needs to be docker run -it rakudo-star perl6 -e 'say "Hello!"'
09:20 hobbs default command only applies when there are no args
09:24 japh__ joined #perl6
09:25 kurahaupo joined #perl6
09:29 El_Che add --rm
09:30 El_Che so it does not keep the container around
09:35 xtreak joined #perl6
09:45 kurahaupo_ joined #perl6
09:47 kurahaupo joined #perl6
09:47 Cabanossi joined #perl6
09:57 ribasushi joined #perl6
10:07 grondilu joined #perl6
10:07 grondilu how do I check that all elements of a list are unique?  Can I do all(@a) == one(@a)?
10:08 grondilu I guess I could do [&&] sort(@a) Z== sort(@a).unique  but that's no fun
10:08 grondilu or @a.unique == @a
10:10 jnthn The latter probably makes more sense
10:10 jnthn Maybe @a.Set == @a is also an option
10:11 grondilu m: for ^100 { my @a = (^100).pick(5); say "oops" unless all(@a) == one(@a) }
10:11 camelia rakudo-moar 5704e5: ( no output )
10:11 grondilu m: for ^100 { my @a = (^100).roll(5); say "oops" unless all(@a) == one(@a) }
10:11 camelia rakudo-moar 5704e5: OUTPUT: «oops␤oops␤oops␤oops␤oops␤oops␤oops␤oops␤oops␤»
10:12 jnthn Thing is, I know the ones involving set and unique are O(n). I've no clue what the junction one might be :)
10:13 jnthn Though I suspect quadratic.
10:21 lizmat grondilu: .repeated
10:21 lizmat m: my @a = ^10; dd +@a.repeated
10:21 camelia rakudo-moar 5704e5: OUTPUT: «0␤»
10:21 lizmat m: my @a = 1,1,2,2,3; dd +@a.repeated
10:21 camelia rakudo-moar 5704e5: OUTPUT: «2␤»
10:22 lizmat m: my @a = 1,1,2,2,3; say "does not contain just unique values" if @a.repeated
10:22 camelia rakudo-moar 5704e5: OUTPUT: «does not contain just unique values␤»
10:31 Cabanossi joined #perl6
10:32 lizmat grondilu: .repeated.Bool will return True as soon as it sees 1 element
10:33 lizmat so worst case is that the whole list needs to be examined (and returning False)
10:33 lizmat best case you'd know after examining 2 elements
10:34 lizmat Ulti: good news!  :-)
10:43 vendethiel- joined #perl6
10:43 mxco86 joined #perl6
10:48 xtreak joined #perl6
11:02 Cabanossi joined #perl6
11:08 rurban joined #perl6
11:18 bjz joined #perl6
11:22 wamba joined #perl6
11:33 sammers hi #perl6
11:38 mscha joined #perl6
11:39 rurban1 joined #perl6
11:39 mscha m: for 1..10 { say $^i + $i; } # You can leave out the ^ twigil on repeated use??
11:39 camelia rakudo-moar 4683e8: OUTPUT: «2␤4␤6␤8␤10␤12␤14␤16␤18␤20␤»
11:39 mscha Saw it in https://twitter.com/zoffix/status/849924459368779776
11:39 timotimo yes, you can
11:40 mscha I'm fairly sure this isn't documented.
11:40 timotimo the $^i is a declaration
11:40 timotimo possibly, yeah
11:40 bjz_ joined #perl6
11:42 lizmat m: my $i = 42; for 1..10 { say $^i + $i }
11:42 camelia rakudo-moar 4683e8: OUTPUT: «2␤4␤6␤8␤10␤12␤14␤16␤18␤20␤»
11:42 lizmat hmmmm
11:42 lizmat m: my $a = 42; for 1..10 { say $^i + $a }
11:42 camelia rakudo-moar 4683e8: OUTPUT: «43␤44␤45␤46␤47␤48␤49␤50␤51␤52␤»
11:43 lizmat this feels like a bug to me
11:43 lizmat afk&
11:43 timotimo definitely not
11:43 astj joined #perl6
11:43 timotimo { say $^i + $i } is equivalent to -> $i { say $i + $i }
11:43 timotimo no bug here
11:43 timotimo it has to be like this because you can't put $^i into nested blocks and mean the outer $i that you declared with $^i already
11:45 timotimo m: for ^10 { sub use-it { $^i * 2 }; say $use-it + $^i }
11:45 camelia rakudo-moar 4683e8: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Variable '$use-it' is not declared. Did you mean '&use-it'?␤at <tmp>:1␤------> 3for ^10 { sub use-it { $^i * 2 }; say 7⏏5$use-it + $^i }␤»
11:45 timotimo m: for ^10 { sub use-it { $^i * 2 }; say use-it() + $^i }
11:45 camelia rakudo-moar 4683e8: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Calling use-it() will never work with declared signature ($i)␤at <tmp>:1␤------> 3for ^10 { sub use-it { $^i * 2 }; say 7⏏5use-it() + $^i }␤»
11:46 timotimo m: for ^10 { sub use-it { $i * 2 }; say use-it() + $^i }
11:46 camelia rakudo-moar 4683e8: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Variable '$i' is not declared␤at <tmp>:1␤------> 3for ^10 { sub use-it { 7⏏5$i * 2 }; say use-it() + $^i }␤»
11:46 timotimo er, of course it has to be mentioned aerly
11:46 timotimo m: for ^10 { use-it() + $^i; sub use-it { $i * 2 }; }
11:46 camelia rakudo-moar 4683e8: OUTPUT: «WARNINGS for <tmp>:␤Useless use of "+" in expression "use-it() + $^i" in sink context (line 1)␤»
11:46 timotimo m: for ^10 { say use-it() + $^i; sub use-it { $i * 2 }; }
11:46 camelia rakudo-moar 4683e8: OUTPUT: «0␤3␤6␤9␤12␤15␤18␤21␤24␤27␤»
11:46 timotimo that's teh one that works
11:46 timotimo m: for ^10 { say use-it() + $^i; sub use-it { $^i * 2 }; }
11:46 camelia rakudo-moar 4683e8: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Calling use-it() will never work with declared signature ($i)␤at <tmp>:1␤------> 3for ^10 { say 7⏏5use-it() + $^i; sub use-it { $^i * 2 }; ␤»
11:46 timotimo that's the one that doesn't, because now use-it gets $^i applied to its own signature
11:49 Geth ¦ ecosystem: 870fd69713 | (Alexey Melezhik)++ | META.list
11:49 Geth ¦ ecosystem: Add Sparrowdo::Rvm
11:49 Geth ¦ ecosystem:
11:49 Geth ¦ ecosystem: Sparrowdo module to install RVM and Ruby - https://github.com/melezhik/perl6-sparrowdo-rvm
11:49 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/870fd69713
11:50 mscha m: for 1..10 { say $i + $^i; }
11:50 camelia rakudo-moar 4683e8: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Variable '$i' is not declared␤at <tmp>:1␤------> 3for 1..10 { say 7⏏5$i + $^i; }␤»
11:58 mscha m: my $i = 42; for ^5 { say ($i, $^i, $i) }
11:58 camelia rakudo-moar 4683e8: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤$i has already been used as a non-placeholder in the surrounding block,␤  so you will confuse the reader if you suddenly declare $^i here␤at <tmp>:1␤------> 3my $i = 42; for ^5 { say ($i, $^i7⏏5…»
11:59 mscha m: my $i = 42; for ^5 { say ($^i, $i) }
11:59 camelia rakudo-moar 4683e8: OUTPUT: «(0 0)␤(1 1)␤(2 2)␤(3 3)␤(4 4)␤»
11:59 mscha Shouldn't this give the same error?  ($i is used in the surrounding block.)
12:07 moritz the surrounding block is a different scope
12:07 moritz so no
12:07 lizmat well, it feels like a WAT to me  :-)
12:07 timotimo m: my $i = 42; for ^5 { my $i; say $i } # same thing
12:07 camelia rakudo-moar 4683e8: OUTPUT: «(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤»
12:08 moritz that's just how lexical scoping works.
12:08 lizmat agree, but this is not about scoping in my view, but on the visual difference between $i and $^i
12:08 lizmat I mean, we don't expect $i and $*I ever to be the same thing
12:09 lizmat neither do we expect $=i to be the same as $i, yet, with $^i this is suddenly the case
12:09 lizmat which is a WAT to me
12:09 timotimo should clearly be documented in any case
12:23 astj joined #perl6
12:31 Cabanossi joined #perl6
12:35 xtreak joined #perl6
12:39 abraxxa joined #perl6
12:55 movl joined #perl6
13:07 mcmillhj joined #perl6
13:13 perlpilot that $^i/$i confusion looks like the documentation should say something like "be careful with auto-declared vars in different scopes"  or maybe just "be careful with auto-declared vars"  :-)
13:15 perlpilot I mean, conceivably the same problem exists with $:x and :$x, just not as common.
13:17 lizmat m: { $:x; dd $x }(:666x)   # wow, TIL
13:17 camelia rakudo-moar f532f8: OUTPUT: «Int $x = 666␤»
13:18 lizmat perlpilot: yup, same WAT  :-)
13:24 lizmat having $^i and $:i just as a declaration, and not needing the sigils *later* in the block, feels very much action-at-a-distance to me
13:24 lizmat not all blocks are one liners, if your block is quite large, it will be easy to miss a $^i
13:25 lizmat m: my $i = 42; for ^10 { say $i + $^i }  # especially since this *is* caught
13:25 camelia rakudo-moar f532f8: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤$i has already been used as a non-placeholder in the surrounding block,␤  so you will confuse the reader if you suddenly declare $^i here␤at <tmp>:1␤------> 3my $i = 42; for ^10 { say $i + $^i7⏏…»
13:26 lizmat imo, the reader will *always* be confused when these are mixec
13:26 lizmat *mixed
13:27 spebern joined #perl6
13:38 pmurias joined #perl6
13:42 perlpilot lizmat: As a small note bolstering your point, when I first started using auto-declared parameters, I thought that's how they were supposed to be used (always with the twigil).  It wasn't until I'd been using them for a little while that I realized that $^i was only needed for the declaration and that $i could be used elsewhere.
13:47 lizmat m: class A { has $a; method a() { say $!a } }   # another confusable
13:47 camelia rakudo-moar f532f8: ( no output )
13:47 lizmat m: class A { has $!a; method a() { say $a } }   # reverse doesn't work
13:47 camelia rakudo-moar f532f8: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Variable '$a' is not declared. Did you mean '$!a'?␤at <tmp>:1␤------> 3class A { has $!a; method a() { say 7⏏5$a } }   # reverse doesn't work␤»
13:47 Cabanossi joined #perl6
13:53 skids joined #perl6
14:01 lucastiagodemora joined #perl6
14:02 timotimo right. i'm not sure why that feature is in there
14:07 lucastiagodemora joined #perl6
14:07 lucastiagodemora joined #perl6
14:08 kurahaupo joined #perl6
14:10 nine_ joined #perl6
14:11 Woodi_ joined #perl6
14:13 SmokeMachine joined #perl6
14:13 raschipi joined #perl6
14:13 chansen_ joined #perl6
14:15 sufrostico joined #perl6
14:17 parisba joined #perl6
14:17 PotatoGim joined #perl6
14:17 Juerd joined #perl6
14:23 Ulti are there any docs on the new way to do slangs?
14:23 Ulti I want to fix my tests >:3
14:25 * Ulti tagged all of his repos today
14:26 MasterDuke Ulti: not sure if there's documentation, but you could look at recent commits for the slangs that have already been fixed; e.g., Slang::Tuxic, Slang::Piersing
14:27 Ulti yeah that counts... use the source etc.
14:27 Ulti thanks
14:33 spebern joined #perl6
14:41 perlpilot new way to do slangs?
14:41 perlpilot Do you mean $*LANG.define_slang() or something else?
15:01 dh7320 joined #perl6
15:01 dh7320 joined #perl6
15:03 itaipu joined #perl6
15:06 Nefser joined #perl6
15:11 hoelzro Ulti: that's really weird - it looks to me like Docker is dropping the ball here
15:11 hoelzro I'll dig into it
15:12 hoelzro interesting - docker run -it rakudo-star perl6 -e 'say "Hello!"' works fine
15:14 hoelzro Ulti: ooc, where'd you get that example from?
15:22 astj joined #perl6
15:22 cdg joined #perl6
15:27 st_elmo joined #perl6
15:31 Cabanossi joined #perl6
15:35 duncan_dmg left #perl6
15:37 raschipi joined #perl6
15:46 wamba joined #perl6
15:50 sufrostico joined #perl6
16:05 rindolf joined #perl6
16:09 rurban joined #perl6
16:29 beginner joined #perl6
16:30 beginner hi
16:30 beginner I would like to write a method that will await for a variable to be set to true.
16:30 beginner psuedocode is like this : bool IsSomethingLoading = false SomeData TheData;  public async Task<SomeData> GetTheData() {    await IsSomethingLoading == true;    return TheData; }
16:31 beginner how to achieve this in perl6
16:31 raschipi beginner: use a channel
16:32 beginner could you detail it
16:32 raschipi Sorry, not a channel, a supply: https://docs.perl6.org/type/Supply
16:37 dh7320 joined #perl6
16:37 lizmat isn't this just a promise?
16:38 lizmat m: my $p = Promise.new; start { say now; sleep 5; say now; $p.keep }; $p.await; say "done"
16:38 camelia rakudo-moar 89b5d6: OUTPUT: «Instant:1491496756.903448␤No such method 'await' for invocant of type 'Promise'␤  in block <unit> at <tmp> line 1␤␤»
16:38 lizmat m: my $p = Promise.new; start { say now; sleep 5; say now; $p.keep }; await $p; say "done"
16:38 camelia rakudo-moar 89b5d6: OUTPUT: «Instant:1491496769.705420␤Instant:1491496774.711416␤done␤»
16:38 raschipi I understood he wanted that in a loop, passing multiple values. But if it's only once value, yes, returning a promise would do it.
16:39 domidumont joined #perl6
16:40 lizmat hmmm...
16:40 lizmat I think it can actually be shortened to:
16:42 lizmat my @promises = @targets.map: { start { $_.fetch } }; for @promises { .$result }
16:43 raschipi beginner: does it solve your problem?
16:43 raschipi Read this: https://docs.perl6.org/language/concurrency#Promises
16:44 beginner while it awaits i dont want the task to sleep.instead it should do some other process
16:45 b2gills Which is the whole point of Promise, Supply, and Channel
16:45 lizmat beginner: the sleep I put in there is just to simulate some load
16:45 lizmat you don't need that
16:46 lizmat the start block will schedule to run that code asynchronously
16:46 lizmat whenever it can
16:46 beginner cool...this would help then...Thanks
16:48 gfldex melezhik: looks like it's time to move most of META6::bin into a module
17:03 mcmillhj joined #perl6
17:07 lizmat m: say ^10 .pick(*)    # beginner
17:07 camelia rakudo-moar 507237: OUTPUT: «(4 0 7 3 8 6 1 9 5 2)␤»
17:07 lizmat m: await do for ^10 .pick(*) { start { sleep $_; .print } }   # sleep sort implementation
17:07 camelia rakudo-moar 507237: OUTPUT: «0123456789»
17:10 [Coke] m: await do for ^10 .pick(*) { start { sleep $_ * ⅓ ; .print }}
17:10 camelia rakudo-moar 507237: OUTPUT: «0123456789»
17:10 [Coke] m: await do for ^10 .pick(*) { start { sleep $_ * ⅓ * ⅓ * ⅓; .print }}
17:10 camelia rakudo-moar 507237: OUTPUT: «0123456789»
17:11 [Coke] m: await do for ^10 .pick(*) { start { sleep $_ * .0000001; .print }}
17:11 camelia rakudo-moar 03ef4b: OUTPUT: «5764310829»
17:11 [Coke] there we go. :)
17:14 Geth ¦ doc: b9e692e4da | (Zoffix Znet)++ | doc/Type/IO/Path.pod6
17:14 Geth ¦ doc: [io grant] Document new IO::Path.extension
17:14 Geth ¦ doc:
17:14 Geth ¦ doc: - Now has a means to specify the number of parts in the wanted extension
17:14 Geth ¦ doc: - Now has a means to replace an extension with a new one, optionally
17:14 Geth ¦ doc:     joining it to the filename with a non-'.' joiner
17:14 Geth ¦ doc:
17:14 Geth ¦ doc: Rakudo impl. https://github.com/rakudo/rakudo/commit/b1e7a01f87
17:14 Geth ¦ doc: Tests: https://github.com/perl6/roast/commit/b23e53eb79
17:14 Geth ¦ doc: review: https://github.com/perl6/doc/commit/b9e692e4da
17:15 st_elmo joined #perl6
17:20 espadrine joined #perl6
17:21 go|dfish joined #perl6
17:22 Alex____ joined #perl6
17:23 xtreak joined #perl6
17:38 xtreak joined #perl6
17:40 Geth ¦ doc: 34603f7f81 | (Zoffix Znet)++ | doc/Type/IO/Path.pod6
17:40 Geth ¦ doc: Reformat spacing in code example
17:40 Geth ¦ doc:
17:40 Geth ¦ doc: To make it a bit more readable and lines a bit shorter,
17:40 Geth ¦ doc: so they look saner on small screen devices
17:40 Geth ¦ doc: review: https://github.com/perl6/doc/commit/34603f7f81
17:41 timotimo META.info has been deprecated(?) for a bit now, right?
17:42 Geth ¦ doc/nom: d463181678 | (Zoffix Znet)++ | doc/Type/IO/Path.pod6
17:42 Geth ¦ doc/nom: Fix formatting
17:42 Geth ¦ doc/nom: review: https://github.com/perl6/doc/commit/d463181678
17:42 xtreak joined #perl6
17:44 Geth ¦ doc: zoffixznet++ created pull request #1267: Fix formatting
17:44 Geth ¦ doc: review: https://github.com/perl6/doc/pull/1267
17:44 Geth ¦ doc: d463181678 | (Zoffix Znet)++ | doc/Type/IO/Path.pod6
17:44 Geth ¦ doc: Fix formatting
17:44 Geth ¦ doc: review: https://github.com/perl6/doc/commit/d463181678
17:44 Geth ¦ doc: bfe3f5a4a9 | (Zoffix Znet)++ | doc/Type/IO/Path.pod6
17:44 Geth ¦ doc: Merge pull request #1267 from perl6/nom
17:44 Geth ¦ doc:
17:44 Geth ¦ doc: Fix formatting
17:44 Geth ¦ doc: review: https://github.com/perl6/doc/commit/bfe3f5a4a9
17:45 Geth ¦ doc: bc31a88429 | (Zoffix Znet)++ | doc/Type/IO/Path.pod6
17:45 Geth ¦ doc: Add missing invocant markers in sig
17:45 Geth ¦ doc: review: https://github.com/perl6/doc/commit/bc31a88429
17:45 raschipi joined #perl6
17:48 lostinfog joined #perl6
17:48 xtreak joined #perl6
17:48 robertle joined #perl6
17:49 setty1 joined #perl6
17:49 salva joined #perl6
17:56 rurban joined #perl6
17:59 andrzejku joined #perl6
18:00 mcmillhj joined #perl6
18:04 xtreak joined #perl6
18:05 rindolf joined #perl6
18:10 DrForr o/
18:11 raschipi \o
18:16 AlexDaniel joined #perl6
18:17 vike joined #perl6
18:30 RabidGravy boo!
18:30 DrForr Whah? :)
18:35 masak how much of a difference is there really between "undecidable" and "Turing complete"?
18:37 AlexDaniel one is a bot, another one isn't
18:38 geekosaur you can have undecidability without having Turing completeness, but you cannot have Turing completeness without undecidability.
18:38 beginner class A has method A...how to make asynchronous call from class B to method A
18:38 geekosaur ...but the systems that model the first tend to be /a priori/ useless
18:39 [Coke] masak: https://en.wikipedia.org/wiki/Turing_degree ?
18:39 masak geekosaur: right, but... anything below Turing complete at least has a shot to be decidable?
18:39 DrForr Isn't the former more of a consequence of Turing machines encompassing the Peano postulates?
18:39 perlpilot .oO(  I have a BS degree in Turing systems )
18:39 masak [Coke]: looks... interesting.
18:39 timotimo beginner: how do you mean "asynchronous"? like kick it off into the thread pool?
18:40 [Coke] async call: start { do stuff }
18:40 masak m: start say "OH HAI"
18:40 camelia rakudo-moar b1e7a0: ( no output )
18:40 masak huh :)
18:40 [Coke] m: await start say "oh hai"
18:40 camelia rakudo-moar b1e7a0: OUTPUT: «oh hai␤»
18:40 masak there we go
18:40 masak forgot to be patient :P
18:41 masak m: my $task = start say "OH HAI"; say "waiting"; await $task
18:41 camelia rakudo-moar b1e7a0: OUTPUT: «waiting␤OH HAI␤»
18:41 masak :)
18:42 [Coke] so, you declare the async when you call it, not when you declare it, if that helps.
18:42 raschipi m: my $task = start say "OH HAI"; say "waiting"; sleep 3; say "still waiting"; await $task
18:42 [Coke] You might want to check out jnthn's awesome sync-safe classes, also:
18:42 camelia rakudo-moar b1e7a0: OUTPUT: «waiting␤OH HAI␤still waiting␤»
18:42 [Coke] https://github.com/jnthn/oo-monitors
18:43 * DrForr briefly considers indent(1.5) to implement GNU's weird half-indent but thinks better of it.
18:43 RabidGravy though doesn't jnthn's OO::Actor do that
18:44 RabidGravy https://github.com/jnthn/oo-actors
18:44 beginner class A {     method run()     {     my $i = 0;     method generate()     {         i = 10.rand();         return i;     }     } }   class B{       method run()     {         my $b = False;         my $i = start {.generate()};         await $i;                  my $x = $i.result;         if $x < 10             {                 $b = True;             }     } }
18:44 [Coke] RabidGravy++
18:45 beginner is this correct?
18:46 beginner am getting error "No such method 'generate' for invocant of type 'Any'   in block <unit>"...what is the mistake
18:46 ChoHag joined #perl6
18:46 [Coke] maybe format it nicely and put it in a gist?
18:47 RabidGravy "  my $i = start {.generate()};"
18:47 geekosaur nothing in there says that you want an A
18:47 * DrForr finally has a real-world test of Perl6::Tidy :)
18:47 geekosaur so you get the default which is an Any
18:47 RabidGravy calls the method on $_
18:47 [Coke] DrForr: what does PT make of that?
18:48 DrForr Give me a few seconds :)
18:48 [Coke] kk
18:49 DrForr A syntax error :) } class B{..
18:49 DrForr Well, let me put this in a gist :)
18:49 beginner https://gist.github.com/anonymous/3fc0820fc8b7612ba42e7cc03ff446ee
18:50 DrForr https://gist.github.com/drforr/794bbe98deb2f4f1f2675979ed1d32b3
18:51 DrForr That. Rather pleasing actually.
18:51 DrForr (that's with default tab settings.)
18:52 [Coke] DrForr: ew. 8. :P
18:52 [Coke] DrForr: why did line 14 get broken?
18:52 [Coke] DrForr: Also, WOO, nifty! :)
18:53 DrForr 'my $b =\nFalse;', you mean?
18:54 [Coke] aye. is that preserving part of the original?
18:55 DrForr Preserving in the sense that I'm only changing the whitespace around the scope braces and semicolons, yes.
18:57 DrForr I haven't extended it beyond just those, at least for the moment. I wanted to get the looping structure right first.
18:59 lichtkind joined #perl6
18:59 beginner is someone looking onto my problem?
19:00 perlpilot beginner: in addition to what RabidGravy and geekosaur said ... if you're just going to immediately await the promise, you're not exactly being asynchronous.
19:00 perlpilot beginner: oh ... read what those two said above   :)
19:02 zakharyas joined #perl6
19:03 DrForr [Coke]: Thanks. There's actually quite a bit of work going on there.
19:03 beginner yes am aware awaiting immeditely after the promise makes no sense...the point is i need to know how to make a call to the method in another class
19:03 lichtkind so much fun
19:03 lichtkind today the prof said prolog is the only language that lets you define your operators
19:04 lichtkind you suspect what followed
19:05 DrForr I can give you a slide that lets you define Lagrange operators on the Higgs boson :)
19:06 lichtkind im sure prolog doent have that one
19:06 beginner could someone correct the code in https://gist.github.com/anonymous/3fc0820fc8b7612ba42e7cc03ff446ee
19:06 perlpilot beginner: you call it either A.generate()  or my $a = A.new;  $a.generate();
19:06 Geth ¦ doc: 66382a84ca | (Zoffix Znet)++ | doc/Type/IO/Path.pod6
19:06 Geth ¦ doc: Fix accidental use of working-name method in example
19:06 Geth ¦ doc: review: https://github.com/perl6/doc/commit/66382a84ca
19:07 perlpilot beginner: though, it does look like your generate method is *inside* the run method.  You probably don't want that.  :-)
19:08 perlpilot beginner: It looks like you want a state variable (one that retains its value between calls).   (And you'll want to add $ as appropriate.  you've got a couple of instance where you say i instead of $i)
19:08 nicq joined #perl6
19:11 beginner #perlpilot : understood these things...the basic qstn is how to start a asynchrnous call on method A in class A from Class B
19:12 [Coke] if you want to call a method in another class: A.class-method() or A.new.instance-method("an arg")
19:12 [Coke] so if you want that call to be async: use "start".
19:12 skids .oO(prolog-ing the inevitable?)
19:12 [Coke] If you're doing anything remotely complicated, check out OO:Monitors and OO:Actors
19:14 perlpilot beginner: and maybe have a look at http://jnthn.net/papers/2014-apw-objects-concurrency.pdf
19:14 beginner #coke , #perlpilot : Thanks
19:15 beginner and a very silly doubt...how to reply to a particular person in this chat
19:15 perlpilot beginner: usually like this :)
19:15 RabidGravy just use their name, most clients highlight :)
19:16 beginner Thank u guys
19:16 [Coke] np
19:16 perlpilot no worries.  That's what #perl6 is here for.
19:16 beginner As a beginner am getting enough help here
19:16 darthdeus left #perl6
19:17 Cabanossi joined #perl6
19:17 DrForr beginner: Cool! Where'd you find out about Perl 6?
19:19 Cabanossi joined #perl6
19:21 rrauenza joined #perl6
19:21 RabidGravy I'm having a brain fail, do multi native subs work?
19:21 pippo joined #perl6
19:22 masak beginner: welcome! we strive to be unceasingly helpful in here :)
19:22 pippo joined #perl6
19:22 masak (we fail sometimes. but we get up and try again.) :)
19:22 pippo o/ #perl6
19:22 RabidGravy I've spent all day being unusually helpful :)
19:23 Cabanossi joined #perl6
19:24 TEttinger joined #perl6
19:24 DrForr And there we go, tidying statements done in one helper method and adding two cursor move commands I'd forgotten about.
19:25 pippo Any body knows why is "my @a .= push: $_.split(';')».trim for $text.lines;" much slower than the equivalent "for $text.lines {…}" version ?
19:26 Cabanossi joined #perl6
19:26 khw joined #perl6
19:26 lizmat pippo: --profile is your friend
19:27 alphah joined #perl6
19:27 gfldex pippo: you don't need any for loop for what you are doing
19:28 pippo lizmat: I'll try that. Thank you.
19:28 pippo gfldex: How can I do that then?
19:29 DrForr I'd just use a map{} block.
19:29 gfldex m: my $text = "1;2;3\na;b ;c\n4;5;6 "; my @a = $text.lines».split(';')».trim; dd @a
19:29 camelia rakudo-moar b1e7a0: OUTPUT: «Array @a = [("1", "2", "3"), ("a", "b", "c"), ("4", "5", "6")]␤»
19:30 gfldex you may or may not want to have a .flat
19:30 gfldex (or a .Slip)
19:30 pippo gfldex: Nice. Thanks.
19:31 gfldex m: my $text = "1;2;3\na;b ;c\n4;5;6 "; my @a = $text.lines».split(';')».Slip».trim; dd @a
19:31 camelia rakudo-moar e9a307: OUTPUT: «Array @a = ["1", "2", "3", "a", "b", "c", "4", "5", "6"]␤»
19:32 TimToady pippo: why are you using .= there?
19:32 TimToady push doesn't work very well with .=
19:32 gfldex pippo: please note that ». is eager, a well places .map (maybe with a .race) may suit you better
19:33 TimToady maybe you want (my @a).push:
19:33 alphah Hello P6, I'm having issue with grammar, can't find the right regex, here is the code (more details in comments) https://gist.github.com/anonymous/e1f7618e05d68a2ce242c445641ff789
19:34 pippo TimToady: that is because I wanted to re-write my for block to fit in one line and and thought that they were equivalent in that they shoud generate the same code under the hood.
19:34 gfldex that's the peril of asking in #perl6. You may get more answers then you may like to. :->
19:35 pippo gfldex: There is more than one way… :-))
19:38 TimToady pippo: I think .= is likely to copy the array every time you push
19:38 TimToady push is already mutatational, so you don't need .= to make it doubly so
19:39 pippo TimToady: Understood. That is my error and why it is slower. Thank you!
19:39 TimToady s/tata/ta/
19:39 TimToady yer welcome!
19:39 perlpilot alphah: you almost have a good set of test cases in your comments.  You might want to turn them into *actual* test cases.
19:39 * gfldex .oO( Your word mutated, please lower radiation levels! )
19:40 pippo :-)
19:40 robertle how do i merge two hashes in a clean way?
19:40 perlpilot robertle: what does "merge" mean?
19:40 AlexDaniel m: my %a = <a 1 b 2>; my %b = <c 3 d 4>; %a.push(%b); say %a
19:40 camelia rakudo-moar e9a307: OUTPUT: «{a => 1, b => 2, c => 3, d => 4}␤»
19:41 AlexDaniel robertle: something like this? ↑
19:41 gfldex robertle: see https://docs.perl6.org/type/Hash#method_append
19:41 rurban joined #perl6
19:41 TimToady I guess tata is in fact a valid base sequence
19:41 TimToady ttaggg &
19:41 alphah perlpilot: I'm not sure if I understand what youo mean, do you mean to create tests like the tests placed in "t" directory in perl projects? if so I dont think I can do this now, I haven't learned this yet
19:42 robertle yes, something like that. I was trying append and push, but failed. I guess because mine are not actual hashes but hash refs? not sure. lie my $a = {a => 1, b => 2}
19:42 AlexDaniel m: my $a = %<a 1 b 2>; my %b = <c 3 d 4>; $a.push(%b); say $a
19:42 camelia rakudo-moar e9a307: OUTPUT: «Use of Nil in string context␤  in block <unit> at <tmp> line 1␤Use of Nil in string context␤  in block <unit> at <tmp> line 1␤{ => (Any), c => 3, d => 4}␤»
19:42 AlexDaniel ooops…
19:43 AlexDaniel m: my $a = %(<a 1 b 2>); my %b = <c 3 d 4>; $a.push(%b); say $a
19:43 camelia rakudo-moar e9a307: OUTPUT: «{a => 1, b => 2, c => 3, d => 4}␤»
19:43 AlexDaniel robertle: it should work anyway. What happens if you do 「say WHAT $a」?
19:43 perlpilot alphah: yes, essentially.  It's not that hard ... give a couple of minutes and I'll get you started.
19:44 alphah Sure thanks
19:44 robertle (Hash)
19:44 dalek joined #perl6
19:44 RabidGravy m: my %a = a => 1, b => 2; my %b = c => 3, d => 4; my %c = |%a, |%b; dd %c
19:44 camelia rakudo-moar e9a307: OUTPUT: «Hash %c = {:a(1), :b(2), :c(3), :d(4)}␤»
19:44 AlexDaniel robertle: so that's a hash, should not be a problem
19:45 raschipi Maybe it's itmized?
19:45 raschipi itemized*
19:45 robertle AlexDaniel: this version combines the values for the same key into an array, is there a way to overwrite it instead?
19:47 AlexDaniel robertle: see what RabidGravy said above ↑
19:47 AlexDaniel robertle: his version seems to do exactly that
19:49 ChoHag joined #perl6
19:51 robertle totally, that is what I was after! actually I am after a whole array of hashes, planning to use reduce and this...
19:51 dwarring joined #perl6
19:52 robertle there is always another new operator to discover...
19:52 AlexDaniel robertle: which one is it in this case? :)
19:52 robertle well the prefix flatten to argument list from RabidGravy
19:52 gfldex melezhik: META6::bin has been modulified, see https://github.com/gfldex/perl6-meta6-bin/blob/master/example/use-as-a-module.p6
19:53 AlexDaniel right
19:53 robertle or rather to slip
19:55 perlpilot alphah: https://gist.github.com/perlpilot/67fd0b46d0d07500fab37e6ba942d5ac
19:55 robertle eh, I don't think I really understand what a slip *is*
19:56 alphah perlpilot: checking...
19:57 perlpilot alphah: I didn't really put the valid arch or whatnot in the strings, but if you do that, you should see some of those test start to pass.
19:58 perlpilot maybe.  I didn't really look at the output :)
19:58 alphah perlpilot: yes I'm putting valid values and trying that
19:59 AlexDaniel robertle: is it even needed in this case?
19:59 AlexDaniel m: my %a = a => 1, b => 2; my %b = c => 3, d => 4; my %c = |%a, |%b; dd %c
19:59 camelia rakudo-moar 6377d9: OUTPUT: «Hash %c = {:a(1), :b(2), :c(3), :d(4)}␤»
19:59 AlexDaniel m: my %a = a => 1, b => 2; my %b = c => 3, d => 4; my %c = %a, %b; dd %c
19:59 camelia rakudo-moar 6377d9: OUTPUT: «Hash %c = {:a(1), :b(2), :c(3), :d(4)}␤»
19:59 AlexDaniel m: my %a = a => 1, c => 2; my %b = c => 3, d => 4; my %c = %a, %b; dd %c
19:59 camelia rakudo-moar 6377d9: OUTPUT: «Hash %c = {:a(1), :c(3), :d(4)}␤»
19:59 perlpilot alphah: anyway, that doesn't help you with your *actual* problems in the grammar, but it does give you a more structured way to test it.
20:00 alphah yes I wish I knew that sometime earlier, I was doing all tests manually
20:01 robertle AlexDaniel: right! I somehow thought I had tried *that*, it's quite perl5-ish!
20:01 AlexDaniel robertle: trying to find a ticket for that, by the way…
20:03 AlexDaniel robertle: although maybe there's none
20:03 perlpilot alphah: A suggestion though ... rather than having all of those optional elements in the TOP token, maybe enumerate all of the valid parses in an alternation.
20:03 AlexDaniel I recall somebody complaining about %x = %y, %z
20:03 perlpilot alphah: or maybe not *all*, but at least the ones where there's some ordering restriction.
20:04 AlexDaniel robertle: the reason why some may prefer to write it in perl 6 like |%a, |%b is here:
20:04 AlexDaniel m: my @a = <a b c>; my @b = <1 2 3>; my @c = @a, @b; say @c
20:04 camelia rakudo-moar 6377d9: OUTPUT: «[[a b c] [1 2 3]]␤»
20:05 * perlpilot goes back to work  &
20:05 AlexDaniel robertle: so if you say that @c is @a and @b, you just get an array with two elements
20:05 hobbs AlexDaniel: simple as do re mi?
20:05 AlexDaniel robertle: right! So let's say you don't want that, what can you do?
20:05 AlexDaniel and this is where you might need slip
20:06 AlexDaniel m: my @a = <a b c>; my @b = <1 2 3>; my @c = |@a, |@b; say @c
20:06 camelia rakudo-moar 6377d9: OUTPUT: «[a b c 1 2 3]␤»
20:06 alphah perlpilot: I can try that as well, However, I tried to understand why look-around assertion work sometimes and other times not,, for example in my code look-around assertions faills for token "arch"
20:06 AlexDaniel now, let's say you have the same thing with hashes
20:07 AlexDaniel I'd expect it to create a hash with one pair (%a => %b), even if it doesn't really make sense
20:07 AlexDaniel m: my %a = <a b c d>; my %b = <1 2 3 4>; my %c = %a, %b; say %c
20:07 camelia rakudo-moar 6377d9: OUTPUT: «{1 => 2, 3 => 4, a => b, c => d}␤»
20:07 AlexDaniel but no!
20:08 Cabanossi joined #perl6
20:09 robertle AlexDaniel: I am confused now, but I see where you are going...
20:09 JAP{Necro}H joined #perl6
20:10 JAP{Necro}H hi
20:10 AlexDaniel robertle: I was just trying to explain what | does and why you might need it, and why RabidGravy used it even though it is not required in this particular case
20:10 AlexDaniel JAP{Necro}H: hello!
20:10 AlexDaniel robertle: sorry if it made things more confusing :)
20:11 robertle it is actually helpful, but I need some playing around to digest it...
20:11 JAP{Necro}H I have problems with panda, u can help me?
20:11 robertle thanks!
20:11 labster joined #perl6
20:12 raschipi JAP{Necro}H: Panda is deprecated, have you tried zef?
20:12 noganex_ joined #perl6
20:12 AlexDaniel robertle: I've actually found a ticket where this was discussed: https://rt.perl.org/Ticket/Display.html?id=130870
20:12 JAP{Necro}H how install zef?
20:13 samcv if panda works you can do `panda install zef`
20:13 samcv but if it's totally broken
20:13 AlexDaniel robertle: Zoffix writes: “If we swap hashes for arrays, then you *don't* mean the contents. You get a self-referential structure … … I'm surprised you don't get the same with hashes. If you give a comma-separated list of stuff, it becomes key-value pairs; yet hashes get special treatment in that regard”
20:13 samcv then you'll have to install it manually or something. how did you install panda?
20:13 pippo gfldex: I ended up using your suggestion: "my @a = $text.lines».split(';')».trim". Thank you.
20:15 JAP{Necro}H panda install zef ==> Fetching zef ==> Building zef ==> Testing zef t/00-load.t ........... ok t/identity.t .......... ok t/utils-filesystem.t .. ok All tests successful. Files=3, Tests=14, 31 wallclock secs ( 0.06 usr  0.00 sys + 29.91 cusr  1.54 csys = 31.51 CPU) Result: PASS ==> Installing zef ==> Successfully installed zef
20:15 JAP{Necro}H but `zef` not work
20:16 RabidGravy the place it installed it may not be in your path
20:16 Zoffix joined #perl6
20:17 Zoffix JAP{Necro}H: are you using rakudobrew?
20:17 itaipu joined #perl6
20:18 dwarring r: class Test { constant X = set < x y >; }
20:18 camelia rakudo-moar 6377d9, rakudo-jvm fb4f16: ( no output )
20:19 Zoffix AlexDaniel: fwiw, lizmat++'s fixes to the hash thing also fixed my %h .= push: *bunch of pairs* construct, I believe, so there may be a deeper reason for specialized behaviour
20:19 JAP{Necro}H Zoffix, yeap, rakudo
20:19 * dwarring ...
20:19 Zoffix JAP{Necro}H: erm, rakudo is not same as rakudobrew :/
20:19 Zoffix JAP{Necro}H: run rakudobrew rehash
20:20 cdg joined #perl6
20:20 AlexDaniel Zoffix: quite possibly. But as a user, I find it a bit inconsistent and weird
20:20 JAP{Necro}H rakudobrew, yes
20:20 JAP{Necro}H i used rakudobrew
20:21 Zoffix JAP{Necro}H: run rakudobrew rehash
20:21 gdonald joined #perl6
20:21 AlexDaniel Zoffix: anyway, given that nobody will ever actually need (%a => %b), I don't think it is worth a ticket
20:21 imcsk8 joined #perl6
20:21 gfldex lolibloggedagain: https://gfldex.wordpress.com/2017/04/06/module-all-the-things/
20:22 Zoffix JAP{Necro}H: you're supposed to run that after installing any binaries, of which zef is one. In the future, don't install panda, run rakudobrew build-zef to install zef instead
20:22 JAP{Necro}H Zoffix: its how?
20:22 Zoffix JAP{Necro}H: type in your terminal:    rakudobrew rehash
20:22 Zoffix JAP{Necro}H: it updates the shims for binaries
20:22 JAP{Necro}H Updating shims
20:23 Zoffix JAP{Necro}H: OK. Noe zef works
20:23 Zoffix *now
20:23 JAP{Necro}H yes. works! 10q
20:23 Zoffix Sweet!
20:23 * Zoffix flies away into the sunset
20:23 Zoffix left #perl6
20:24 raschipi JAP{Necro}H: did you understand the instructions to avoid this happening in the future again?
20:24 JAP{Necro}H i can removed panda is now?
20:25 raschipi Keep it for a while to test zef
20:25 DrForr JAP{Necro}H: Or just not use it.
20:26 JAP{Necro}H for panda have a command: `panda installdeps .` for zef this command too works?
20:27 JAP{Necro}H or analog please
20:27 RabidGravy zef install --depsonly
20:28 lizmat m: my %h = a => 42; dd %h => %h  # AlexDaniel: this seems to work ?
20:28 camelia rakudo-moar 6377d9: OUTPUT: «({:a(42)}) => {:a(42)}␤»
20:29 Actualeyes joined #perl6
20:29 JAP{Necro}H RabidGravy: output: Usage:   /root/.rakudobrew/bin/../moar-nom/install/share/perl6/site/bin/zef [--force] fetch [<identities> ...] -- Download specific distributions   /root/.rakudobrew/bin/../moar-nom/install/share/perl6/site/bin/zef [--force] test [<paths> ...] -- Run tests   /root/.rakudobrew/bin/../moar-nom/install/share/perl6/site/bin/zef [--force] build [<paths> ...] -- Run Build.pm   /root/.rakudobrew/bin/../moar-nom/inst
20:29 AlexDaniel lizmat: what do you mean by “work”? :)
20:29 AlexDaniel lizmat: you can create a pair like that, sure
20:30 lizmat well, does what I expected it to ?
20:30 AlexDaniel lizmat: well, the biggest point there was that this:
20:30 AlexDaniel m: m: my @a = <a b c>; my @b = <1 2 3>; my @c = @a, @b; say @c
20:30 camelia rakudo-moar 6377d9: OUTPUT: «[[a b c] [1 2 3]]␤»
20:30 RabidGravy JAP{Necro}H, well you need to supply a module name or path
20:30 AlexDaniel m: my %a = <a b c d>; my %b = <1 2 3 4>; my %c = %a, %b; say %c
20:30 camelia rakudo-moar 6377d9: OUTPUT: «{1 => 2, 3 => 4, a => b, c => d}␤»
20:31 AlexDaniel lizmat: and this ↑ is not really consistent
20:31 lizmat ah, that
20:31 AlexDaniel lizmat: so for hashes, %c = |%a, |%b and %c = %a, %b work identically
20:31 AlexDaniel lizmat: but not for arrays
20:32 lizmat I guess that's one for TimToady
20:32 lizmat I could argue either way
20:32 AlexDaniel lizmat: that said, hash keys are strings anyway, right? So nobody will ever need %c = %a, %b to behave like that anyway
20:32 lizmat hash keys can be any object in object hashes
20:33 AlexDaniel oh right, right
20:33 AlexDaniel right… then I don't know
20:34 AlexDaniel m: my %a = <a b c d>; my %b = <1 2 3 4>; my %c{Hash} = %a => %b; say %c
20:34 camelia rakudo-moar 605e9e: OUTPUT: «{{a => b, c => d} => {1 => 2, 3 => 4}}␤»
20:34 AlexDaniel m: my %a = <a b c d>; my %b = <1 2 3 4>; my %c{Hash} = %a, %b; say %c
20:34 camelia rakudo-moar 605e9e: OUTPUT: «Type check failed in binding to parameter 'key'; expected Hash but got Str ("a")␤  in block <unit> at <tmp> line 1␤␤»
20:35 lizmat yeah, that's because of the implicit flattening
20:35 lizmat m: my %a = <a b c d>; my %b = <1 2 3 4>; my %c{Hash} = $%a, $%b; say %c
20:35 camelia rakudo-moar 605e9e: OUTPUT: «{{a => b, c => d} => {1 => 2, 3 => 4}}␤»
20:36 JAP{Necro}H RabidGravy: this is good? or ... https://pastebin.com/YfwkEs2C
20:37 JAP{Necro}H I want install LWP:Simple
20:38 RabidGravy well that's "good", the test is failing
20:40 RabidGravy but wfm here
20:42 JAP{Necro}H RapidGravy: how I can fix it?
20:44 RabidGravy I'd suggest trying again,  the test doesn't fail for me
20:45 JAP{Necro}H maybe removed rakudobrew and reinstall again?
20:45 RabidGravy nothing to do with it
20:46 AlexDaniel lizmat: meh… I don't know. I created a ticket anyway: RT #131111
20:46 lizmat AlexDaniel++
20:46 AlexDaniel ( https://rt.perl.org/Ticket/Display.html?id=131111 )
20:50 duncan_dmg joined #perl6
21:01 bjz joined #perl6
21:02 aindilis joined #perl6
21:08 gfldex I have a Hash like {"general.timeout" => "60", "helper.git" => "git"} and want to break that into a multidim Hash that allows %h{'general';'timeout'}. Any simple way to do that?
21:12 pippo left #perl6
21:13 gfldex might be a usecase for a semilist slippy. Sadly those are NYI.
21:14 gfldex m: my %h{||<general timeout>} = 60;
21:14 camelia rakudo-moar 605e9e: OUTPUT: «Odd number of elements found where hash initializer expected:␤Only saw: 60␤  in block <unit> at <tmp> line 1␤␤»
21:14 gfldex m: my %h; %h{||<general timeout>} = 60; dd %h;
21:14 camelia rakudo-moar 605e9e: OUTPUT: «Hash %h = {:general(60), :timeout(Any)}␤»
21:17 pippo joined #perl6
21:20 sufrostico joined #perl6
21:23 AlexDaniel m: my %z; my $x = a => (b => 42); %z{$x} = 42; dd %z
21:23 camelia rakudo-moar 605e9e: OUTPUT: «Hash %z = {"a\tb\t42" => 42}␤»
21:23 AlexDaniel why is it like this
21:23 AlexDaniel m: my %z; my $x = (a => ‘b’) => 42; %z{$x} = 42; dd %z
21:23 camelia rakudo-moar 605e9e: OUTPUT: «Hash %z = {"a\tb\t42" => 42}␤»
21:23 AlexDaniel O_o
21:23 gfldex m: my %h; %h<general.timeout> = 60; dd %h; dd do for %h.kv -> $k, $v { ([=>] $k.split('.')) => $v; };
21:23 camelia rakudo-moar 605e9e: OUTPUT: «Hash %h = {"general.timeout" => 60}␤((:general("timeout")) => 60,)␤»
21:24 gfldex Perl 6++
21:24 AlexDaniel gfldex: wait, what's ++ about it here?
21:28 lizmat sometimes I wish we could do @a.head(*-1)
21:28 gfldex AlexDaniel: mostly that I can do [=>] to avoid recursion
21:28 lizmat as in: iterate over all elements but the last
21:28 dh7320 joined #perl6
21:30 AlexDaniel lizmat: as in @a[^(*-1)] ?
21:34 lizmat AlexDaniel: yup
21:34 AlexDaniel lizmat: that'd be more readable indeed
21:36 JAP{Necro}H all good, all works. thank alls
21:38 astj joined #perl6
21:47 bjz joined #perl6
21:48 rurban joined #perl6
21:48 samcv trialing something to make normal string indexing 2.2x faster
21:49 samcv well it works. but only availible on systems with glibc. so gonna keep it in my own branch until it is all sorted out
21:49 samcv fun stuff
21:53 El_Che lizmat has speed-it-up! followers :)
21:53 lizmat whee!
21:53 lizmat :-)
21:57 samcv faster faster faster
21:58 El_Che :)
22:08 cpage_ joined #perl6
22:10 beginner joined #perl6
22:11 gdonald joined #perl6
22:14 lucastiagodemora joined #perl6
22:17 gfldex m: my @a = 1,2,3; my %h; %h.push :{ ([=>] @a) => 42 }; dd %h;
22:17 camelia rakudo-moar 0fc375: OUTPUT: «===SORRY!===␤Cannot find method 'has_compile_time_value' on object of type NQPMu␤»
22:17 gfldex m: my @a = 1,2,3; my %h; %h.push: :{ ([=>] @a) => 42 }; dd %h;
22:17 camelia rakudo-moar 0fc375: OUTPUT: «Hash %h = {"1\t2\t3" => 42}␤»
22:18 beginner joined #perl6
22:19 user6 joined #perl6
22:19 user6 how to do await over an boolean variable
22:21 timotimo you mean wait for a variable's value to be changed?
22:22 user6 yes
22:24 timotimo either you poll it as often as you'd like, for example once a second or a hundred times a second
22:24 skids joined #perl6
22:24 timotimo or you put in something that'll signal when it changes
22:24 timotimo i wouldn't do either of those things and just use a promise instead if you can
22:24 hobbs joined #perl6
22:24 hobbs joined #perl6
22:25 samcv ^
22:26 agentzh_ joined #perl6
22:31 user6 timotimo can u give an short example.my scenario is something like this https://gist.github.com/anonymous/89a26076f71941daf67eb939a8690d42
22:35 lizmat AlexDaniel: will have a working .tail(*-N) by tomorrow
22:36 bjz joined #perl6
22:38 lizmat still thinking on how to work the Array.tail and List.tail cases into this picture
22:38 timotimo oh, you'll want semaphores for that
22:38 lizmat but the basic iterator is there now
22:39 timotimo https://github.com/jnthn/oo-monitors - but you can use this, it'll give you what you want, i think
22:39 lizmat good night, #perl6!
22:39 timotimo user6: you'll want the "condition variable" part of that module
22:42 user6 timotimo will look into it
22:42 timotimo i'll go to bed. good luck!
22:53 bjz joined #perl6
23:10 kurahaupo joined #perl6
23:20 ChoHag joined #perl6
23:22 BenGoldberg joined #perl6
23:28 AndyDee joined #perl6
23:36 bjz joined #perl6
23:41 sammers joined #perl6
23:47 kurahaupo_ joined #perl6
23:47 imcsk8 joined #perl6
23:54 BenGoldberg u-ou, Just in case noone answered between last night and today, yes, sleep() is thread-safe... *however* it causes the OS-level thread to actually go to sleep, which is not always what you want.
23:57 BenGoldberg You are recommended to use: await Promise.in($seconds) instead, as this tells perl6's scheduler to suspend just the current task, and either gives the current OS-level another task or puts it into the thread pool.

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo