| 00:04:21 | * | Alfom quit (Ping timeout: 250 seconds) |
| 00:54:20 | * | rockcavera quit (Remote host closed the connection) |
| 01:05:21 | * | rockcavera joined #nim |
| 02:27:01 | * | rockcavera quit (Remote host closed the connection) |
| 02:47:05 | * | syl quit (Ping timeout: 256 seconds) |
| 02:47:05 | * | _th3r00t quit (Ping timeout: 256 seconds) |
| 02:47:25 | * | th3r00t joined #nim |
| 02:48:20 | * | syl joined #nim |
| 02:58:15 | * | meinside- joined #nim |
| 03:00:09 | * | zgasma_ joined #nim |
| 03:02:38 | * | Jjp137 quit (*.net *.split) |
| 03:02:38 | * | zgasma quit (*.net *.split) |
| 03:02:39 | * | meinside quit (*.net *.split) |
| 03:02:39 | * | cm quit (*.net *.split) |
| 03:02:39 | * | bgupta quit (*.net *.split) |
| 03:02:53 | * | Jjp137 joined #nim |
| 03:02:53 | * | cm joined #nim |
| 03:02:53 | * | bgupta joined #nim |
| 05:17:09 | FromDiscord | <ajusa> What am I doing wrong in this example? If I get rid of the first implementation of match it works. Is it because of the untyped bodies?↵↵https://play.nim-lang.org/#pasty=LwcDTQzo |
| 05:55:18 | FromDiscord | <leorize> it's because you're trying to overload an untyped parameter, the compiler overloading resolution will try to perform semantic checks, which predictably fails |
| 05:55:51 | FromDiscord | <ajusa> In reply to @leorize "it's because you're trying": Ah to figure out which overload to take |
| 06:42:55 | * | beholders_eye quit (Ping timeout: 264 seconds) |
| 06:56:26 | * | Jjp137 quit (Ping timeout: 256 seconds) |
| 07:08:28 | FromDiscord | <systemblue2010> hey guys↵why only chinese are in language-specific channel?↵please add korean too |
| 07:17:41 | * | Alfom joined #nim |
| 07:23:55 | FromDiscord | <kiloneie> sent a code paste, see https://play.nim-lang.org/#pasty=ZmGYNiXc |
| 07:24:22 | FromDiscord | <ieltan> In reply to @systemblue2010 "hey guys why only": Probably because no one asked for it yet, it might be made if you ask a mod nicely |
| 07:24:32 | FromDiscord | <kiloneie> In reply to @kiloneie "loadEntityImages calls loadImage a": Template -> proc -> template -> proc. |
| 07:26:23 | FromDiscord | <ieltan> In reply to @kiloneie "loadEntityImages calls loadImage a": I think the overloading is most likely the issue here |
| 07:27:27 | FromDiscord | <kiloneie> Wdym ? The extension is saying it's calling the correct thing, since i supplied the correct parameters... https://media.discordapp.net/attachments/371759389889003532/1432994223262535740/Screenshot_2025-10-29_08-27-01.png?ex=6903135e&is=6901c1de&hm=ff005afff3779ccc467846b149ae0826ab024d2254a416fd0cf550dc72123321& |
| 07:30:57 | FromDiscord | <kiloneie> Idk, i will just make a monolithic proc then, that doesn't call loadImage. |
| 07:38:03 | FromDiscord | <lainlaylie> it might be easier to help if you tell us what "doesn't work" means. is there an error message? |
| 07:38:28 | FromDiscord | <kiloneie> https://media.discordapp.net/attachments/371759389889003532/1432996994569338930/Screenshot_2025-10-29_08-38-20.png?ex=690315f3&is=6901c473&hm=391e8efa63b16772e5ac8db1f8722f109afcf3fcc978941e6598d70845618aea& |
| 07:38:56 | FromDiscord | <kiloneie> That's what the template is supposed to be supplying. |
| 07:39:13 | FromDiscord | <kiloneie> app holds the renderer |
| 07:39:38 | FromDiscord | <kiloneie> so the template wrapper does `app.renderer` for it's second parameter. |
| 07:40:11 | FromDiscord | <kiloneie> https://media.discordapp.net/attachments/371759389889003532/1432997424917643424/Screenshot_2025-10-29_08-40-02.png?ex=69031659&is=6901c4d9&hm=8349ae4c2395d617d6d0880a3e5298087197c946a9b8b2506d8ff32fd444b61d& |
| 07:40:43 | FromDiscord | <kiloneie> https://media.discordapp.net/attachments/371759389889003532/1432997559718121597/Screenshot_2025-10-29_08-40-36.png?ex=6903167a&is=6901c4fa&hm=7ff8d9d5bdb693d60fce2685f1a9ac2cf73feee52e5dce424736ae4d2e85d711& |
| 07:45:24 | FromDiscord | <lainlaylie> ok, managed to come up with a reproduction |
| 07:46:27 | FromDiscord | <lainlaylie> i think it's because `app` indeed doesn't exist inside `proc loadEntityImage`'s scope, which is what is calling `template loadImage` |
| 07:48:45 | FromDiscord | <leorize> if you want app to be bound from environment, add `mixin app` as the first statement |
| 07:49:13 | FromDiscord | <leorize> templates are like copy-pasting until they're not |
| 07:49:44 | FromDiscord | <leorize> though I don't even know why you bothered with a template here |
| 07:52:56 | FromDiscord | <lainlaylie> but this is not really a template quirk thing is it? it's simply that the intermediate `proc loadEntityImage` is breaking the copy-paste |
| 07:53:21 | FromDiscord | <lainlaylie> if we physically pasted the contents of `template loadImage` into `proc loadEntityImage` we'd get the same error |
| 08:02:30 | FromDiscord | <nnsee> In reply to @kiloneie "": why are you using templates so heavily? what's wrong with procs? |
| 08:18:47 | FromDiscord | <systemblue2010> In reply to @nnsee "why are you using": I use templates very heavily too↵because of inline optimization |
| 08:27:08 | FromDiscord | <systemblue2010> sent a code paste, see https://play.nim-lang.org/#pasty=NHzrhgsW |
| 08:27:15 | FromDiscord | <systemblue2010> this is one template |
| 08:27:16 | FromDiscord | <systemblue2010> quite big |
| 08:27:36 | FromDiscord | <kiloneie> I get it, if main calls loadEntitiesImage/s, which calls loadEntityImage template -> proc, it will work. But if that proc then calls another template, it will not work, since the call is not coming from main. |
| 08:30:05 | FromDiscord | <kiloneie> In reply to @leorize "if you want app": I tried doing that, but it doesn't do anything... |
| 08:30:19 | FromDiscord | <systemblue2010> this is process part of sha-2's 512 lines(SHA-2-384, SHA-2-512, SHA-2-512/224, SHA-2-512/256 |
| 08:30:22 | FromDiscord | <systemblue2010> (edit) "SHA-2-512/256" => "SHA-2-512/256)" |
| 08:30:31 | FromDiscord | <systemblue2010> I'm now studying cryptography |
| 08:31:43 | FromDiscord | <kiloneie> So i cannot do it that way, i have to make a standalone proc + template wrapper, which i have done for loadEntityImage (this one is Images) before. |
| 08:38:59 | FromDiscord | <lainlaylie> if you make `renderer` the thing that the templates pass down (instead of `app.renderer`), everything should just work |
| 08:39:23 | FromDiscord | <lainlaylie> main gets it from the global scope, and any procs in between get it from the argument |
| 08:40:14 | FromDiscord | <lainlaylie> but yes, the real solution is to just use procs |
| 08:48:05 | FromDiscord | <ieltan> In reply to @systemblue2010 "hey see my code": :imdead5: hope that's a helper template that's just used in a couple procs cause if you litter your code with that template the code size would inflate too much |
| 08:50:13 | FromDiscord | <ieltan> actually it make sense if you only use that inside a loop |
| 08:50:28 | FromDiscord | <kiloneie> In reply to @lainlaylie "if you make `renderer`": I am pretty sure that cannot be done, i have tried such a thing before, but that renderer is tied to the window in main. There doesn't seem to be a way to just makea renderer, load images, then throw them to another renderer. |
| 08:51:36 | FromDiscord | <lainlaylie> there shouldn't be any behavior change |
| 08:52:22 | FromDiscord | <systemblue2010> In reply to @ieltan "<:imdead5:1383770725713707108> hope that's a": it is not proc it's template |
| 08:52:27 | FromDiscord | <ieltan> If you need another renderer then pass a `var Renderer` so you can "throw another renderer" to push image in |
| 08:52:46 | FromDiscord | <ieltan> But I honestly have no idea about your code so |
| 08:56:03 | * | Alfom quit (Ping timeout: 250 seconds) |
| 09:01:57 | FromDiscord | <kiloneie> sent a code paste, see https://play.nim-lang.org/#pasty=UvtnDvsJ |
| 09:02:42 | FromDiscord | <nnsee> In reply to @systemblue2010 "I use templates very": i mean that's one place that at least somewhat makes sense, i meant in kilo's case specifically |
| 09:02:58 | FromDiscord | <systemblue2010> yes |
| 09:10:06 | FromDiscord | <lainlaylie> In reply to @kiloneie "How would i do": no error so we can only guess what the problem is, but im guessing you want `when` instead of `if`? |
| 09:10:46 | FromDiscord | <kiloneie> im getting excessive recursion error, which actually happens before line 2, line 1... |
| 09:10:51 | FromDiscord | <kiloneie> i cannot do it this way... |
| 09:11:26 | FromDiscord | <kiloneie> This is due to Image now holding subImages: Image |
| 09:39:36 | * | beholders_eye joined #nim |
| 09:51:31 | * | Jjp137 joined #nim |
| 09:54:56 | * | beholders_eye quit (Ping timeout: 256 seconds) |
| 10:13:25 | * | beholders_eye joined #nim |
| 10:15:00 | * | ainema joined #nim |
| 10:15:03 | * | ainema left #nim (#nim) |
| 10:35:44 | * | beholders_eye quit (Ping timeout: 256 seconds) |
| 11:15:41 | * | vsantana joined #nim |
| 12:06:55 | * | beholders_eye joined #nim |
| 12:33:41 | * | Alfom joined #nim |
| 12:41:59 | * | FromDiscord quit (Remote host closed the connection) |
| 12:42:12 | * | FromDiscord joined #nim |
| 12:45:29 | FromDiscord | <shigumin.> Hi, Is there any mechanism to avoid nesting when working with many seq constraints? e.g. https://github.com/waf/ZebraPuzzle/blob/master/ZebraPuzzle/Program.cs |
| 12:54:15 | * | FromDiscord quit (Remote host closed the connection) |
| 12:54:28 | * | FromDiscord joined #nim |
| 13:06:04 | FromDiscord | <demotomohiro> In reply to @shigumin. "Hi, Is there any": How about to use: https://nim-lang.org/docs/sequtils.html↵https://nim-lang.org/docs/algorithm.html |
| 13:11:01 | FromDiscord | <shigumin.> sent a code paste, see https://play.nim-lang.org/#pasty=cpKCoEJP |
| 13:12:00 | FromDiscord | <shigumin.> (edit) "https://play.nim-lang.org/#pasty=QOYbdJBD" => "https://play.nim-lang.org/#pasty=xkJYvHgd" |
| 13:12:43 | FromDiscord | <shigumin.> (edit) "https://play.nim-lang.org/#pasty=itvXWEbP" => "https://play.nim-lang.org/#pasty=sjJLLvEk" |
| 13:20:37 | FromDiscord | <shigumin.> sent a code paste, see https://play.nim-lang.org/#pasty=pCahraSZ |
| 13:22:42 | FromDiscord | <shigumin.> Probably I need to do some template magic, but I don't know how to do that yet. |
| 13:23:52 | FromDiscord | <ieltan> list comprehension ? |
| 13:26:03 | FromDiscord | <shigumin.> yeah |
| 13:30:25 | FromDiscord | <shigumin.> found out that collect macro probably could solve my problem: "Comprehension for seqs/sets/tables." |
| 14:59:11 | * | Alfom quit (Ping timeout: 250 seconds) |
| 15:33:12 | * | krunsh joined #nim |
| 16:10:23 | FromDiscord | <amun0666> Hmm. `a in [b, c, d]` is not defined if `a` is `int64` and `b`…`d` are int (int32) on js/32-bit os. |
| 16:25:30 | FromDiscord | <ieltan> In reply to @amun0666 "Hmm. `a in [b,": gonna have to `int32(a) in [b, c, d]` |
| 16:25:57 | FromDiscord | <ieltan> oh wait what if `a > max(int32)` |
| 16:27:25 | FromDiscord | <amun0666> `a in [b'i64, c, d]` |
| 16:27:39 | FromDiscord | <amun0666> That works. |
| 16:28:09 | FromDiscord | <ieltan> oh nice |
| 16:28:25 | FromDiscord | <amun0666> (edit) "[b'i64," => "[b.i64," |
| 16:28:34 | FromDiscord | <amun0666> (edited) |
| 17:18:50 | * | przmk quit (Remote host closed the connection) |
| 17:37:30 | * | Alfom joined #nim |
| 17:41:21 | * | Alfom quit (Client Quit) |
| 17:43:00 | * | przmk joined #nim |
| 18:14:43 | * | beholders_eye quit (Ping timeout: 264 seconds) |
| 18:30:14 | * | beholders_eye joined #nim |
| 18:44:18 | * | Alfom joined #nim |
| 19:37:55 | * | Alfom quit (Quit: Client closed) |
| 19:57:25 | * | Mister_Magister joined #nim |
| 19:58:04 | * | fallback quit (Read error: Connection reset by peer) |
| 19:59:27 | * | Alfom joined #nim |
| 20:02:34 | Alfom | Hi. To update a value in a seq, do I have to seq.delete(i) and seq.insert(i) or is there a shorter way? The compiler complains when I try to assign directly seq[i] = "blah" |
| 20:04:31 | FromDiscord | <nervecenter> Is your seq a `seq[string]`? |
| 20:04:36 | FromDiscord | <nervecenter> and is it `var`? |
| 20:07:46 | Alfom | it is a var seq and the types match |
| 20:09:32 | * | fallback joined #nim |
| 20:10:09 | Alfom | actually it is in a for loop |
| 20:10:40 | Alfom | for seq in list_of_seqs: |
| 20:10:40 | Alfom | if a condition is met: |
| 20:10:41 | Alfom | seq[i] = seq[i+1] |
| 20:10:56 | Alfom | so maybe the block inside the for loop renders the seq immutable |
| 20:11:08 | Alfom | ? |
| 20:14:11 | FromDiscord | <nervecenter> Are you shifting each element down by one? There is `Deque` for that, just FYI |
| 20:14:27 | FromDiscord | <nervecenter> It has a `popFront` or something like that |
| 20:14:50 | Alfom | nope just copying some values |
| 20:14:55 | ormiret | I think you want to be itterating over `list_seqs.mitems` to get mutable items |
| 20:15:17 | Alfom | I just try in a simple test file and it does work |
| 20:15:20 | FromDiscord | <nervecenter> The only reason a `seq` might be complaining is because `string` is a managed type, by default it's managed by the stack scope but maybe the move isn't able to happen properly |
| 20:15:42 | Alfom | it was not a good example, the actual seqs are float seqs |
| 20:16:26 | FromDiscord | <nervecenter> oh you know what |
| 20:16:35 | FromDiscord | <nervecenter> are you actually using the name `seq` in your loop iterator? |
| 20:16:40 | FromDiscord | <nervecenter> because `seq` is a reserved keyword |
| 20:17:03 | Alfom | i am using "sequence" |
| 20:17:15 | FromDiscord | <nervecenter> that should be fine |
| 20:18:01 | FromDiscord | <nervecenter> I think that if it works in a test file but not in context, we'd actually need to see your context or some name-stripped version of it in order to debug |
| 20:18:15 | FromDiscord | <nervecenter> Just make sure it throws the same error |
| 20:19:47 | Alfom | well no it didn't work I made a mistake, I used the original name of the test seq inside the loop |
| 20:19:54 | Alfom | not the name of the loop variable |
| 20:20:08 | Alfom | when I do that I get : expression 'seq_temp' is immutable, not 'var' |
| 20:20:28 | Alfom | even though direct assignment outside of the for loop does work |
| 20:23:45 | Alfom | https://play.nim-lang.org/#pasty=BnWDXEJt |
| 20:24:47 | Alfom | in this snippet if I swap seq_temp for myseq the code runs fine |
| 20:31:29 | FromDiscord | <nervecenter> sent a code paste, see https://play.nim-lang.org/#pasty=KDAevywY |
| 20:32:51 | FromDiscord | <nervecenter> And yes, the iterator needs give a mutable reference, so you need to use `mitems` |
| 20:32:53 | FromDiscord | <nervecenter> one second |
| 20:33:51 | Alfom | mitems over the sequence of sequences ? |
| 20:34:06 | FromDiscord | <nervecenter> yes...I need to resume this when I get home |
| 20:34:13 | FromDiscord | <nervecenter> Nested seqs are dicey |
| 20:40:55 | * | vsantana quit (Ping timeout: 256 seconds) |
| 20:44:16 | * | Alfom quit (Quit: Client closed) |
| 20:58:16 | FromDiscord | <nuitjour_82503> I'm the same person as "IRC Alfom", I logged into discord with an old account so I can see the responses even if I am offline. Thank you all for the help |
| 21:02:38 | ormiret | https://play.nim-lang.org/#pasty=ETMIAGMx |
| 21:14:57 | FromDiscord | <nuitjour_82503> Thanks! I'll try it in my code |
| 21:19:38 | FromDiscord | <nuitjour_82503> It does compile now, thanks a lot! I have other errors to fix now 😅 |
| 21:20:04 | FromDiscord | <nuitjour_82503> (execution erros) |
| 21:24:56 | * | rockcavera joined #nim |
| 21:25:49 | FromDiscord | <nuitjour_82503> in fact, the runtime error does concern the very line that just passed the compilation step. It raises : SIGSEGV: Illegal storage access. (Attempt to read from nil?) |
| 21:26:13 | FromDiscord | <nuitjour_82503> (edit) "concern" => "come from" |
| 21:33:33 | FromDiscord | <nuitjour_82503> In reply to @ormiret "https://play.nim-lang.org/#pasty=ETMIAGMx": your solution does not update the underlying seq : ↵https://play.nim-lang.org/#pasty=KZTEmEsJ |
| 21:36:23 | FromDiscord | <Elegantbeef> `mySeqs` copies `mySeq1` |
| 21:36:54 | FromDiscord | <Elegantbeef> you either want `ptr seq` or `ref seq` to achieve this and do `@[mySeq1.addr, mySeq2.addr` or do `new seq[int]` and then set them |
| 21:37:03 | * | krunsh quit (Quit: WeeChat 4.7.1) |
| 21:41:50 | FromDiscord | <nuitjour_82503> thanks! I'll try that tomorrow, I'm off for tonight (EU time) |
| 22:04:23 | FromDiscord | <shigumin.> In reply to @shigumin. "found out that collect": sadly it didn't helped me. But anyway I did it! 💪 ↵fun fact: there only a 7 solutions to zebra puzzle, including mine. so from a 4k+ peoples less than a 10 completed a whole Nim track 🤔 https://media.discordapp.net/attachments/371759389889003532/1433214910417862666/B7C812F3-4126-43C1-A902-DF889E270EB2.png?ex=6903e0e6&is=69028f66&hm=30fe9faa07a1b9e6a70a21491f916b3e5e579d08c0812ff |
| 23:51:40 | * | hygo_ quit (Ping timeout: 244 seconds) |
| 23:53:51 | * | hygo joined #nim |