| Geth | advent: habere-et-dispertire++ created pull request #140: Hallo, Wêreld! 2025-12-18 |
00:19 | |
| Voldenet | wow, snitch is pretty neat extension | 00:55 | |
|
01:04
librasteve_ left
02:30
nine left,
nine joined
02:39
grondilu left
02:40
hulk joined
02:41
kylese left
03:15
hulk left,
kylese joined
03:26
grondilu joined
03:37
arkiuat left,
jcallen_ is now known as jcallen
03:41
sibl joined
03:45
arkiuat joined
03:59
arkiuat left
04:07
arkiuat joined
04:11
arkiuat left
04:18
arkiuat joined
04:23
arkiuat left
04:24
lichtkind_ joined
04:26
lichtkind left
04:30
sibl left
04:31
sibl joined
04:38
Aedil joined
04:51
arkiuat joined
04:56
arkiuat left
05:17
arkiuat joined
|
|||
| disbot6 | <jubilatious1_98524> weekly: stackoverflow.com/questions/798498...sh-in-raku | 05:22 | |
|
05:22
arkiuat left
05:32
jmcgnh left
05:51
arkiuat joined
05:56
arkiuat left
06:00
sibl left
06:05
jmcgnh joined
|
|||
| Voldenet | m: sub x(*%x) { say %x }; x(<bar> => <BAR!>); | 06:10 | |
| camelia | Too many positionals passed; expected 0 arguments but got 1 in sub x at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
| Voldenet | m: sub x(*%x) { say %x }; x(|(<bar> => <BAR!>)); | 06:11 | |
| camelia | {bar => BAR!} | ||
|
06:18
arkiuat joined
06:23
arkiuat left
|
|||
| korvo | I would like to install Humming-Bird using zef. However, this causes Cro::TLS to be installed, which fails with the error, "Cannot locate native library 'libssl.so': libssl.so: cannot open shared object file: No such file or directory" | 06:28 | |
| This can be minimized to the inability to $(zef install OpenSSL), which also fails. Now, to be fair, I don't have a /usr/lib/libssl.so but I'm willing to show zef where it is. Are there docs that I can read on this topic? | 06:30 | ||
| Alternatively, I don't actually need TLS support right now. Is there a way to indicate that TLS is optional and doesn't have to be installed? | |||
|
06:32
sibl joined
06:36
itaipu left
|
|||
| tadzik | you may be able to point it to the right libssl with LD_LIBRARY_PATH | 06:46 | |
| (that's an env variable, nothing zef-specific) | |||
|
06:51
arkiuat joined
|
|||
| korvo | tadzik: Looking at the Build.rakumod there is an OPENSSL_PREFIX envvar which does the trick. Thanks for the hint. | 06:51 | |
| tadzik | ah, even better | 06:52 | |
|
06:55
arkiuat left
06:57
arkiuat joined
06:58
itaipu joined
07:02
arkiuat left
07:03
jmcgnh left
07:04
jmcgnh joined
07:06
abraxxa joined
07:17
Sgeo left
07:20
arkiuat joined
07:24
arkiuat left
|
|||
| disbot6 | <simon_sibl> is there a way to import a module as another name ? | 07:42 | |
| <simon_sibl> also if I use a module, for example sibl::Foo which export sub greet, how come greet works but sibl::Foo::greet does not work ? | 07:46 | ||
|
07:52
arkiuat joined
|
|||
| disbot6 | <simon_sibl> I have to do our sub ... if I wanna use the syntax <some>::<module>::subname() ? | 07:56 | |
|
07:57
arkiuat left
|
|||
| disbot6 | <simon_sibl> that means that if I do require on a module, which use is export and not our sub then I cannot use any of the subroutines from the module ? | 08:04 | |
|
08:20
arkiuat joined
08:24
arkiuat left
08:28
librasteve_ joined
08:33
arkiuat joined
08:37
arkiuat left
08:55
arkiuat joined
08:57
jmcgnh left
08:58
dakkar joined
08:59
arkiuat left
|
|||
| timo | ooh tadzik o/ | 09:02 | |
|
09:02
johnjay left
|
|||
| tadzik | hey! | 09:02 | |
|
09:03
johnjay joined
09:04
sibl left
09:16
arkiuat joined
|
|||
| ab5tract | Export doesn’t change the scope of th function, it just adds things to the importer’s scope | 09:22 | |
|
09:22
sibl joined
|
|||
| ab5tract | So you still need to declare as ‘our sub greet’ to be able to call it with ::Bar::greet | 09:23 | |
| You cannot change the name of an imported module but you can create a new name referencing the imported module by creating a constant | 09:24 | ||
|
09:24
arkiuat left
|
|||
| ab5tract | You can even create this constant/alternative name in the EXPORT routine. Terminal::Print does this | 09:25 | |
|
09:27
jmcgnh joined
09:34
abraxxa left
09:36
abraxxa joined
09:53
arkiuat joined
|
|||
| disbot6 | <rcmlz> In case you are not on Windows: I tried installing Humming-Bird in my NixOS-VM and it installed without any problems and the hello world example from raku.land/zef:rawleyfowler/Humming-Bird also started. github.com/rcmlz/Raku-Nix-Shells/b...g-bird.nix bash nix-shell humming-bird.nix | 09:54 | |
|
09:58
arkiuat left
10:06
sibl left
10:15
arkiuat joined
10:20
arkiuat left
10:21
arkiuat joined
10:25
arkiuat left
10:37
arkiuat joined
10:41
arkiuat left
11:01
arkiuat joined
11:06
arkiuat left
11:22
arkiuat joined
11:26
habere-et-disper joined
11:27
arkiuat left
11:38
habere-et-disper left
11:47
arkiuat joined
|
|||
| lizmat | aruniecrisps I'm not sure I'm CS qualified enough to give you an answer | 11:48 | |
|
11:51
arkiuat left
12:21
johnjay left,
arkiuat joined
12:23
johnjay joined,
stanrifkin joined
12:26
arkiuat left
12:39
arkiuat joined
12:40
oodani left
12:42
oodani joined
12:44
arkiuat left
12:51
arkiuat joined
12:58
arkiuat left
13:07
arkiuat joined
13:15
arkiuat left
|
|||
| erry | What is this CS you speak of | 13:22 | |
| I'm only here for the memes | |||
| timo | this is the way. | ||
| disbot6 | <antononcube> @Voldenet I thought snitch 6.e only. I have to program ad hoc snitch in 6.d often. | 13:33 | |
|
13:36
arkiuat joined
|
|||
| timo | oh that's what that is | 13:37 | |
| fantastic | |||
| disbot6 | <antononcube> @simon_sibl and @rcmlz Some time ago I was told that reply comments on Discord to not show in IRC. (That might be no longer the case...) | 13:41 | |
|
13:41
arkiuat left
|
|||
| disbot6 | <antononcube> Never mind -- I can see your message in the logs, so, I assume they are seen in IRC. irclogs.raku.org/raku/2025-12-18.html | 13:42 | |
| Geth | advent: antononcube++ created pull request #141: docs:Changed the title of my 4th post to be about Number theory. |
14:02 | |
|
14:03
arkiuat joined
14:08
arkiuat left
14:15
abraxxa left
|
|||
| disbot6 | <simon_sibl> For this I need to first “use module;” then on another line/statement “constant \mymod = module;” ? | 14:20 | |
|
14:23
arkiuat joined
14:28
arkiuat left
14:31
arkiuat joined
14:36
arkiuat left,
itaipu left
14:39
arkiuat joined
14:50
arkiuat left
14:58
Sgeo joined
15:00
arkiuat joined
15:03
itaipu joined
15:12
melezhik joined
15:13
johnjay left
15:15
johnjay joined
|
|||
| disbot6 | <librasteve> @simon_sibl also to mention that a script can import multiple modules in different scopes (ie dot the use within braces) | 15:40 | |
|
15:49
orangebot joined
|
|||
| Geth | advent/main: 507781add1 | (Anton Antonov)++ (committed using GitHub Web editor) | 0 files docs:Changed the title of my 4th post to be about Number theory. (#141) |
16:06 | |
|
16:23
wayland76 left
16:24
wayland76 joined
16:25
arkiuat left
|
|||
| korvo | rcmlz: Nice. I'm on NixOS too. It looks like zef doesn't have an offline installer mode, so I can't really prepare an environment with packages in the Nix store, but your trick looks good for setting up a temporary environment. | 16:35 | |
|
16:37
arkiuat joined
|
|||
| timo | you can just run `zef install .` inside of an extracted distribution, though if you don't have the dependencies already installed, it will still try to find it on the 'net | 16:40 | |
| korvo | Which is precisely what one may not do during a Nix build. | 16:41 | |
|
16:44
arkiuat left
|
|||
| disbot6 | <_ccubed> Of what use are loop labels if they can't be used with respect to an outer loop? | 16:55 | |
| <_ccubed> The only examples in the doc would work the same if last LABEL or next LABEL dropped the LABEL. | 16:56 | ||
| <_ccubed> So I checked and in fact you can't use a last FOO do exit an outer loop labeled FOO. | 16:57 | ||
| lizmat | m: FOO: loop { loop { last FOO } }; say "outered" # seems to work ok ? | 17:00 | |
| camelia | outered | ||
|
17:01
arkiuat joined
|
|||
| disbot6 | <_ccubed> I'm using Welcome to Rakudo™ v2025.10. Implementing the Raku® Programming Language v6.d. Built on MoarVM version 2025.10. | 17:02 | |
| lizmat | can you gist the code that shows the issue ? | ||
| disbot6 | <_ccubed> I've been doing it in the REPL, so give me a few minutes | ||
| <aruniecrisps> lizmat: oh! okay then no worries, I was just curious because I wanted to learn a little bit more about the MoarVM internals and see how it all works | 17:03 | ||
| lizmat | _ccubed ah, the REPL | 17:04 | |
| make sure that the first "FOO: loop {" is on one line in the REPL, then it should be ok | 17:05 | ||
|
17:06
arkiuat left
17:14
arkiuat joined
|
|||
| disbot6 | <_ccubed> Well I did a small example in a script and it seems to work, but examples in the docs that would work the same without the feature being explained are not helpful. | 17:16 | |
| <_ccubed> Is there a raku robot here to show examples? | 17:18 | ||
| <_ccubed> Ah I see, that's what m: does | 17:22 | ||
| <_ccubed> m: $t = (1, (21, 23, (31, (41, 42, 43)))); say $t.tree; say $t.tree(0); say $t.tree(1); say $t.tree(2) | 17:23 | ||
| <_ccubed> hmm doesn't eval for me | 17:25 | ||
| <_ccubed> camelia: say 15/6; | |||
| korvo | anton: Your email showed up. Not sure why it was delayed. Thanks again for helping to fix the formatting on my post; I appreciate it. | 17:26 | |
| disbot6 | <_ccubed> m: FOO: loop { loop { last FOO } }; say "outered" | 17:29 | |
| lizmat | m: FOO: loop { loop { last FOO } }; say "outered" | 17:34 | |
| camelia | outered | ||
| lizmat | running the eval across the Discord bridge doesn't work | 17:35 | |
| disbot6 | <_ccubed> got you | ||
| lizmat | there used to be a bot on the Discord side, if I remember correctly | ||
| disbot6 | <_ccubed> how was it invoked? | ||
| lizmat | maybe antononcube remembers | 17:36 | |
| disbot6 | <_ccubed> ccc@SilentService ~/Math/Project_Euler $ raku Welcome to Rakudo™ v2025.10. Implementing the Raku® Programming Language v6.d. Built on MoarVM version 2025.10. To exit type 'exit' or '^D' [0] > say ^10 .toggle: * < 4, * %% 2, &is-prime (0 1 2 3 6 7) [0] > say ^10 .toggle: :off, * < 4, * %% 2, &is-prime (0 2 3 4 5 6 7 8 9) [0] > | 17:37 | |
| <_ccubed> [0] > say ^10 .toggle: :off () | |||
| [Coke] | You could m: gist.githubusercontent.com/coke/21...1/foo.raku | 17:39 | |
| er. | |||
| m: gist.githubusercontent.com/coke/21...1/foo.raku | |||
| camelia | ===SORRY!=== Error while compiling <tmp> Confused at <tmp>:1 ------> https:<HERE>//gist.githubusercontent.com/coke/21acce expecting any of: colon pair |
||
| [Coke] | ... ISTR there's a way to do it with a gist, but the syntax eludes me. | ||
| m: say ^10 .toggle: * < 4, * %% 2, &is-prime (0 1 2 3 6 7); say ^10 .toggle: :off, * < 4, * %% 2, &is-prime (0 2 3 4 5 6 7 8 9); say ^10 .toggle: :off (); | 17:41 | ||
| camelia | ===SORRY!=== Error while compiling <tmp> Two terms in a row at <tmp>:1 ------> ay ^10 .toggle: * < 4, * %% 2, &is-prime<HERE> (0 1 2 3 6 7); say ^10 .toggle: :off, * expecting any of: infix infix stopper postf… |
||
| [Coke] | I am confused by your syntax also. | 17:42 | |
| disbot6 | <_ccubed> Using the exact syntax in the documentation for the toggle method | ||
|
17:44
dakkar left
|
|||
| disbot6 | <_ccubed> I copied and pasted the example without the ':off', then ran it again with the ':off'. | 17:44 | |
| <_ccubed> There's a space between the '.toggle:' and the '.off' | 17:46 | ||
| timo | evalable6: gist.githubusercontent.com/coke/21...1/foo.raku | ||
| evalable6 | timo, Successfully fetched the code from the provided URL | ||
| does this work? | |||
| timo | [Coke]: the discord-irc-bridge turned a multi-line message into a single line, there was a newline between the &is-prime and (0 1 2 3 6 7) there | 17:47 | |
| disbot6 | <_ccubed> evalable6: 15/6 | ||
| <_ccubed> With respect to the documentation, what would help me greatly is description of what various syntax characters mean in different contexts. | 17:52 | ||
| <_ccubed> What the heck is the asterisk doing there? | 17:53 | ||
| <_ccubed> What water is that colon carrying here? | |||
| [Coke] | docs.raku.org/type/Any#method_toggle ? | 17:54 | |
| disbot6 | <_ccubed> yes | ||
| [Coke] | ok, that doesn't quite match the sample there, but the `.toggle:` - the list after the : are the arguments to the toggle method. | 17:56 | |
| disbot6 | <_ccubed> Try the 1st example then add an ':off:' to it | ||
| [Coke] | toggle is taking Callables; you can specify a sub, or a block or a WhateverCode - the `* < 4` is a bit of code that can be invoked, and will return true if the argument passed is less than 4. | ||
| disbot6 | <_ccubed> Yes, I understand that much | 17:57 | |
| [Coke] | :off is a named parameter to the method. | ||
| (different use of colon) | |||
| disbot6 | <_ccubed> Why, with ':off' is anything printed before 4? | ||
| <_ccubed> got that backwards | 17:58 | ||
| <_ccubed> er, wrong | |||
| <_ccubed> why is 0 printed but 2 is not | |||
| [Coke] | ah, I see that your example in IRC is probably missing some #'s to mark things as comments. | 17:59 | |
| Sure it looked fine on discord. | |||
| so just this one?: | 18:00 | ||
| m: say ^10 .toggle: * < 4, * %% 2, &is-prime | |||
| camelia | (0 1 2 3 6 7) | ||
| [Coke] | I don't see an example on the page that prints 0 but not 2. | 18:01 | |
| I see one that prints 2 but not 0? | 18:02 | ||
| disbot6 | <_ccubed> No, take the example you just gave to Camelia, and insert a ':off,' before the '* < 4' | ||
| <_ccubed> m:say 15/6 | 18:03 | ||
| [Coke] | m: say ^10 .toggle: :off, * < 4, * %% 2, &is-prime | ||
| camelia | (0 2 3 4 5 6 7 8 9) | ||
| [Coke] | that prints 0 & 2. | ||
| disbot6 | <_ccubed> I can see the 0, but there shouldn't be a toggle until you get to 4, so what happened to the 1? | 18:04 | |
| <_ccubed> No wait the * %% 2 toggles when you get to 2 | 18:05 | ||
| <_ccubed> Does the order of the callables matter? | 18:06 | ||
| <_ccubed> The document suggests that it does, | |||
| <_ccubed> What's the use case for .toggle? | 18:07 | ||
| timo | one example is when you have line-based input and you want to grep groups of lines that have a starting and an ending marker of some kind | 18:09 | |
| m: say <( a b c d ) x y ( 1 2 3 ) 9>.toggle('(', ')') | |||
| camelia | No such method 'CALL-ME' for string '(' in block <unit> at <tmp> line 1 |
||
| timo | m: say <( a b c d ) x y ( 1 2 3 ) 9>.toggle(* eq '(', * eq ')') | 18:10 | |
| camelia | (( ) x y ( 1 2 3 ) 9) | ||
| timo | m: say <( a b c d ) x y ( 1 2 3 ) 9>.toggle(|(* eq '(', * eq ')') xx *) | 18:11 | |
| camelia | (( ) )) | ||
| timo | not sure how best to do an infinite toggle like the ff operator would do | ||
| disbot6 | <_ccubed> Ok timo, I've got to go now. Thanks for the help. I'd like to get deeper into Raku. I've used it successfully a couple of times for Project Euler, projecteuler.net/ | 18:13 | |
| [Coke] | I am trying to follow the logic for adding the :off to the sample, and honestly it makes my brain hurt. | 18:14 | |
| starts off, then 0 is < 4 which matches, but that changes the state to on, which should move it to the next callable. 1 isn't %% 2, so that should fail, which should change the state back to off, which should go to the next callable. 2 IS prime, so it should turn back on... and then should stay with is-prime since it's the last callable. but then why is it printing 4, 6, 8? | 18:15 | ||
| I tried replacing the callables with blocks that include "say" statements so we can see them being invoked, but no love. | 18:16 | ||
| ah, because I did it wrong... | 18:17 | ||
| m: say ^10 .toggle: :off, {note "A$_"; $_ < 4}, {note "B$_"; $_ %% 2}, {note "C$_"; $_.is-prime} | 18:18 | ||
| camelia | A0 (0 2 3 4 5 6 7 8 9) B1 C2 |
||
| [Coke] | m: say ^10 .toggle: :off, {say "A$_"; $_ < 4}, {say "B$_"; $_ %% 2}, {say "C$_"; $_.is-prime} | ||
| camelia | A0 B1 C2 (0 2 3 4 5 6 7 8 9) |
||
| [Coke] | m: say ^10 .toggle: {say "A$_"; $_ < 4}, {say "B$_"; $_ %% 2}, {say "C$_"; $_.is-prime} | ||
| camelia | A0 A1 A2 A3 A4 B5 B6 C7 C8 (0 1 2 3 6 7) |
||
| [Coke] | ah, so we ran out of Callables, and the *switch stays in the current position* | 18:20 | |
| which is in the docs, but it helped to see it in action there. | |||
| it's not that it stays on the last Callable, which was my initial mis-read | 18:21 | ||
| timo | m: say <( a b c d ) x y ( 1 2 3 ) 9>.grep({ '(' ff ')' }) | 18:22 | |
| camelia | (( a b c d ) ( 1 2 3 )) | ||
| timo | m: say <( a b c d ) x y ( 1 2 3 ) 9>.grep({ '(' ^ff^ ')' }) # doesn't include the parens when using ^ | ||
| camelia | (a b c d 1 2 3) | ||
| timo | grep ff is easier to use when you want the testers to always toggle | 18:23 | |
| [Coke] | mmm | 18:24 | |
| I wonder if "code golf" is the use case for toggle. :P | |||
|
18:33
wayland76 left
18:34
wayland joined
|
|||
| ugexe | it appears to require quite a lot of documentation to explain how it works | 19:34 | |
| although arguably most methods on lists are just golfing map/grep chains | 19:40 | ||
|
20:09
apac joined
20:12
apac left
20:19
abraxxa-home joined
20:21
abraxxa-home left
20:22
abraxxa-home joined
20:51
arkiuat left
20:54
arkiuat joined
21:01
melezhik left
21:06
Aedil left
21:22
orangebot left
21:34
orangebot joined
21:46
gabiruh_ left,
gabiruh joined
21:50
orangebot left
|
|||