🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). Log available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 6 September 2022.
SmokeMachine Would someone like to proofread a new post? 01:18
SmokeMachine dev.to/fco/redeventstore-32gh-temp-slug-9138685 01:19
SmokeMachine weekly: dev.to/fco/redeventstore-3o9o 01:25
notable6 SmokeMachine, Noted! (weekly)
librasteve SmokeMachine: I have proof read your post … looks good to me. 12:33
melezhik. . 12:54
SmokeMachine librasteve: thanks 14:17
melezhik. Looks good for me either 14:22
lizmat weekly: www.lastdodo.com/en/items/11047443...-butterfly 15:51
notable6 lizmat, Noted! (weekly)
SmokeMachine dev.to/fco/redeventstore-3o9o 18:05
tbrowder librasteve showed me how to get a list of M random elements from a set of N elements. is there some clever way to make that "random" list repeatable? maybe by restting srand? 21:01
*resetting
yes, srand is the key 21:04
librasteve m: srand(1234); say (^100).pick(4); 21:08
evalable6 (75 31 47 90)
Raku eval (3 70 69 96)
librasteve m: srand(1234); say (^100).pick(4);
Raku eval (3 70 69 96)
evalable6 (75 31 47 90)
librasteve you had it on the nail
tbrowder thanks! that's what i need fer sure 21:11
hm, when i use it in a loop, it does weird things. first val is diff, but later ones are the same. still experimenting... 21:24
let's see if i can demo... 21:31
trimmimg down my use case... 21:36
back in a bit... 21:37
m: my $n = 10; my @u = 1..5; for 0..2 { say(srand(5); @u.roll($n)) } 21:48
camelia (5)((2 4 2 1 5 3 5 3 1 1))
(5)((5 4 3 1 4 4 4 3 4 3))
(5)((5 4 3 1 4 4 4 3 4 3))
tbrowder weird ^^ see first is diff, others the same 21:49
[Coke] I believe that's an issue with roll. 21:52
m: my $n = 10; my @u = 1..5; for 0..2 { say(srand(5); say 10.rand }
camelia ===SORRY!=== Error while compiling <tmp>
Unable to parse expression in argument list; couldn't find final ')' (corresponding starter was at line 1)
at <tmp>:1
------> 5; for 0..2 { say(srand(5); say 10.rand <HERE>}
expecting any of:
[Coke] m: my $n = 10; my @u = 1..5; for 0..2 { say(srand(5); 10.rand) } 21:53
camelia (5)(1.9862253286493636)
(5)(6.761485947582429)
(5)(6.761485947582429)
[Coke] m: BEGIN srand(5); my $n = 10; my @u = 1..5; for 0..2 { say(srand(5); 10.rand) }
camelia (5)(6.761485947582429)
(5)(6.761485947582429)
(5)(6.761485947582429)
tbrowder i can just ignore the first, but the algo must be wrong somehow. coke i tried using rand an got same results
[Coke] But BEGIN to present the srand and roll was still giving different answers on the first roll through.
"preset" 21:54
tbrowder obviously i didn't use rand correctly
tbrowder so, an issue? 21:55
did you try INIT block 21:56
[Coke] only tried the BEGIN (which still had the wrong answer) and then the rand - which with begin worked. 21:57
You shouldn't need a BEGIN, and I don't see anything obvious in 'method roll' in List that would cause that. 21:58
I don't think your code is wrong, smells like a bug
tbrowder INIT didn't work either
tbrowder i'm pretty sure i've use srand before with success, maybe in roast. 21:59
but probably not with roll... 22:00
Guest60 Long time perl user. New project, like to use Raku.  Require the ability to compile distributable AMD64 binaries for window 10/11.  Have a test OO project built. Can somebody refer me to a good reference for making binaries? 22:01
[Coke] I'm not sure such a reference exists. 22:02
tbrowder: I tried removing the BEGIN and using MVM_DISABLE_JIT and MVM_DISABLE_SPESH with no help 22:03
er, SPESH_DISABLE and and JIT_DISABLE
tbrowder Guest60: such a project sounds like a good thing to spread raku to windows ppl! 22:11
Guest60 tbrowder: It was always a big hurdle for perl. XS was no fun. I just want UI and math to both be easy in one language, and to not have to support OS level dependency hell issues post-install. I was kinda hoping that was the direction that Raku was going in when I saw nativecall(). 22:28
lizmat I understand patrickb has been working on Windows executables for scripts 22:53
[Coke] nativecall is for calling out to C, not for bundling into an executable. 23:10
so if you already have some C that is buildable on your target platform, you can install rakudo and have some raku code that calls out to it. 23:11