<< 27-09-2024 >>

00:10:56*beholders_eye quit (Ping timeout: 255 seconds)
01:51:43*rockcavera quit (Remote host closed the connection)
02:06:45*rockcavera joined #nim
03:39:08*rockcavera quit (Remote host closed the connection)
05:01:07*ntat joined #nim
05:49:43*pbsds30 joined #nim
05:50:57*pbsds3 quit (Ping timeout: 276 seconds)
05:50:57*pbsds30 is now known as pbsds3
07:27:53*coldfeet joined #nim
07:47:01FromDiscord<TFed> The if statement can be written in one line of code?
07:47:05FromDiscord<TFed> sent a code paste, see https://play.nim-lang.org/#pasty=OZBhBQLc
07:48:15FromDiscord<TFed> i want to declare default name, in case if name is empty
07:48:33FromDiscord<TFed> i want to declare default name, in case name's empty
07:48:40FromDiscord<TFed> i want to declare default name, in case of name's empty
07:48:47FromDiscord<TFed> i want to declare default name, in case when name's empty
07:48:55Amun-Rathat's the python if syntax
07:49:07Amun-Ranim one is: if something: foo else: bar
07:49:22FromDiscord<TFed> thanks
07:49:47Amun-Raif that if is a part of larger compound statement often you'll need to put the whole if inside ()
07:50:47FromDiscord<TFed> yeah, i love it, the fact that i can return cases, if statements, try statements or whatever is crazy đŸš€â†”(<@709044657232936960_=41mun-=52a=5b=49=52=43=5d>)
07:51:11Amun-Rayes, because the last value is being returned :>
07:53:56*ntat quit (Quit: Leaving)
09:02:38*PMunch joined #nim
09:10:40*Guest84 joined #nim
09:26:03FromDiscord<alehander92> is there a way to disable warnings/hints just for third party code?
09:27:38FromDiscord<alehander92> for certain libraries?
09:27:48FromDiscord<alehander92> (edit) "libraries?" => "libraries without changing their code?"
09:28:25*Guest84 quit (Quit: Client closed)
09:31:43Amun-Rahmm, I wonder whether push + import + pop will work
10:01:33*jjido joined #nim
10:15:56*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz
)
10:18:10*beholders_eye joined #nim
11:22:00FromDiscord<alehander92> hmm
11:22:03FromDiscord<alehander92> interesting idea
11:27:09FromDiscord<alehander92> it doesnt seem to work `{.push warnings:off.} .. import .. {.pop.}` ?
11:28:38*xet7 quit (Quit: Leaving)
11:29:08Amun-Rahmm
11:58:38FromDiscord<alehander92> i can wrap the compiler and filter them out
11:58:50FromDiscord<alehander92> but i guess that would be a bit too heavyhanded
11:58:59FromDiscord<alehander92> (edit) "i can wrap the compiler ... and" added "command"
12:04:10PMunchThere's not a whole lot of things I miss from C in Nim, but the nested object instantiation is arguable better
12:04:20PMunchSince you don't have to specify the type of sub-objects
12:08:38FromDiscord<alehander92> has anyone used branch coverage for nim?
12:09:08FromDiscord<alehander92> or line coverage is usually the available with the c/system tooling
12:09:13FromDiscord<alehander92> (edit) "or ... line" added "is" | removed "is"
12:09:29FromDiscord<alehander92> In reply to @PMunch "There's not a whole": makes sense maybe
12:09:58FromDiscord<alehander92> you can use converters from tuples
12:10:01FromDiscord<alehander92> but seems hacky
12:20:40*PMunch_ joined #nim
12:20:57*PMunch quit (Killed (NickServ (GHOST command used by PMunch_)))
12:21:03*PMunch_ is now known as PMunch
12:40:02*krux02 quit (Remote host closed the connection)
12:48:19*beholders_eye quit (Ping timeout: 245 seconds)
13:11:21*beholders_eye joined #nim
13:37:18*coldfeet quit (Remote host closed the connection)
13:47:59*beholders_eye quit (Ping timeout: 260 seconds)
13:58:03*HER is now known as hernan
13:58:18*hernan is now known as HER
14:06:08*PMunch quit (Quit: Leaving)
14:13:44*lucasta joined #nim
14:23:30*beholders_eye joined #nim
14:32:06*ntat joined #nim
15:39:19FromDiscord<blashyrk> sent a code paste, see https://play.nim-lang.org/#pasty=IFOTPmrW
15:42:51FromDiscord<xtrayambak> In reply to @blashyrk "Is there any way": Have you tried `myProc[string]()`?
15:43:01FromDiscord<xtrayambak> That should work
15:46:37FromDiscord<blashyrk> I tried but it doesn't :/ ↔It only works if I explicitly pass the typedesc to the template/proc, which is what I want to avoid
15:46:39FromDiscord<alehander92> @arnetheduck do you know why results/json-serialization fails
15:47:04FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#pasty=HGNFEMIQ
15:47:36FromDiscord<xtrayambak> In reply to @blashyrk "I tried but it": Works for me, weird
15:47:43FromDiscord<xtrayambak> What Nim version are you on?
15:47:54FromDiscord<alehander92> with decode on nim 2.0.2? it seems this bug should be fixed
15:48:04FromDiscord<alehander92> (edit) "fails" => "fails↔↔with decode on nim 2.0.2? it seems this bug should be fixed"
15:49:41FromDiscord<blashyrk> In reply to @xtrayambak "Have you tried `myProc[string]()`?": Nim 2.0.8
15:50:25FromDiscord<xtrayambak> sent a code paste, see https://play.nim-lang.org/#pasty=EOEEVRTd
15:51:03FromDiscord<blashyrk> Yeah that works but my proc has params and I call it via `firstParam.proc(secondParam)` and in that scenario I cannot pass it the generic explicitly for some reason
15:51:07FromDiscord<xtrayambak> ah
15:51:25FromDiscord<odexine> `firstParam.proc[:Type](secondParam)`
15:51:28FromDiscord<xtrayambak> sent a code paste, see https://play.nim-lang.org/#pasty=sqVZlBKd
15:51:29FromDiscord<xtrayambak> try this
15:51:47FromDiscord<odexine> please try what i proposed first
15:52:14FromDiscord<demotomohiro> In reply to @blashyrk "Yeah that works but": https://nim-lang.org/docs/manual.html#templates-limitations-of-the-method-call-syntax
15:52:45FromDiscord<demotomohiro> In reply to @blashyrk "Yeah that works but": Sorry, please read this one:https://nim-lang.org/docs/manual.html#procedures-method-call-syntax
15:53:16FromDiscord<blashyrk> Oh I see, thanks
15:53:49FromDiscord<alehander92> @arnetheduck that's a hard decision https://github.com/status-im/nim-serialization/pull/59 : if we have many variant objects, is there any way to prevent boilerplate? suddenly one needs to write a ton of code for json support, is there any way to just hint the order without need of full custom readValue?
15:56:48FromDiscord<blashyrk> Still I suppose there's no way to infer this from just the `let` binding's type?
15:57:52FromDiscord<demotomohiro> yes
15:58:39FromDiscord<blashyrk> đŸ˜Šâ†”â†”Thanks in any case!
16:00:37FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#pasty=GKJhqDcP
16:07:07FromDiscord<blashyrk> Does anyone know what the `as` keyword compiles to? Is it just a shorthand for `cast[T]` ? I can't find anything about it in the manual
16:11:04FromDiscord<demotomohiro> `as` keyword used in import statement?↔https://nim-lang.org/docs/manual.html#modules-module-names-in-imports
16:12:16FromDiscord<blashyrk> No, like `let a = someVar as SomeType`
16:13:22FromDiscord<blashyrk> Oh nvm lol it is defined in the codebase I'm working in đŸ€Šâ€â™‚ïž , disregard pls
16:14:36FromDiscord<xtrayambak> In reply to @blashyrk "~~Does anyone know what": No, it's used for import keywords
16:14:43FromDiscord<xtrayambak> you might be getting it mixed with Rust's `as` keyword
16:15:03FromDiscord<blashyrk> Yeah there's also a template defined in this codebase but I got syntax highlighting as it is also a keyword lol
16:15:06FromDiscord<blashyrk> So I thought it was built-in
16:15:37FromDiscord<xtrayambak> haha, templates and macros are deceiving :^)
16:16:36FromDiscord<demotomohiro> https://nim-lang.org/docs/manual.html#lexical-analysis-operators↔It seems `as` can be used as an operator.
16:17:49FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#pasty=FdENJeev
16:18:00FromDiscord<xtrayambak> that's just stropping...
16:18:04FromDiscord<xtrayambak> (edit) "stropping..." => "stropping combined with UFCS..."
16:18:17FromDiscord<demotomohiro> It compiles without error.
16:21:14FromDiscord<xtrayambak> Yes, it should
16:23:13FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#pasty=eAFHszIQ
16:39:05*lucasta quit (Quit: Leaving)
16:51:37*coldfeet joined #nim
18:04:29*ursa-major_ joined #nim
18:10:30*ursa-major quit (*.net *.split)
18:10:30*end quit (*.net *.split)
18:10:31*dza quit (*.net *.split)
18:10:32*tanami quit (*.net *.split)
18:10:32*lucerne quit (*.net *.split)
18:10:39*ursa-major_ is now known as ursa-major
18:11:12*end joined #nim
18:11:12*dza joined #nim
18:11:12*tanami joined #nim
18:11:12*lucerne joined #nim
18:11:36FromDiscord<leorize> nim has a lot of word operators and all of them can be binary
18:11:37FromDiscord<leorize> except `not`
18:45:53*ntat quit (Quit: Leaving)
18:52:35*derpydoo joined #nim
19:06:37*derpydoo quit (Quit: derpydoo)
19:26:34*xet7 joined #nim
19:39:25*coldfeet quit (Quit: leaving)
19:54:14FromDiscord<rakgew> sent a code paste, see https://play.nim-lang.org/#pasty=gePpqVQZ
19:56:23FromDiscord<rakgew> nvm found a way via mapit \:-D
20:01:13FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=GesKUaxI
20:01:48FromDiscord<Elegantbeef> `Outlet.low.ord..Outlet.high.ord` whoops
20:36:32FromDiscord<srmordred> importing `chronos` on my project adds like 4 seconds to its compile time. it is expected ?
20:36:51FromDiscord<Elegantbeef> Probably
21:19:06*rockcavera joined #nim