23 Sep 2023
habere-et-disper github.com/habere-et-dispertire/sc...patch.raku 13:08
lizmat it takes the first with the if-clause matching 13:11
so if you change the order of the candidates, you should be fine 13:12
habere-et-disper That's the issue. I'm trying a declarative programming approach and I don't want the order to matter. 13:16
nemokosch That's not the only issue really 13:17
The resolution order seems to be obscure and underspecified 13:18
lizmat gist.github.com/lizmat/d63d0ed8e4c...37fa0a6813 13:29
habere-et-disper ^^
habere-et-disper Wow, thanks. (y) So if I grok this now then as long as the predicates are mutually exclusive we can forgo candidate order. 13:41
lizmat yup
otherwise order becomes meaningful
habere-et-disper Lesson learnt. Merci !
kdon hello, i would like learn what can be done with raku languaje 22:01
lakmatiol string processing of most kinds can be expressed really nicely. 23:04
24 Sep 2023
antononcube Raku's string processing nicely completes (or integrates with) Large Language Model (LLM) workflows. 01:13
snonux I like to use Raku for small command line utilities and also for one-off-quick-n-dirty-getting-things-done-scripts. Not to say that Raku can also be used for larger applications, but I personally didn't do that (yet). 12:40
scullucs m: my $b = Blob.new(1, 2, 3); say $b.WHAT; say "{$b.WHAT}" # Why does the interpolated one fail? 14:44
Raku eval (Blob) Use of uninitialized value of type Blob in string context. Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful. in block <unit> at main.raku line 1
lizmat m: my $b = Blob.new(1, 2, 3); say $b.WHAT; say "{$b.WHAT.gist}" 15:33
camelia (Blob)
(Blob)
lizmat scullucs: interpolation calls .Str on the expression, say calls .gist on the expression
lucs lizmat: Hmm... Okay, thanks. 15:39
25 Sep 2023
lizmat and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2023/09/25/2023-...eleaseses/ 12:01
habere-et-disper We can repeat a string or a list with "x" or "xx". How do we repeat a statement ? Just use postfix "for" ? 22:41
26 Sep 2023
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
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
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.
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
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