🦋 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. |
|||
00:02
reportable6 left
00:03
reportable6 joined
00:18
lichtkind left
00:53
dextercd left
01:06
djerius left
01:09
djerius joined
01:18
Geth__ joined
01:19
monkey_ joined,
TempIRCLogger left,
Geth left,
lizmat left
02:28
monkey_ left
02:38
monkey_ joined
02:49
monkey_ left
02:52
monkey_ joined
03:13
HrBollermann left
|
|||
[Coke] | yo | 03:57 | |
04:13
linkable6 left,
evalable6 left,
evalable6 joined
04:15
monkey_ left
05:15
squashable6 left,
committable6 left,
shareable6 left,
evalable6 left,
releasable6 left,
unicodable6 left,
quotable6 left,
bloatable6 left,
bisectable6 left,
notable6 left,
nativecallable6 left,
benchable6 left,
coverable6 left,
reportable6 left,
greppable6 left,
sourceable6 left,
tellable6 left,
statisfiable6 left
05:16
committable6 joined,
frost joined
05:17
notable6 joined,
nativecallable6 joined,
benchable6 joined,
releasable6 joined,
greppable6 joined
05:18
statisfiable6 joined,
bloatable6 joined,
tellable6 joined,
unicodable6 joined
05:19
sourceable6 joined
05:21
tejr left
05:22
tejr joined
06:16
squashable6 joined
06:17
evalable6 joined
07:04
reportable6 joined
07:14
frost left,
linkable6 joined
07:15
frost joined
07:17
quotable6 joined,
bisectable6 joined
07:18
shareable6 joined
07:26
seednode left
07:27
seednode joined
07:38
frost left
|
|||
El_Che | ma | 08:05 | |
08:17
coverable6 joined
08:42
patrickb joined
08:58
jjido joined
09:23
lichtkind joined
09:29
jjido left
09:47
lizmat_ left
09:48
lizmat joined
09:51
jjido joined
10:05
squashable6 left
10:11
jjido left
11:11
coverable6 left,
evalable6 left,
bisectable6 left,
shareable6 left,
notable6 left,
linkable6 left,
committable6 left,
releasable6 left,
unicodable6 left,
nativecallable6 left,
reportable6 left,
sourceable6 left,
benchable6 left,
statisfiable6 left,
tellable6 left,
greppable6 left,
bloatable6 left,
quotable6 left
11:12
benchable6 joined,
reportable6 joined,
shareable6 joined
11:13
sourceable6 joined,
notable6 joined,
committable6 joined
11:14
bisectable6 joined
11:21
Sgeo left
11:48
riffraff joined
12:02
whatnext joined,
reportable6 left
|
|||
whatnext | Hello all :) quick (quite basic) question: say I have a method I want to `wrap`, I can do `&mymethod.wrap({ ... })` - but how do I write this if `mymethod` is stored in `$variable` ? | 12:04 | |
12:07
squashable6 joined
12:12
tellable6 joined
12:13
bloatable6 joined
12:14
unicodable6 joined
|
|||
El_Che | m: sub foo() {say "FOO"}; my $bar = sub {print "BAR"; foo()}; $bar.wrap(&foo); bar | 12:16 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Undeclared routine: bar used at line 1. Did you mean 'bag', 'VAR'? |
||
El_Che | it works here :) | ||
m: sub foo() {say "FOO"}; my $bar = sub {print "BAR"; foo()}; $bar.wrap(&foo); bar() | |||
camelia | 5===SORRY!5=== Error while compiling <tmp> Undeclared routine: bar used at line 1. Did you mean 'VAR', 'bag'? |
||
El_Che | m: sub foo() {say "FOO"}; my $bar = sub {print "BAR"; foo()}; $bar.wrap(&foo); $bar() | 12:18 | |
camelia | FOO | ||
El_Che | \o/ | ||
whatnext | hm ok thanks El_Che - but how about if I don't want to write `my $bar = sub { ... }` but instead refer to an existing method | 12:22 | |
I mean the name of the method is stored in the variable, rather than the method itself | 12:23 | ||
this is really a question about how to write `&{$method}` (except this doesn't work) | |||
12:25
lichtkind left
|
|||
whatnext | any ideas? :) | 12:26 | |
12:29
whatnext left,
whatnext joined
12:30
riffraff left,
riffraff joined
12:35
riffraff left
12:39
riffraff joined
|
|||
El_Che | m: sub foo() {say "FOO"}; sub bar () {print "BAR"; foo()}; &<bar>.wrap(&foo); bar() | 12:41 | |
camelia | BARFOO | ||
whatnext | ah wow brilliant... angle brackets eh? :) | 12:42 | |
thanks! | |||
wait... isn't `&<bar>` same as `&bar` ie a literal? | 12:44 | ||
El_Che | it's quoted | ||
m: sub foo() {say "FOO"}; sub bar () {print "BAR"}; my $baz = &bar; $baz.wrap(&foo); bar() | 12:48 | ||
camelia | FOO | ||
El_Che | lizmat is the one liner wizzard :) | ||
whatnext | m: sub foo(){ say "hello" }; my $bar = 'foo'; my $baz = &$bar; $baz.wrap({ say "bye"; callsame }); foo(); | 12:55 | |
camelia | No such method 'wrap' for invocant of type 'Str'. Did you mean any of these: 'Map', 'Rat', 'WHAT', 'grep', 'map'? in block <unit> at <tmp> line 1 |
||
whatnext | it's the `$baz = &$bar` part that I can't work out | ||
El_Che | one layer of indirection too many :) | 12:56 | |
I personally tend to use a dispatch table for that kind of stuff: | 13:00 | ||
m: sub foo(){ say "hello" }; my %dtable = 'foo' => &foo; my $baz = 'foo'; %dtable{$baz}.wrap({say "bye"; callsame }); foo(); | |||
camelia | bye hello |
||
whatnext | that still involves writing the method as a literal though. Thanks for your help anyway El_Che :) | 13:02 | |
El_Che | one can try | 13:03 | |
wait for the wizzard | |||
s | |||
13:04
reportable6 joined
13:12
riffraff left
13:13
coverable6 joined
13:14
greppable6 joined,
evalable6 joined
13:26
monkey_ joined
13:46
jjido joined
13:51
whatnext left
14:12
dextercd joined
14:14
releasable6 joined
14:17
riffraff joined
15:10
riffraff left,
whatnext joined,
riffraff joined
15:11
riffraff left
15:12
riffraff joined
15:14
quotable6 joined,
linkable6 joined
15:19
riffraff left
15:21
whatnext left
|
|||
Anton Antonov | Is there are a "standard" name for the last evaluated result in REPL? (Something like `_` in Python or `%` in Mathematica.) | 16:07 | |
16:10
jjido left
16:12
statisfiable6 joined
16:32
jjido joined
|
|||
tbrowder | g'day, rakuuns | 16:33 | |
how do i programmatically check for an installed 'fez'? | 16:34 | ||
i've tried 'try require fez' | |||
and 'try require Fez' | 16:35 | ||
El_Che | discord-raku-bot: Anton Antonov#7232: not that I know off, it's called a sink context in raku | ||
docs.raku.org/language/contexts#Sink | 16:36 | ||
tbrowder | never mind, just found solution in docs i think (as i eat humble pie once more)... | 16:43 | |
Anton Antonov | El_Che, Thank you! | 16:59 | |
tbrowder | back again, it didn't work as expected. the library's name is 'fez' and provides several modules named Fez::*. | 17:03 | |
bummer, fumble fingers again...disregard all above... | 17:10 | ||
ok, success. i tested for: try require ::("Fez::CLI"); die if ::("Fez::CLI") ~~ Failure; | 17:21 | ||
whew! | 17:22 | ||
17:32
evalable6 left,
linkable6 left
17:34
linkable6 joined
17:48
marcbr joined,
bars0 joined
17:49
bars0 left
|
|||
marcbr | Hi Raku developers . At first, I would like to congratulate for the great work. I would like to know what are advantages of Raku over Python mainly if Raku has GIL like python. Do you think that Rku could have a good numerical library as numpy for scientific application such as AI/ML? | 17:52 | |
I main job is work with ML/DL in python. I would like to see more Raku in the area. What d you think? It is work while? | |||
codesections | Huh, another day, another Raku Advent calendar post on the hacker news front page. Congrats, pheix! | 17:57 | |
18:02
reportable6 left
18:03
reportable6 joined
|
|||
El_Che | (s)he left :) | 18:06 | |
Anton Antonov | I have a list of arrays, say, `$dfGrouped` and join them into one array with ` $dfGrouped.reduce( -> $x, $y { [|$x, |$y] } )`. Is there are shorter, more elegant way of doing that? | 18:30 | |
18:32
marcbr left
18:35
evalable6 joined,
dogbert17 left
18:40
squashable6 left
18:41
squashable6 joined
|
|||
codesections | [$dfGrouped.flat] | 18:43 | |
18:56
ggoebel joined
|
|||
ggoebel | marcbr: raku does not have a GIL like python. It has parallelism, concurrency, and asynchrony baked in. www.youtube.com/watch?v=JpqnNCx7wVY | 18:57 | |
tellable6 | ggoebel, I'll pass your message to marcbr | ||
19:00
abraxxa-home joined
19:03
dogbert17 joined
|
|||
tbrowder | marcbr: but there is a thread on per6users about getting some raku ppl together to work on something similar | 19:03 | |
tellable6 | tbrowder, I'll pass your message to marcbr | ||
19:06
ggoebel left
19:08
Sgeo joined
19:12
nativecallable6 joined
19:31
squashable6 left
|
|||
Anton Antonov | codesections Thank you! | 20:05 | |
codesections -- `[$dfGrouped.flat]` actually, this does not work for me. | 20:11 | ||
20:20
jjido left
20:32
squashable6 joined
20:44
abraxxa-home left
21:31
jjido joined
21:44
jjido left
21:57
slowtyper left
21:58
slowtyper joined
22:58
linkable6 left,
evalable6 left
23:01
linkable6 joined
23:13
ggoebel joined
23:15
patrickb left
|
|||
ggoebel | m: [[0,1],[2,3],[4,5]>>.List.flat.say | 23:15 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Unable to parse expression in array composer; couldn't find final ']' (corresponding starter was at line 1) at <tmp>:1 ------> 3[[0,1],[2,3],[4,5]>>.List.flat.say7⏏5<EOL> expecting any o… |
||
ggoebel | m: [[0,1],[2,3],[4,5]]>>.List.flat.say | ||
camelia | (0 1 2 3 4 5) | ||
merryprog | you'd think a flat list would have square brackets, not parentheses... | 23:16 | |
(Sorry) | |||
ggoebel | m: my $dfGrouped = [[0,1],[2,3],[4,5]]; $dfGrouped>>.List.flat.say | 23:31 | |
camelia | (0 1 2 3 4 5) | ||
23:32
discord-raku-bot left,
dextercd left,
discord-raku-bot joined
|
|||
gfldex | dd [[0,1],[2,3],[4,5]].duckmap: |*; | 23:32 | |
m: dd [[0,1],[2,3],[4,5]].duckmap: |*; | |||
camelia | Array element = [0, 1, 2, 3, 4, 5] | ||
ggoebel | nice | 23:36 | |
23:58
evalable6 joined
|