🦋 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.
00:04 jgaz joined 00:07 AlexDaniel left 00:27 deoac left 00:31 jpn left 00:33 jpn joined 00:56 jpn left
tbrowder__ .ask ugexe ^^^ 01:00
tellable6 tbrowder__, I'll pass your message to ugexe
01:02 jpn joined, tellable6 left, tellable6 joined 01:07 tellable6 left, tellable6 joined 01:09 jpn left 01:11 jpn joined 01:45 jpn left 01:47 jpn joined 02:00 jpn left, jpn joined 02:22 jpn left 02:29 jpn joined 02:42 jpn left 02:48 jpn joined
ugexe Zef uses it for —version 02:55
tellable6 2023-10-02T01:00:18Z #raku <tbrowder__> ugexe ^^^
ugexe so yeah
You’re using -Ilib 02:56
use -I.
02:57 jpn left 02:58 jpn joined 03:03 jpn left 03:04 jpn joined 03:15 jpn left, jpn joined 03:24 jpn left 03:25 jpn joined 03:34 jpn left 03:41 jpn joined 03:53 jpn left 03:54 jpn joined 04:03 jpn left 04:04 jpn joined 04:28 jpn left 05:28 committable6 left, bisectable6 left 05:30 bisectable6 joined 05:31 committable6 joined 06:48 abraxxa joined 06:59 abraxxa1 joined, abraxxa left 07:33 sena_kun joined 07:49 Sgeo left 07:56 dakkar joined 07:58 Manifest0 joined 08:02 jgaz left 08:10 jpn joined 08:34 melezhik joined
melezhik .tell AlexDaniel I successfully use ZNC to send messages from SparrowCI builds to raku-sparrow channel, the things is you have to run ZTC as a service, logging to ZTC UI, create a user that would connect to a required channel and you're all set, after that you can use your ZTC as proxy on localhost , see as an example - 08:37
tellable6 melezhik, I'll pass your message to AlexDaniel
melezhik github.com/melezhik/SparrowCI/blob...ku#L38-L48
"create a user that would connect to a required channel" with that being send this should be a real user that have an access to a raku channel 08:39
also when you do a setup you'll will probably encounter this (if one uses a self signed ssl cert for ZTC )  - github.com/lizmat/IRC-Client/issues/68 08:44
there is workaround in the isseu 08:45
08:45 melezhik left 09:30 sena_kun left
tbrowder__ ugexe: i'm trying to use it inside a sub in module and .WHAT tells me it is a Str, but the only value I can get from it is a '*'. i'm trying to get a useful example for the docs 10:50
is it a raku bug? or is it not intended to be used internally? 10:51
as .content can be used for introspection 10:52
10:53 lichtkind joined
tbrowder__ i've tried installing the module with zef and using its installed introspection executable to show its version and still get the '*' 11:15
so does Zef "cheat" and use .content? 11:16
gotta look at roast...
lizmat and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2023/10/02/2023-...n-4-weeks/ 11:17
tbrowder__ is roast using main now? 11:33
looks like still using master, cool 11:38
ugexe I don’t know what you’re doing, but DISTRIBUTION does exactly what you want it to 11:43
that is how it is used in zef and other code in the wild
github.com/ugexe/zef/blob/bf995228...kumod#L307 11:46
If you’re seeing * for a version it almost certainly means you’re using -Ilib somewhere to point at the distribution 11:48
it doesn’t matter if it’s also installed if you’re also using -Ilib
leont Oh right, I should start writing slides for the conference 11:49
lizmat leont: indeed! :-)
tbrowder__ aha! i don't see any tests other than definedness on $?DISTRIBUTION 11:50
looks like serendipty that .content works
*serendipity 11:51
ugexe It works, trust me
You’re using -Ilib somewhere. Find where and you’ll know why your code isn’t working 11:52
I know youre using -Ilib because I have a mental model of how that code works, and there are only two scenarios it would give that version: youre explicitly putting that as the version or code is using -Ilib or use lib lib 11:54
11:55 ProperNoun joined
nemokosch I should also start writing slides for the conference, to get a presentation at all 😄 11:57
the idea itself has been clear for a while but refactoring old Atom code turned out to be a great distraction...
Is anybody using Pulsar, by the way? 11:58
lizmat nemokosch looks like you didn't submit a talk proposal yet. Less than 14 days to do that. And the program is already at 5+ hours... 12:04
nemokosch I think that's by far the shortest it has been so that part shouldn't be a problem 12:06
anyway, if I do make it, I might as well record it and stuff, it definitely won't be in vain
12:08 AlexDaniel joined
I was planning to only submit if (when) it's ready so there is nothing to lose 12:10
lizmat nemokosch understood 12:18
ugexe tbrowder__: can show me your code and tell me how you're invoking it 12:26
i can probably figure out your problem in a minute or two if i just see it
12:26 [Coke] joined
tbrowder__ WILCO i'll put the toy module on github, that work for you? 12:35
12:36 AlexDaniel left, AlexDaniel joined 12:39 jpn left 12:40 jpn joined 12:45 nalin joined
ugexe tbrowder__: yeah 12:49
12:52 nalin left
tbrowder__ ok, see github.com/tbrowder/MyFoo 13:29
looks like i need to use some kind of proper cheat for the meta as you do in Zef 13:30
gotta go for a while
using .content is easiest as i use it in one of the subs 13:32
(prior to looking at Zef)
i can't use zef because it's for an example for the docs 14:06
on how to use $?DISTRIBUTION.meta 14:07
ugexe tbrowder__: github.com/tbrowder/MyFoo/blob/e74...5C17-L5C17 14:12
like i said earlier: you are using -Ilib or use lib "lib"
either change that to `use lib "."`, or (as I would suggest) invoke your code with -I. and remove the `use lib ...` entirely 14:13
to be clear: bin/test-distribution has `use lib <./lib>;` in it 14:15
SmokeMachine Hi everybody! I was thinking... is there a better way of doing something like this (I mean the patter matching) then needing to duplicate the signature and without using multi subs? 14:37
m: for [\(42, "bla"), \(13), \("ble")] { when :(Int, Str) { my :(Int $num, Str $str) := .Capture; say $num; say $str }; when :(Int) { my :(Int $i) := .Capture; say $i }; default { .say } }
camelia 42
SmokeMachine I also thought something like this, but it doesn't really work and that's too odd to have an empty block because everything is done on the test... 14:41
m: for [\(42, "bla"), \(13), \("ble")] { when -> (Int $num, Str $str) { say $num; say $str; True } {}; when -> (Int $i) { say $i; True } {}; default { .say } }
camelia 42
Too few positionals passed to '<anon>'; expected 2 arguments but got 1 in sub-signature
in block at <tmp> line 1
in block <unit> at <tmp> line 1

