🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). This channel is logged for the purpose of keeping a history about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Log inspection is getting closer to beta. If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 25 August 2021.
xinming releasable6: status 05:41
releasable6 xinming, Next release in ≈1 day and ≈13 hours. There are no known blockers. Changelog for this release was not started yet
xinming, Details: gist.github.com/979bb3007e0eac8714...93f6373636
SmokeMachine I was wondering about the assuming issue... would it make any sense to make something like this: `my &func = -> $a -> $b, $c -> $d { "$a $b $c $d" }` be equivalent to `my &func = -> $a { -> $b, $c { -> $d { "$a $b $c $d" } } }` and make the `[]` post circunfix operator on Callable work like getting as many arguments as the function expects from the list and passing the rest for the returning function? like: `fun[1, 2, 3, 4]` would 08:17
be equivalent to `fun(1).(2, 3).(4)`. Would that make any sense?
xinming SmokeMachine: I personally would think it's a good api call. :-) 09:26
`fun(1).assuming(3,4).()` <--- This to me will be more clear example. 09:27
something like, admin-task-for-user($user-id).assuming('add-credit', 3).(); 09:28
my &add-user-credit = admin-task-for-user($user-id).assuming('add-credit'); add-user-credit(3); 09:29
just illustration
CIAvash SmokeMachine: well, the `func[1,2,3,4]` part would not be compatible with the language I think, because `[1,2,3,4]` gets called on the return value of `func`. 09:30
SmokeMachine CIAvash: I meant a new multi for .[]... but it could be any postcircunfix operator... 09:31
CIAvash That would be confusing, and against the rule of different operators for different things. 09:32
CIAvash But maybe Raku functions could act like in Haskell? I don't know if it is possible or how complicated it is(considering multi dispatch), otherwise they wouldn't add the `assuming` method if they could do it, I don't know. 09:40
Also there is no need for dots in function call, `func(1)(2,3)(4)` 09:41
Altreus I had to read to the end of that to remember the dot was not concatenation 09:49
:O
grondilu while developping a module raku seems to keep using the precomp version and ignore my changes in the source code. What am I doing wrong?
I do 'raku -Ilib t/test.t' to test 09:50
and yes I did save the changes on disk beforehand.
CIAvash Also signatures in Raku are more complicated, there are optional arguments, named arguments, captures, ... 09:53
lizmat grondilu: what does the use statements inside test.t say ?
*do
grondilu just use Test; use MyModule::Path; 09:55
SmokeMachine CIAvash: but that would work as well, wouldn't it? `-> $a? -> *@b -> :$c {...}` being equivalente to `-> $a? { -> *@b { -> :$c {...} } }` right?
(I'm talking more on how to create the function returning functions than the way to call it...) 09:56
grondilu I do have the same module installed with zef, so maybe it's using this instead on the one on lib/ 09:58
CIAvash Yeah, the calling is the more complicated part.
SmokeMachine because you will be able to do something like: `my &add = -> $a -> $b { $a + $b }; my &incr = add 1; say incr 41`
(I mean, call like that, that would already be useful) 09:59
grondilu uninstalls it to be sure
SmokeMachine (and it would be much more readable IMHO) 10:02
grondilu any idea why 'my uint @a; @a = @b;' would give a different result than 'my uint @a; @a = my uint @ = @b;' ? 11:06
grondilu found it. @b was actually referencing @a so that was bad. It was something like @a = @a[1], @a[0] 11:36
m: my
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed my
at <tmp>:1
------> 3my7⏏5<EOL>
grondilu m: my @a = (1, 2); @a =
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing required term after infix
at <tmp>:1
------> 3my @a = (1, 2); @a =7⏏5<EOL>
expecting any of:
prefix
term
grondilu sorry fat finger 11:37
m: my @a = (1, 2); @a = @a[1], @a[0]; say @a
camelia [2 1]
grondilu hum that works though. I don't get it. 11:38
grondilu m: my uint32 ($x, $y, $z) = <3397201341 1759006370 581115732>; say $y +^ ($x +| +^$z) 12:45
camelia -1213881571
grondilu why would a bitwise expression of unsigned integers ever return a signed integer? 12:46
grondilu m: say +^my uint32 $ = 581115732 12:52
camelia -581115733
grondilu m: say +^my uint8 $ = 1 12:53
camelia -2
grondilu searches roast to see if that is specced 12:56
grondilu doesn't find anything relevant 13:03
whatever that's too weird, I'm posting an issue 13:04
CIAvash SmokeMachine: I wrote a little function for calling functions that return functions, if you are interested: gist.github.com/CIAvash/686114e5b4...8d725fcf3b 13:09
codesections grondilu I'm pretty sure that is a bug, and is related to github.com/rakudo/rakudo/issues/3429 13:10
grondilu well maybe it's not, I've just checked in C and it returns 2 too. 13:13
which is baffling to me. 13:14
timo our uint support is .. a little "weak" 13:15
SmokeMachine CIAvash: it looks great! Maybe it could accept the named parameters anywhere instead of only on the "right place"... maybe testing the named ones on every function... 13:16
timo gasp 13:22
this is like reverse currying?
or i guess how function application works in a language that curries everything, like haskell
SmokeMachine CIAvash: of course it could be much improved, but I was thinking into something like this (I mean the named param being able tube used anywhere...): gist.github.com/FCO/58f648cb9df26f...58f81d9f03 13:29
I really think the `my &sum = -> $a -> $b { $a + $b }` is a good idea, and this currying operator would make it even better... 13:30
Geth App-Rakubrew/master: 8 commits pushed by (Patrick Böker)++ 14:19
Geth doc: ca2e03ab16 | (Tom Browder)++ (committed using GitHub Web editor) | doc/Language/faq.pod6
Update faq.pod6

Various language tweaks.
16:36
linkable6 Link: docs.raku.org/language/faq
Geth doc: e2d8bdacce | (Tom Browder)++ (committed using GitHub Web editor) | doc/Language/faq.pod6
Update faq.pod6

Add missing question marks.
16:41
linkable6 Link: docs.raku.org/language/faq