<< 26-09-2024 >>

00:37:37*lucasta joined #nim
00:48:18*arkanoid quit (Ping timeout: 246 seconds)
00:49:31*arkanoid joined #nim
00:50:13*krux02 quit (Remote host closed the connection)
03:14:08*lucasta quit (Quit: Leaving)
03:52:35*SchweinDeBurg joined #nim
03:53:49*rockcavera quit (Remote host closed the connection)
04:35:35*wikipedia joined #nim
06:32:22*PMunch joined #nim
07:23:57*jjido joined #nim
08:04:49*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
09:59:18*beholders_eye joined #nim
11:58:01*SchweinDeBurg quit (Quit: WeeChat 4.5.0-dev)
12:23:09FromDiscord<kartoffelaim> sent a code paste, see https://play.nim-lang.org/#pasty=gRgQvtJI
12:23:29*ryuukk quit (Remote host closed the connection)
12:26:26*ryuukk joined #nim
12:31:51FromDiscord<nnsee> In reply to @kartoffelaim "Hello i am kind": you want to use `when` instead of `if`
12:31:52FromDiscord<nnsee> https://play.nim-lang.org/#pasty=JBPUBQXe
12:32:53FromDiscord<arm_3_d> and why not just make overloaded `prettyEchoSeq`?
12:42:09*lucasta joined #nim
12:48:23FromDiscord<nnsee> In reply to @nnsee "https://play.nim-lang.org/#pasty=JBPUBQXe": (cleaned version): https://play.nim-lang.org/#pasty=uLbrOMUc, and as @arm_3_d suggested with overloads: https://play.nim-lang.org/#pasty=rEAiXmUF
12:49:51FromDiscord<arm_3_d> In reply to @nnsee "(cleaned version): https://play.nim-lang.org/#pasty": also I believe auto includes all types? but echo accepts only types which are supports `$`? ↵`proc echo(x: varargs[typed, `$`])`
12:49:51FromDiscord<nnsee> (interestingly, it isn't overloaded when you use openArray https://play.nim-lang.org/#pasty=LpFZtJnq)
12:49:55*ryuukk quit (Ping timeout: 264 seconds)
12:50:03FromDiscord<nnsee> In reply to @arm_3_d "also I believe auto": indeed
12:50:09*ryuukk joined #nim
12:50:24FromDiscord<arm_3_d> right, stdlib uses openArray, so maybe just replace seq with it
12:52:03FromDiscord<nnsee> well the issue is that for some reason, the compiler doesn't consider openArray to be more specific than a catch-all generic
12:52:29FromDiscord<nnsee> so the openArray proc is never called
12:53:01FromDiscord<kartoffelaim> In reply to @nnsee "https://play.nim-lang.org/#pasty=JBPUBQXe": damn, i knew it was something i had missed. Thank you so much that worked 🙂
12:53:59FromDiscord<nnsee> In reply to @kartoffelaim "damn, i knew it": and for reference, `if` is a runtime construct and `when` is compile-time, which is where generics (or `auto` in your case) are expanded
12:54:06FromDiscord<nnsee> or whatever the technical term is for it
12:56:34FromDiscord<kartoffelaim> thats good to know!
13:23:03*wikipedia quit (Read error: Connection reset by peer)
13:23:55*wikipedia joined #nim
13:24:01*coldfeet joined #nim
13:34:40*coldfeet quit (Remote host closed the connection)
14:04:27*PMunch quit (Quit: Leaving)
14:15:49*dvbst joined #nim
14:21:11*ryuukk quit (Remote host closed the connection)
14:22:37*ryuukk joined #nim
14:24:00FromDiscord<nocturn9x> how does one handle EOF? Specifically, after I catch `EOFError`, I should call `clearerr(f)` (`f` being `stdin` here), but I can't find the implementation anywhere
14:24:06FromDiscord<nocturn9x> do I need to `importc` it?
14:25:33FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=ynYotaoG
14:37:35*SchweinDeBurg joined #nim
15:02:28*wikipedia quit (Read error: Connection reset by peer)
15:03:04*wikipedia joined #nim
15:04:38*fallback quit (Ping timeout: 255 seconds)
15:16:32*fallback joined #nim
15:55:02*beholders_eye quit (Ping timeout: 255 seconds)
16:00:05*ntat joined #nim
16:07:44*beholders_eye joined #nim
16:10:26Amun-Radepends, usually there's no need to clear that
16:11:29Amun-RacheckErr from std/syncio does that automagically
16:16:30Amun-Raespecially for stdin
16:26:45*lucasta quit (Quit: Leaving)
16:35:26*xtr00 joined #nim
16:39:42xtr00https://play.nim-lang.org/#pasty=lLzYLtZG does not work with --os:standalone
16:39:50xtr00Error: system module needs: getCurrentException
16:40:01xtr00a bug?
16:41:16Amun-Rawhy not https://nim-lang.org/docs/parseutils.html#parseInt%2CopenArray%5Bchar%5D%2Cint then?
16:42:54FromDiscord<metagngn> a general alternative to `--os:standalone` is `--os:any` with `-d:useMalloc`
16:46:27FromDiscord<xkonti> Is there a ready-made way to load half, single and double precision floating values from a byte sequence? I'm expecting that for single and double I could just copyMem from sequence to a float32/float64, but what about the half precision?
16:46:40xtr00avoiding the exception with parseutils is good and avoids the issue
16:46:43FromDiscord<xkonti> (edit) "Is there a ready-made way to load half, single and double precision floating values from a byte sequence? I'm expecting that for single and double I could just copyMem from ... sequence" added "a"
16:47:32Amun-Racast/union for single and double
16:47:45xtr00--os:standalone because this is baremetal embedded, I dont know if os:any will do it.
16:49:15Amun-Rahttps://play.nim-lang.org/#pasty=mSvsobyh mind the endianness
16:52:32Amun-Rathis is the C way: https://play.nim-lang.org/#pasty=kKtUgdkV
16:53:20Amun-Ra(that won't work in js target)
16:56:36Amun-Rahalf precision is non-standard, you'll have to hunt for 3rd party library
17:04:26FromDiscord<basilajith> Is there something like Go's and Typescript's `interface` in Nim?
17:06:22FromDiscord<xkonti> sent a code paste, see https://play.nim-lang.org/#pasty=nQimAztz
17:06:53*xtr00 quit (Read error: Connection reset by peer)
17:08:06Amun-Raxkonti: look at std/endians (swapEndian32 ad friends)
17:08:09Amun-Raand*
17:08:21FromDiscord<xkonti> Yup
17:08:27Amun-Rabasilajith: there are concepts and good old objects with function pointers
17:12:28*xtr00 joined #nim
17:23:59*xtr00 quit (Read error: Connection reset by peer)
17:29:47*xtr00 joined #nim
17:39:10*xtr00 quit (Read error: Connection reset by peer)
17:43:10*xtr00 joined #nim
18:04:38*xtr00 quit (Read error: Connection reset by peer)
18:04:53FromDiscord<TFed> sent a code paste, see https://play.nim-lang.org/#pasty=fULwFuXB
18:05:55FromDiscord<TFed> sent a code paste, see https://play.nim-lang.org/#pasty=iveHucAS
18:06:25FromDiscord<TFed> sent a code paste, see https://play.nim-lang.org/#pasty=aAVJclZt
18:09:50Amun-Rayes
18:10:20FromDiscord<demotomohiro> You can use `&` for both string expressions and string literals.
18:10:31*xtr00 joined #nim
18:14:25FromDiscord<blashyrk> sent a code paste, see https://play.nim-lang.org/#pasty=aFqhbnDS
18:17:12*xtr00 quit (Read error: Connection reset by peer)
18:20:44*jjido joined #nim
18:22:08*ntat quit (Quit: Leaving)
18:22:44*xtr00 joined #nim
18:28:10FromDiscord<rakgew> sent a code paste, see https://play.nim-lang.org/#pasty=jwsAozpB
18:31:34Amun-Rahttps://play.nim-lang.org/#pasty=eifRgxwt
18:36:46*xtr00 quit (Read error: Connection reset by peer)
18:39:04FromDiscord<leorize> make it `array[1..4, ...]`
18:39:04FromDiscord<rakgew> \\o/ yay - that works!↵thank you leorize (@leorize\:envs.net)
18:39:21FromDiscord<leorize> yw
18:39:22FromDiscord<leorize> nim array index is a `range[T]`
18:40:33FromDiscord<leorize> with sugar for `n` -\> `0..n-1`
18:40:34FromDiscord<leorize> so you can specify any range of ordinals that you wish, including enums
18:42:02*xtr00 joined #nim
18:44:27FromDiscord<rakgew> right - I love these enum-index arrays!
18:44:28*dvbst quit (Remote host closed the connection)
18:44:39FromDiscord<metagngn> In reply to @blashyrk "Hi! Is this": this is a bug, only the [colon expressions](https://github.com/nim-lang/Nim/blob/a27542195c9ba760d58e9d1e977313bc322a1ede/compiler/semtempl.nim#L543) are checked for some reason
18:46:07FromDiscord<rakgew> I actually started with enum-indexed array, but since the power outlet numbers are actually just plain old 1..4 integers I abandoned the enum in this case.
19:03:17*xtr00 quit (Read error: Connection reset by peer)
19:03:29FromDiscord<blashyrk> In reply to @metagngn "this is a bug,": Thanks! Should I report it somewhere?
19:04:02*beholders_eye quit (Ping timeout: 255 seconds)
19:07:46*xtr00 joined #nim
19:12:54FromDiscord<metagngn> you can on the issue tracker, I can also report it if you want: <https://github.com/nim-lang/Nim/issues>
19:14:36*oprypin_ joined #nim
19:14:37*xtr00 quit (Read error: Connection reset by peer)
19:19:31*ryuukk quit (*.net *.split)
19:19:33*oprypin quit (*.net *.split)
19:19:33*cnx quit (*.net *.split)
19:19:33*def- quit (*.net *.split)
19:19:33*nisstyre quit (*.net *.split)
19:20:20*ryuukk joined #nim
19:20:20*cnx joined #nim
19:20:20*def- joined #nim
19:20:20*nisstyre joined #nim
19:24:35*xtr00 joined #nim
19:31:08*xtr00 left #nim (WeeChat 4.4.1)
19:39:14FromDiscord<kiloneie> is there a way to include all files of a folder like something like this `include objects/[..]` ? Or do i have to use a loop ?
19:40:27FromDiscord<blashyrk> In reply to @metagngn "you can on the": If it's not too much trouble, please do. I doubt I could make a better issue description in this instance than you 🙏
19:46:09*wikipedia quit (Ping timeout: 246 seconds)
19:48:53*coldfeet joined #nim
19:51:28FromDiscord<k7v.> Hi is there any way to use rewasd free?
19:57:42*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
20:15:16*coldfeet quit (Remote host closed the connection)
20:24:38FromDiscord<leorize> wrong room for that
20:36:12FromDiscord<kiloneie> Never been in the "controller on pc" camp. Wish i could remap my xtrfy mouse... anyways.
20:38:38Amun-Rasubscription for remapper? I'll pass…
21:32:33*om3ga quit (Ping timeout: 246 seconds)
21:56:56*rockcavera joined #nim
22:05:29*beholders_eye joined #nim
22:45:36*krux02 joined #nim
23:55:00*FromDiscord quit (Remote host closed the connection)
23:55:13*FromDiscord joined #nim