nemokosch and it didn't even work, hm 14:43
SmokeMachine nemokosch: yes, it didn't... 14:47
tbrowder__ i guess using JSON::Fast is cheating, too :-(
SmokeMachine I may do something like this, but the syntax doesn't feel right: 14:56
m: sub match(Capture $data, *@funcs where *.all ~~ Callable) { @funcs.first(-> &func { $data ~~ &func.signature }).(|$data) }; for [\(42, "bla"), \(13), \("ble")] { match .Capture, -> Int $num, Str $str { say $num; say $str }, -> Int $i { say $i; True }, -> |c { say c } }
camelia 42
SmokeMachine maybeI need a slang for that... :( 14:57
tbrowder__ no, just need correct syntax... 15:07
ugexe tbrowder__: did you see my earlier message? 15:10
you are using `use lib "lib"` like i said would be the issue
just remove that
ttps://github.com/tbrowder/MyFoo/blob/e74bd0143a45e5b156ca0d598e6334c0f3a283cb/bin/test-distribution#L5C17-L5C17 15:11
delete that line
tbrowder__ ugexe: ok, thnks, back in a few hrs 15:12
SmokeMachine now I'm thinking on something like this (if I'm able to remove the dyn var): 15:19
m: sub match(&func) { when &func.signature { func |$*_ } }; for [\(42, "bla"), \(13), \("ble")] { my $*_ = $_; match -> Int $num, Str $str { say $num; say $str }; match -> Int $i { say $i; True }; match -> |c { say c } }
camelia \(42, "bla")
SmokeMachine any idea on how to remove that dynamic var?
that's not working... :( 15:20
16:03 jpn left 16:40 dakkar left
Voldenet how hacky can it be? 16:46
nqp::getlexcaller(<$_>) could work 16:47
16:48 coleman left
Voldenet m: use nqp; sub match(&func) { $_ = nqp::getlexcaller(<$_>); when $_ ~~ &func.signature { func |$_ } }; for [\(42, "bla"), \(13), \("ble")] { match -> Int $num, Str $str { say $num; say $str }; match -> Int $i { say $i; True }; match -> |c { say c } } 16:49
camelia 42
\(42, "bla")
Voldenet figures
16:49 coleman joined 16:50 coleman left, coleman joined 16:51 abraxxa1 left
Voldenet I think there was some op for quitting that parent context as well 16:51
16:55 swaggboi left
Voldenet throwpayloadlexcaller with nqp::const::CONTROL_RETURN, but it doesn't quite work with scope 16:57
16:58 swaggboi joined
Voldenet how about this 17:02
m: use nqp; sub match(*@f) { $_ = nqp::getlexcaller(<$_>); for @f -> &func { when $_ ~~ &func.signature { return func |$_; }; } }; for [\(42, "bla"), \(13), \("ble")] { match -> Int $num, Str $str { say $num; say $str }, -> Int $i { say $i; True }, -> |c { say c } }
camelia 42
Voldenet SmokeMachine: ^ slightly specific syntax, but it is comfortable to use at least
SmokeMachine Voldenet: thanks! That looks much better 17:04
17:30 kathe joined
kathe hi. :) 17:30
lizmat kathe o/ 17:31
kathe hey, lizmat! o/ 17:32
glad to have found you. was looking to interact with you today. :)
i am exiting the electronic digital computing world. 17:33
lizmat well, here I am...
I guess you mean exciting ?
kathe no no, i really meant "exiting".
lizmat ah? how come ?
kathe i saw interviews of "siddharth kara"; author of "cobalt red". 17:34
consequently, realized that our entire infrastructure is destructive towards mother earth.
production, operation, and the eventual disposal, all pollute, severely. 17:35
i have been conducting an experiment to see if i can survive with minimal finances.
in a way, it was successful.
lizmat I see. I understand that the next generation of Li-ion batteries will be without Cobalt btw
kathe "cobalt red" is just the triggering point for me. 17:36
even before we had cobalt-based batteries, we were still "raping" mother earth.
lizmat I see.. well I wish you well outside in the non-electronic, non-digital, non-computing world :-)
kathe thanks lizmat. :)
you were one of the kindest people out here, so i was looking forward to saying goodbye, to you especially. 17:37
lizmat thank you for your kind words
kathe there was one more person who would give virtual hugs to people who were annoyed and ranted against "raku". 17:38
i can't remember his/her/their handle.
hope they read my message too.
wish you all a productive life ahead. all have their own perspective. :) 17:39
lizmat I'm sure they will, and if they happened to be offline now, they can always check irclogs.raku.org/raku/live.html
kathe cool.
lizmat kathe: take care, and have a happy life!
kathe i miss mr. wall out here. wish him good health. 17:40
bye all.
and lizmat, you to have a happy life ahead.
17:40 kathe left
El_Che bye kathe, hopefully you'll find what you're looking for 17:40
18:04 MasterDuke joined 18:05 jpn joined 18:07 sena_kun joined 18:17 sena_kun left 18:18 sena_kun joined
nemokosch what does nqp::getlexcaller do? why is it in angular quotes? 18:25
tonyo github.com/Raku/nqp/blob/main/docs...tlexcaller 18:36
18:38 Tirifto joined, Tirifto_ left
tonyo looks like it just iterates the environments until it finds the var or is undef 18:39
nemokosch thanks 18:44
Then maybe it could be written as CALLER::<$_> as well? 18:46
without explicitly going to nqp
or CALLERS::<$_> if the traversal is desired (not sure here)
19:14 jpn left 19:25 jpn joined 19:37 TieUpYourCamel left
m: sub match(&func) { $_ = CALLERS::<$_>; when &func.signature { func |$_ } }; for [(42, "bla"), (13), ("ble")] { match -> Int $num, Str $str { say $num; say $str }; match -> Int $i { say $i; True }; match -> |c { say c } } 19:50
Raku eval 42 bla \(42, "bla") 19:51
nemokosch CALLER::<$_> didn't work, not allowed to access a dynamic variable
19:51 TieUpYourCamel joined 20:02 Altai-man joined 20:04 sena_kun left 20:39 NemokoschKiwi joined 20:49 NemokoschKiwi left 20:58 lichtkind_ joined 21:00 lichtkind left, lichtkind__ joined 21:03 lichtkind_ left 21:05 swaggboi left 21:07 swaggboi joined 21:28 tadzik left, tadzik joined 21:49 Altai-man left 22:07 Guest93 joined 22:08 jpn left 22:10 Guest93 left 22:20 ProperNoun left 22:52 Sgeo joined
guifa so CALLER::<$_> used to work, but that was changed at some point 23:07
nemokosch *non-dynamic variable, of course
23:17 lichtkind__ left 23:37 Manifest0 left 23:52 guifa left 23:53 guifa joined