This channel is intended for people just starting with the Raku Programming Language (raku.org). Logs are available at irclogs.raku.org/raku-beginner/live.html
Set by lizmat on 8 June 2022.
00:00 Manifest0 left
nemokosch this is not Ruby 😄 00:00
but actually xx thunks
so it will execute an expression as many times
m: rand() xx 5 andthen .say
Raku eval Exit code: 1 ===SORRY!=== Error while compiling /home/glot/main.raku Unsupported use of rand(). In Raku please use: rand. at /home/glot/main.raku:1 ------> rand⏏() xx 5 andthen .say
nemokosch whatever the reason is 00:01
m: rand xx 5 andthen .say
Raku eval (0.07748747360451047 0.20944011451510647 0.01756085583672984 0.2818930280640839 0.8926975957918685)
habere-et-disper Thanks -- I did not know this! :) 00:22
00:27 habere-et-disper left 00:42 deoac left, deoac joined
scullucs Depending on what one wants, the postfix "for" could be used: 01:30
m: say rand for ^5 01:31
Raku eval 0.01588992650039478 0.10993101459121768 0.9211074470407651 0.5906401564736695 0.8195997194915032
02:00 deoac left
rcmlz Is it possible to test for Constrains? #!/usr/bin/env raku subset Allowed-Returns of UInt where * ∈ 1..10; sub some-function(Int $a where * mod 2, UInt $b where { ($a + $b) mod 2 }, --> Allowed-Returns ) { $a + $b } use Test; dies-ok some-function(2,7); I tried dies-ok, thrws-like and it does not work. gist.github.com/rcmlz/e4532b0c80f1...30b69a0470 Thank 08:09
you.
08:15 dakkar joined, Manifest0 joined
Nahita hi, dies-ok et al. takes a code block to call for you, you shouldn't already call it 08:37
like dies-ok { f() }
also there is the %% operator for even disibility, so maybe * !%% 2 is clearer than * mod 2 08:38
so in your case it tries to call what the call some-function(...) returned; albeit since some-function(...) errs, it doesn't reach the dies-ok at all 08:39
rcmlz Thank you @Nahita - I did not read the documentation carefully enough. Now it works like a charm! Very nice feature! 08:56
12:11 jgaz joined 16:35 dakkar left 20:12 stanrifkin joined
stanrifkin Is there an overview of the new features of v6.e? 20:18
nemokosch this is a good question. I don't think there is an explicit compiled list - it's not yet released, for what it's worth, and I wouldn't say there is a final vision of what it will contain 20:21
stanrifkin thank you 20:22
nemokosch there are some changes in the core, that's the simpler part and that could really be collected. Some of these are kind of "bug fixes". 20:24
better complex support for certain math operations, the new snip method for cutting a list/sequence, the snitch method for conveniently executing a callback on a value while returning it nevertheless to allow for chaining... supposedly there should be value type lists and maps but I cannot see that one yet 20:27
nested slices coming from arrays... 20:28
either way, the big one is RakuAST which is the main focus of the whole v6.e 20:29
basically a high-level in-language representation of Raku code that supposedly compiler frontends could produce and compiler backends could consume 20:30
this should make user-space code generation much simpler and more efficient 20:31
stanrifkin found here something raku-advent.blog/2021/12/25/future...-language/ 20:32
21:13 habere-et-disper joined 21:43 habere-et-disper left 22:07 stanrifkin left 22:54 MasterDuke left 23:44 hexology- left 23:45 hexology joined