00:23:02 | * | krux02 quit (Remote host closed the connection) |
00:31:04 | NimEventer | New thread by Cmc: Announce: LimDB, a fast, persistent table with LMDB under the hood, see https://forum.nim-lang.org/t/9210 |
00:53:17 | FromDiscord | <👾 br4n_d0n> How do you get the length of a tuple? |
00:53:55 | FromDiscord | <Elegantbeef> `typetraits.len` |
00:53:58 | FromDiscord | <Elegantbeef> sorry `tupleLen` |
00:54:27 | FromDiscord | <Elegantbeef> They're static sized so it doesnt serve much purpose but it's there |
00:55:25 | FromDiscord | <👾 br4n_d0n> Well, I'm sending in a tuple to a proc that accepts a generic so I may not know the length |
00:55:52 | FromDiscord | <Elegantbeef> Generics arent type erased |
00:56:30 | FromDiscord | <👾 br4n_d0n> Huh? |
00:57:31 | FromDiscord | <Elegantbeef> Generic procedures generic parameters are known at instantiation so there is no lost information |
01:00:25 | FromDiscord | <Elegantbeef> Code example of what youre doing would be great |
01:04:34 | FromDiscord | <👾 br4n_d0n> sent a code paste, see https://paste.rs/lrB |
01:04:55 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3ZuG |
01:06:03 | FromDiscord | <👾 br4n_d0n> (edit) "https://paste.rs/Lzs" => "https://play.nim-lang.org/#ix=3ZuH" |
01:08:10 | FromDiscord | <👾 br4n_d0n> Can you explain why you used when in this instance? |
01:08:28 | FromDiscord | <Elegantbeef> `when` is for compile time |
01:08:43 | FromDiscord | <👾 br4n_d0n> ah |
01:11:44 | FromDiscord | <👾 br4n_d0n> Well, since I have your attention @ElegantBeef how would I go about forcing `` val `` to be a tuple of 3 values? |
01:15:49 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/d76 |
01:15:50 | FromDiscord | <Elegantbeef> Think that should work |
01:16:59 | FromDiscord | <Rika> I noticed https://forum.nim-lang.org/profile/georgeethan got marked as spammer |
01:17:06 | FromDiscord | <Rika> Was this automated or intentional? |
01:39:22 | FromDiscord | <👾 br4n_d0n> What would be the best way to iterate over all of a proc's parameters? |
01:41:18 | FromDiscord | <huantian> Uh don’t? |
01:41:27 | FromDiscord | <huantian> Maybe use a varargs? |
01:42:43 | FromDiscord | <Elegantbeef> If you really need to a macro is the best bet |
01:46:56 | FromDiscord | <👾 br4n_d0n> sent a code paste, see https://play.nim-lang.org/#ix=3ZuL |
01:47:05 | FromDiscord | <Elegantbeef> Yes like huan said varargs |
01:47:47 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3ZuM |
01:48:40 | FromDiscord | <👾 br4n_d0n> But won't that allow max to accept less than or more than 4? |
01:48:53 | FromDiscord | <Elegantbeef> Yes |
01:49:13 | FromDiscord | <👾 br4n_d0n> I'm trying to force it to be exactly 4 |
01:49:40 | FromDiscord | <Elegantbeef> Sounds like manual code |
01:49:45 | FromDiscord | <👾 br4n_d0n> lol |
01:50:02 | FromDiscord | <👾 br4n_d0n> I was hoping for language sugar |
01:50:26 | FromDiscord | <huantian> You can do varargs and assert the length ig |
01:50:33 | FromDiscord | <huantian> But that won’t be compile time |
01:50:39 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/v84 |
01:50:54 | FromDiscord | <Elegantbeef> Like i said you can use a macro if you musst |
01:51:01 | FromDiscord | <Elegantbeef> But it's just a "why would you want to" |
01:51:49 | FromDiscord | <👾 br4n_d0n> So does the assert make it a macro? |
01:51:56 | FromDiscord | <Elegantbeef> No |
01:52:08 | FromDiscord | <Elegantbeef> Macros are how Nim does deep introspection |
01:58:47 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/vim |
01:58:55 | FromDiscord | <Elegantbeef> replace `in` with the module name if you're running it |
02:00:58 | FromDiscord | <Elegantbeef> Can do it smarter now that i think about it |
02:04:22 | FromDiscord | <👾 br4n_d0n> Yeah, you weren't kidding; that's overly complicated for this unless I "really" needed it |
02:04:51 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/MMb |
02:07:46 | FromDiscord | <Elegantbeef> The thing about Nim though is you can relatively easily get sugar if you know what you're doing 😄 |
02:09:53 | FromDiscord | <👾 br4n_d0n> That's the problem though, I don't know what I'm doing 😆 |
02:14:29 | FromDiscord | <Elegantbeef> Yep until you know what you're doing you should stay away from macros |
02:14:51 | FromDiscord | <Elegantbeef> Like patito the other day was using a macro instead of a template for no reason aside from "macro do the dew" |
02:17:08 | FromDiscord | <👾 br4n_d0n> Lol, that's kind of like "when in doubt, use a macro" |
02:17:22 | FromDiscord | <Elegantbeef> Yea dont do that |
02:18:23 | FromDiscord | <Elegantbeef> You can do a lot of introspection with just procedures, so simplest tool is best |
02:19:48 | FromDiscord | <👾 br4n_d0n> Hopefully I'll be able to get to a point where I can understand all of this with relative ease, but until then, I appreciate everyone putting up with me |
03:17:11 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "Like patito the other": beef...↵this code is too cursed https://github.com/Patitotective/ImThemes/blob/main/src/editview.nim#L261↵i dont know what to do |
03:17:39 | * | arkurious quit (Quit: Leaving) |
03:20:25 | FromDiscord | <Elegantbeef> Jesus fucking christ |
03:20:27 | FromDiscord | <Elegantbeef> You know you can do for loops right? 😄 |
03:20:39 | FromDiscord | <Elegantbeef> The bottom half of that just iterates over the enum values |
03:21:00 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "The bottom half of": smart |
03:22:33 | FromDiscord | <Elegantbeef> the top half seems to mostly be `for x in app.prevThemeStyle.fields: when x is float32` |
03:23:45 | FromDiscord | <!Patitotective> hmmmm, since i dont want all fields i could define an array with the ones i want and filter it 🤔 |
03:23:49 | FromDiscord | <!Patitotective> (edit) "it" => "them" |
03:27:10 | FromDiscord | <Elegantbeef> or you know `for name, val in app.prevThemeStyle.fieldPairs: when name in ["alpha", "disabledAlpha", "windowPadding", ..]` |
03:27:20 | FromDiscord | <Elegantbeef> Yes |
04:24:43 | * | rockcavera quit (Remote host closed the connection) |
06:10:31 | NimEventer | New thread by AMoura: Understand C++ binding with OpenCV., see https://forum.nim-lang.org/t/9211 |
06:50:03 | FromDiscord | <IzanamiのMegumi> var's cant start with a number, right? |
06:50:12 | FromDiscord | <IzanamiのMegumi> I tried naming mine 1Number and it didnt work |
06:50:27 | FromDiscord | <Elegantbeef> numbers are an invalid symbol starting character |
06:50:28 | FromDiscord | <Elegantbeef> same with `_` |
06:50:41 | FromDiscord | <IzanamiのMegumi> yeah I figured that out |
06:51:28 | FromDiscord | <IzanamiのMegumi> just did the calculator thing |
06:51:32 | FromDiscord | <IzanamiのMegumi> pretty cool |
06:55:39 | FromDiscord | <Tuatarian> not a nim question but |
06:56:00 | FromDiscord | <Tuatarian> if I have an array of length 5 with entries either 0, 1 or 2, how do I generate all permutations of that array? |
06:56:22 | FromDiscord | <Tuatarian> counting them is not hard, but I'm not sure how to go about generating them efficiently |
06:56:31 | FromDiscord | <Elegantbeef> Nim has permutations in algorithim iirc |
06:56:43 | FromDiscord | <Tuatarian> oh didn't even bother to check lmao |
06:57:04 | * | xet7 joined #nim |
06:57:22 | FromDiscord | <Tuatarian> oh I see this |
06:57:37 | FromDiscord | <Tuatarian> I know how to do this but my problem is slightly different I think |
06:57:52 | FromDiscord | <Tuatarian> unless... |
06:58:41 | FromDiscord | <Tuatarian> can I just do array of `[0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2]`, iterate through all permutations, take just the first 5 elems, and remove all duplicates? |
06:59:10 | FromDiscord | <Tuatarian> this could happen at compile time theoretically so speed should be not an issue |
06:59:15 | FromDiscord | <Tuatarian> but is there a better way? |
07:00:34 | NimEventer | New Nimble package! fidgetty - Widget library built on Fidget written in pure Nim and OpenGL rendered, see https://github.com/elcritch/fidgets |
07:04:19 | FromDiscord | <Elegantbeef> `deduplicate` |
07:25:42 | FromDiscord | <Tuatarian> right but you're still wasting a lot of computations right? |
07:26:05 | FromDiscord | <Tuatarian> 15! >>> 3^5 |
07:26:29 | FromDiscord | <Tuatarian> even ignoring the deduplication |
07:26:32 | FromDiscord | <Elegantbeef> You can do it at compile time |
07:26:46 | FromDiscord | <Tuatarian> in this case yeah |
07:27:02 | FromDiscord | <Elegantbeef> I dont even get what you're doing |
07:27:10 | FromDiscord | <Elegantbeef> Why is your data set repeating the same numbers multiple time |
07:27:18 | FromDiscord | <Tuatarian> antiwordle solver |
07:27:31 | FromDiscord | <Tuatarian> 0 = grey, 1 = yellow, 2 = red/green |
07:27:43 | FromDiscord | <Tuatarian> but I think this could show up in more general cases |
07:28:19 | FromDiscord | <Tuatarian> the abstract question ig is if I hve an array of n elements where each element is an integer in 0..m, how can I generate all states of that array efficiently? |
07:28:39 | FromDiscord | <Tuatarian> in this particular case I can just do it at compile time so I don't have to think about it too much |
07:28:44 | FromDiscord | <Elegantbeef> You use the permutations from algorithims |
07:28:58 | FromDiscord | <Tuatarian> doesn't permutations find all orders of a set? |
07:29:23 | FromDiscord | <Tuatarian> the array can be `[0, 0, 0, 0, 0]` or `[2, 2, 2, 2, 2]` or anything in between |
07:29:26 | FromDiscord | <Tuatarian> not all elements need to appear |
07:29:26 | FromDiscord | <Elegantbeef> Yes |
07:29:54 | FromDiscord | <Tuatarian> not sure if there's a better way to do this particular problem but I fee like there has to be |
07:32:05 | FromDiscord | <Elegantbeef> > not all elements need to appear↵This makes no sense |
07:32:19 | FromDiscord | <Tuatarian> ok so I have an array of length 5 |
07:32:24 | FromDiscord | <Tuatarian> elements are some enum |
07:33:05 | FromDiscord | <Tuatarian> I want to find all configs of that array for all values of that enum |
07:33:16 | FromDiscord | <Tuatarian> I'm explaining this badly I think |
07:34:00 | FromDiscord | <Tuatarian> lets say I have an array of length 2 who's values are either 0 or 1 |
07:34:10 | FromDiscord | <Tuatarian> I want to find all possible states of that array / all permutations of that array |
07:34:33 | FromDiscord | <Tuatarian> so `[0, 0]` `[1, 0]` `[1, 1]` `[0, 1]` |
07:34:57 | FromDiscord | <Tuatarian> neither 0 nor 1 necessarily have to appear in the array |
07:35:37 | FromDiscord | <Elegantbeef> That's not really a permutation, that's all valid collections, there is probably a proper term but idk |
07:35:54 | FromDiscord | <Tuatarian> sure |
07:36:19 | FromDiscord | <Tuatarian> not super sure of the correct terminology |
07:37:26 | * | jjido joined #nim |
07:41:53 | FromDiscord | <NimYT> hm |
07:42:14 | FromDiscord | <Elegantbeef> Hm indeed |
07:42:25 | FromDiscord | <NimYT> i just type my name |
07:42:29 | FromDiscord | <NimYT> on the invite link |
07:42:33 | FromDiscord | <NimYT> and this appears |
07:42:52 | FromDiscord | <NimYT> Hmmmmm what is this server for? |
07:43:00 | FromDiscord | <Elegantbeef> The Nim programming langauge |
07:43:14 | FromDiscord | <Tuatarian> lmao |
07:43:28 | FromDiscord | <NimYT> ok |
07:43:33 | FromDiscord | <Tuatarian> it's a good programming langauge |
07:43:41 | FromDiscord | <NimYT> i must say i am not disappointed |
07:44:08 | FromDiscord | <Tuatarian> also beef you migrated to irc? |
07:44:15 | FromDiscord | <Elegantbeef> No matrix |
07:44:18 | FromDiscord | <Tuatarian> oh I see |
07:44:22 | FromDiscord | <Tuatarian> why? |
07:44:29 | FromDiscord | <Elegantbeef> Cause discord is fucking shit? |
07:44:35 | FromDiscord | <Tuatarian> it is? |
07:44:50 | FromDiscord | <Tuatarian> I just don't have the desktop app installed so it doesn't bombard me with noises |
07:44:53 | FromDiscord | <Elegantbeef> Proprietary software that has no interest in allowing you have control |
07:44:55 | FromDiscord | <Tuatarian> web ver is fine for me at least |
07:45:09 | FromDiscord | <Tuatarian> fair |
07:45:37 | FromDiscord | <Tuatarian> I'm not a super foss guy though, don't mind proprietary software inherently but lack of control is irritating |
07:49:41 | FromDiscord | <Elegantbeef> Anyway you just do the good old switch a flag per each element |
07:50:32 | FromDiscord | <Elegantbeef> I'm too tired to write the actual code, but yea iterate over each row moving throw each element then each child element until you get to the end |
07:55:07 | FromDiscord | <Tuatarian> oh I see |
07:55:35 | FromDiscord | <Tuatarian> wow that's an apcs level easy question no idea why I didn't come up with that lmao |
07:55:46 | FromDiscord | <Tuatarian> (edit) |
08:00:41 | FromDiscord | <d4rckh> How do you handle uploading files from IRC? |
08:00:45 | FromDiscord | <d4rckh> and viewing |
08:00:52 | FromDiscord | <d4rckh> I think this is offtopic |
08:00:53 | FromDiscord | <Elegantbeef> URLs |
08:01:03 | FromDiscord | <d4rckh> i see |
08:01:18 | FromDiscord | <d4rckh> do you use one of those screenshot utilities that upload your picture as soon as you take it?, |
08:01:21 | FromDiscord | <d4rckh> (edit) "it?," => "it?" |
08:01:30 | FromDiscord | <Elegantbeef> I dont use IRC |
08:01:32 | FromDiscord | <Elegantbeef> So nope |
08:04:14 | FromDiscord | <d4rckh> I might give it a try |
08:04:59 | madprops | i don't see any image links here |
08:12:21 | FromDiscord | <d4rckh> https://media.discordapp.net/attachments/371759389889003532/983282182166577202/logo.svg |
08:13:41 | madprops | "XML Parsing Error: no root element found" |
08:36:11 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
09:10:32 | * | toluene quit (Ping timeout: 255 seconds) |
09:13:01 | * | toluene joined #nim |
09:26:17 | * | krux02 joined #nim |
09:27:40 | * | sagax quit (Read error: Connection reset by peer) |
09:36:52 | * | vicecea quit (Remote host closed the connection) |
09:37:22 | * | vicecea joined #nim |
09:38:01 | FromDiscord | <Andreas> sent a code paste, see https://play.nim-lang.org/#ix=3Zwe |
09:38:27 | FromDiscord | <Andreas> (edit) "https://play.nim-lang.org/#ix=3Zwe" => "https://paste.rs/MOv" |
09:38:36 | FromDiscord | <Andreas> (edit) "https://play.nim-lang.org/#ix=3Zwf" => "https://paste.rs/E1k" |
09:42:01 | FromDiscord | <demotomohiro> #define` |
09:42:59 | FromDiscord | <demotomohiro> `#define` macros dont exist in shared library. |
09:44:15 | FromDiscord | <demotomohiro> It is preprocessor macros. |
09:44:59 | FromDiscord | <Andreas> @demotomohiro c2nim ? to the rescue ? |
09:46:21 | * | PMunch joined #nim |
09:46:33 | FromDiscord | <demotomohiro> I don't know whether c2nim supports preprocessor macros. |
09:48:20 | FromDiscord | <Andreas> prbly. https://github.com/nim-lang/c2nim/blob/master/doc/c2nim.rst#id19 there is a #def-directive , ty i'll try that |
09:48:33 | FromDiscord | <Andreas> (edit) "#def-directive" => "`#def-directive`" |
10:12:13 | FromDiscord | <retkid> ]check |
10:12:17 | FromDiscord | <retkid> ]check |
10:33:58 | * | jmdaemon quit (Ping timeout: 244 seconds) |
10:50:12 | * | PMunch quit (Quit: leaving) |
11:00:50 | NimEventer | New Nimble package! cdecl - Nim helper for using C Macros, see https://github.com/elcritch/cdecl |
11:21:12 | * | adium quit (Ping timeout: 246 seconds) |
11:33:25 | FromDiscord | <System64 ~ Flandre Scarlet> does Nim's JSON parser support arrays? |
11:38:32 | * | sagax joined #nim |
11:48:52 | FromDiscord | <Yardanico> what |
12:10:03 | * | jjido joined #nim |
12:25:23 | * | vicecea quit (Remote host closed the connection) |
12:25:51 | * | vicecea joined #nim |
12:49:27 | * | arkurious joined #nim |
13:02:19 | * | kayabaNerve_ joined #nim |
13:04:10 | * | kayabaNerve quit (Ping timeout: 240 seconds) |
13:22:46 | * | adium joined #nim |
13:31:52 | FromDiscord | <d4rckh> In reply to @System64 "does Nim's JSON parser": yes you can create one like this `let jsonArray = %[]` and append other json nodes to it using add: `jsonArray.add %{"id": 0}` |
13:56:51 | * | vicfred joined #nim |
14:00:18 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
14:24:12 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3Zx8 |
14:24:14 | FromDiscord | <d4rckh> im using pixie for |
14:24:17 | FromDiscord | <d4rckh> (edit) "im using pixie for ... " added "saving a screenshot" |
14:24:29 | FromDiscord | <d4rckh> im not sure what the reason is |
14:24:34 | FromDiscord | <d4rckh> but it wont save anything |
14:24:43 | FromDiscord | <d4rckh> and the function will basically running at writeLine |
14:24:46 | FromDiscord | <d4rckh> like it wont run any code past it |
14:24:49 | FromDiscord | <d4rckh> no errors thrown |
14:25:52 | FromDiscord | <d4rckh> (edit) "https://play.nim-lang.org/#ix=3Zx8" => "https://play.nim-lang.org/#ix=3Zx9" |
14:25:56 | FromDiscord | <d4rckh> (edit) "https://play.nim-lang.org/#ix=3Zx9" => "https://play.nim-lang.org/#ix=3Zxa" |
14:34:11 | FromDiscord | <d4rckh> actually, it gets stuck forever at decodeImage |
14:38:08 | * | xet7 quit (Remote host closed the connection) |
15:05:13 | * | rockcavera joined #nim |
15:05:13 | * | rockcavera quit (Changing host) |
15:05:13 | * | rockcavera joined #nim |
15:21:08 | * | caliente00 is now known as firq |
15:21:18 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @d4rckh "yes you can create": and can I turn it into a seq or something? |
15:21:45 | FromDiscord | <d4rckh> yes |
15:21:50 | FromDiscord | <d4rckh> loop it and create it |
15:22:42 | FromDiscord | <System64 ~ Flandre Scarlet> ah alright |
15:22:51 | FromDiscord | <System64 ~ Flandre Scarlet> impossible to cast? |
15:24:27 | FromDiscord | <Yardanico> In reply to @System64 "impossible to cast?": "cast" is only used for unsafe operations to treat memory bits as some other type |
15:24:36 | FromDiscord | <Yardanico> but yes just use https://nim-lang.org/docs/json.html#getElems%2CJsonNode%2Cseq%5BJsonNode%5D |
15:24:48 | FromDiscord | <Yardanico> and if you want to get a seq of native nim types, use it together with mapIt or something |
15:27:37 | FromDiscord | <System64 ~ Flandre Scarlet> oh alright |
15:28:02 | FromDiscord | <System64 ~ Flandre Scarlet> and then using a loop would be simpler |
15:45:51 | FromDiscord | <Zoom> Do we have any TUI widget libraries besides jjv360/nim-termui ? I need a selectable list. |
15:48:34 | FromDiscord | <Yardanico> https://github.com/enthus1ast/illwillWidgets ? |
16:05:03 | * | xet7 joined #nim |
16:18:42 | * | rockcavera quit (Ping timeout: 246 seconds) |
17:11:51 | * | koltrast_ quit (Quit: ZNC - http://znc.in) |
17:41:16 | * | pro joined #nim |
17:46:52 | NimEventer | New thread by Clavismax: Is there a smarter way to change only one field value of a tuple?, see https://forum.nim-lang.org/t/9212 |
17:56:49 | FromDiscord | <Luckayla> Good morning all. |
17:57:20 | * | koltrast joined #nim |
18:08:00 | FromDiscord | <eyecon> Do we have anything that merges two tables? Not `CountTable` but vanilla table. |
18:16:05 | FromDiscord | <Andreas> In reply to @eyecon "Do we have anything": nope, `merge` is only for `CountTable` so you should loop.. |
18:16:34 | FromDiscord | <Andreas> (edit) "In reply to @eyecon "Do we have anything": nope, `merge` is only for `CountTable` so you should loop.. ... " added "or write a `.merge`-proc fot std/table" |
18:16:50 | FromDiscord | <Andreas> (edit) "fot" => "for" |
18:18:22 | FromDiscord | <huantian> There’s no standard way to merge two tables imo |
18:25:35 | * | PMunch joined #nim |
18:33:09 | FromDiscord | <Andreas> In reply to @huantian "There’s no standard way": right, i would'nt know either, so than loop over the Maps, compare Keys/Values and update as you need.. |
18:38:48 | FromDiscord | <Rika> which table would have precedence if there are two keys that match? or do we exploit that keys can have many values? |
18:38:53 | FromDiscord | <Rika> if there was a merge, i meant |
18:40:33 | FromDiscord | <Andreas> In reply to @Rika "*if there was a": hmm, i believed both tables were created by the user, so you'd know how which Table has preference over the other,, if not well than i'd go from left to right ? |
18:40:46 | FromDiscord | <Andreas> (edit) removed "how" |
18:41:16 | * | derpydoo joined #nim |
18:42:00 | FromDiscord | <Andreas> (edit) "In reply to @Rika "*if there was a": hmm, i believed both tables were created by the user, so you'd know which Table has preference over the other,, if not well than i'd go from ... left?" added "right to" | "to" => "? left(receiving updates, prbly. destructive if keys match) + merge(" | "?" => ")" |
18:42:15 | FromDiscord | <Andreas> (edit) "match) + merge(" => "match).merge(" |
18:47:59 | FromDiscord | <Andreas> sent a long message, see http://ix.io/3ZyY |
18:48:19 | FromDiscord | <Andreas> (edit) "http://ix.io/3ZyY" => "http://ix.io/3ZyZ" |
19:02:42 | FromDiscord | <Luckayla> Just got turned onto nim from the python community funnily enough |
19:02:51 | FromDiscord | <Luckayla> Getting an environment set up to play around with it |
19:03:39 | FromDiscord | <eyecon> Thanks, guess I was just thinking about the happy path... Surely there's much to consider if there's a clash |
19:09:48 | FromDiscord | <d4rckh> is there any built in function for parsing file paths? |
19:14:02 | FromDiscord | <d4rckh> nvm found |
19:15:27 | * | koltrast_ joined #nim |
19:15:28 | * | koltrast quit (Ping timeout: 246 seconds) |
19:20:17 | * | koltrast_ quit (Ping timeout: 255 seconds) |
19:20:45 | * | koltrast joined #nim |
19:32:49 | * | Guest98 joined #nim |
19:33:08 | * | Guest98 quit (Client Quit) |
20:21:40 | * | rockcavera joined #nim |
20:21:40 | * | rockcavera quit (Changing host) |
20:21:40 | * | rockcavera joined #nim |
20:32:44 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3Zzz |
20:43:05 | * | jjido joined #nim |
20:48:54 | FromDiscord | <Luckayla> so question, some of the nim learning resources use `echo "Etc", "etc"` and others use `echo("etc", "etc")` , sometimes they are intermixed with each other. Functionally, is there a difference? or is this just syntactic sugar for calling functions (procs?) |
20:50:01 | FromDiscord | <Rika> sugar |
20:53:22 | NimEventer | New thread by Levlan: Solving cubic equations, see https://forum.nim-lang.org/t/9213 |
20:59:31 | FromDiscord | <Luckayla> thanks |
21:00:53 | FromDiscord | <!Patitotective> can i set an object field with an string?↵like `myObj[field] = val`↵or do i need a template? |
21:08:23 | FromDiscord | <Rika> is this string statically computable |
21:08:31 | * | derpydoo quit (Quit: derpydoo) |
21:10:08 | FromDiscord | <blashyrk> @jmgomez https://nim-lang.org/1.0.6/manual.html#implementation-specific-pragmas-custom-annotations |
21:10:52 | FromDiscord | <!Patitotective> In reply to @Rika "is this string statically": yes |
21:13:51 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3ZzI |
21:30:28 | * | pro quit (Quit: pro) |
21:42:21 | * | arkurious quit (Quit: Leaving) |
21:42:26 | * | dtomato joined #nim |
21:48:16 | FromDiscord | <Alea> Is it significantly slower to iterate over a table than a list? |
21:52:02 | FromDiscord | <Alea> I know it's slower, but how much? |
21:54:05 | FromDiscord | <Alea> I do see something about an indexmap structure which might work best for this |
21:55:19 | FromDiscord | <Alea> https://nim-lang.org/docs/tables.html#OrderedTable seems to be similar, but I'm not sure if the implementation is the same |
21:57:17 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
21:59:07 | FromDiscord | <Generic> depending on your application you could also have both |
21:59:21 | FromDiscord | <Generic> it takes a bit more memory but could be worth it |
21:59:36 | FromDiscord | <Generic> you'd have to store the index inside the seq inside the table for quick deletions |
21:59:45 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3ZzS |
22:00:04 | FromDiscord | <Generic> (edit) "index inside" => "indices for" |
22:01:10 | * | toluene quit (Ping timeout: 272 seconds) |
22:04:03 | * | jjido joined #nim |
22:14:38 | FromDiscord | <Elegantbeef> Well you cannot emit functions in typedefs |
22:15:00 | FromDiscord | <Elegantbeef> @jmgomez\: consider looking at https://github.com/beef331/constructor/blob/master/src/constructor/defaults.nim |
22:15:58 | FromDiscord | <Elegantbeef> @Alea\: iterating a table shouldnt be much slower than iterating a seq asssuming you're using the `pairs` iterator |
22:19:44 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
22:20:33 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/collections/tables.nim#L694-L698 like the only difference is the `if isFilled` part |
22:23:52 | * | toluene joined #nim |
22:28:27 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3ZA3 |
22:28:44 | FromDiscord | <Elegantbeef> Why are you using a string directly? |
22:29:16 | FromDiscord | <!Patitotective> because i read the properties from a json file |
22:29:35 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3ZA4 |
22:29:36 | FromDiscord | <Elegantbeef> Ok |
22:29:56 | FromDiscord | <Elegantbeef> This is for properties? |
22:30:04 | FromDiscord | <!Patitotective> yea |
22:30:16 | FromDiscord | <Elegantbeef> Well i mean loading the values from a format |
22:30:34 | FromDiscord | <Elegantbeef> You're doing this backwards i presume but ymmv |
22:31:48 | FromDiscord | <!Patitotective> the idea is that you can publish your theme (in a json file) and then other person can get an `ImGuiStyle` from it |
22:31:50 | FromDiscord | <!Patitotective> (edit) "the idea is that you can publish your theme (in a json file) and then other person can get an `ImGuiStyle` ... from" added "obj" |
22:34:52 | FromDiscord | <Elegantbeef> No need for macros here |
22:34:52 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3ZA7 |
22:35:23 | FromDiscord | <Elegantbeef> `for name, field in result.fieldpairs` sorry |
22:36:00 | FromDiscord | <!Patitotective> smart thanks |
22:36:38 | FromDiscord | <Elegantbeef> Macros run at compile time so they cannot solve this issue without generating the above |
22:59:29 | * | lumo_e joined #nim |
23:16:27 | * | PMunch quit (Quit: leaving) |
23:21:02 | * | wallabra quit (Ping timeout: 250 seconds) |
23:50:49 | * | wallabra joined #nim |