00:02:03 | FromDiscord | <@bracketmaster-5a708063d73408ce4> has anyone tried nimedit? |
00:02:05 | FromDiscord | <@bracketmaster-5a708063d73408ce4> thoughts so far? |
00:08:10 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I'm thinking I'll try it |
00:18:36 | * | vicfred joined #nim |
00:27:28 | FromDiscord | <carmysilna> When I looked at it, it looked like development has stalled |
01:04:03 | * | bkay joined #nim |
01:04:21 | * | beshr quit (Ping timeout: 258 seconds) |
01:36:58 | FromDiscord | <creonico> How can I do conditional compilation when defining -d:debug? |
01:38:04 | FromDiscord | <leorize> `when defined(debug): <code here>` |
01:38:21 | FromDiscord | <creonico> Thank you ๐
|
01:58:33 | * | arkurious quit (Quit: Leaving) |
02:58:41 | FromDiscord | <Jakraes> Does anyone know if there's a way to temporarily open a port with nim? |
02:59:32 | FromDiscord | <Jakraes> I tried using netty to connect with a friend and apparently, even if specify a port in netty and he uses my ip and we're connected through hamachi, he can't connect with the server |
03:34:01 | * | ecs joined #nim |
03:45:40 | * | TakinOver joined #nim |
04:06:02 | * | supakeen quit (Quit: WeeChat 3.2) |
04:06:37 | * | supakeen joined #nim |
05:22:09 | * | TejasAgarwal joined #nim |
05:27:30 | * | fputs_ quit (Remote host closed the connection) |
05:27:49 | * | fputs joined #nim |
05:28:04 | * | fputs quit (Remote host closed the connection) |
05:28:52 | * | fputs joined #nim |
05:34:39 | * | TejasAgarwal quit (Quit: The Lounge - https://thelounge.chat) |
06:16:18 | * | max22- joined #nim |
06:29:32 | * | max22- quit (Remote host closed the connection) |
06:30:25 | * | max22- joined #nim |
06:34:05 | * | aeverr quit (Ping timeout: 255 seconds) |
06:36:38 | FromDiscord | <j-james> Are there best practices for wrapping C libraries? |
07:02:15 | FromDiscord | <Rika> Example? |
07:44:01 | FromDiscord | <ynfle (ynfle)> @\_discord\_572634810917322773\:t2bot.io try c2nim or nimterop |
07:57:11 | mst | j-james, my (limited) experience is that nim talks to C libraries nicely enough that you kinda just do it and it works |
08:01:07 | FromDiscord | <generic linux user> guys can i know how much is uint64 range? |
08:01:22 | FromDiscord | <generic linux user> its taking a long time than int64, concern |
08:02:26 | fn | <Prestige99> you mean the highest number for uint64? |
08:02:38 | FromDiscord | <generic linux user> yes |
08:02:51 | fn | <Prestige99> !eval echo uint64.high |
08:02:53 | NimBot | 18446744073709551615 |
08:02:54 | fn | <R2D299> 18446744073709551615 |
08:03:09 | FromDiscord | <generic linux user> i wrote a smol bin for checking on if n(n+1) returns even for all naturals |
08:03:28 | FromDiscord | <generic linux user> i first used int64 , it lasted 1.20mins until i got overflow |
08:03:37 | FromDiscord | <generic linux user> i changed it to uint64 and its been 20 mins |
08:03:44 | FromDiscord | <generic linux user> thanks for the number tho |
08:03:54 | FromDiscord | <zidsal> All naturals is an infinite set |
08:04:06 | FromDiscord | <generic linux user> but my phone is 64bit |
08:04:09 | FromDiscord | <ElegantBeef> Also did you build `-d:release` ๐ |
08:04:13 | FromDiscord | <generic linux user> yes |
08:04:22 | FromDiscord | <ElegantBeef> still going to take forever, but have fun |
08:04:38 | FromDiscord | <generic linux user> i think by that numver it takes 1.28hours |
08:04:44 | FromDiscord | <zidsal> But generic how do you know that, it works for any naturals larger then uint64.max |
08:04:49 | FromDiscord | <generic linux user> (edit) "numver" => "number" |
08:05:07 | FromDiscord | <generic linux user> me? |
08:05:08 | FromDiscord | <generic linux user> lol |
08:05:30 | FromDiscord | <generic linux user> In reply to @zidsal "But generic how do": just checking on if law is true, have nothing seroius to do tho |
08:06:01 | FromDiscord | <zidsal> My point is generally you would use a mathematical proof for such a thing rather then write a program for it :P |
08:06:31 | FromDiscord | <generic linux user> yes, principal of mathematical induction, i got this from there |
08:07:51 | FromDiscord | <generic linux user> how? |
08:07:52 | FromDiscord | <generic linux user> sent a code paste, see https://play.nim-lang.org/#ix=2tJ9 |
08:08:17 | FromDiscord | <Rika> Unsigned numbers do not have overflow errors |
08:08:28 | FromDiscord | <Rika> You will never terminate if you do not manually check for overflow |
08:08:38 | FromDiscord | <generic linux user> waaat |
08:08:56 | FromDiscord | <generic linux user> In reply to @Rika "You will never terminate": so it will keep on running? |
08:09:21 | FromDiscord | <Rika> Unless you check for last number < current number |
08:09:27 | FromDiscord | <generic linux user> but then isnt there a limit that causes overflow |
08:09:39 | FromDiscord | <Rika> Not for unsigned numbers |
08:09:50 | FromDiscord | <generic linux user> that is possible? |
08:10:08 | FromDiscord | <ElegantBeef> Unsigned doesnt overflow |
08:10:11 | FromDiscord | <ElegantBeef> (edit) "Unsigned doesnt overflow ... " added "error" |
08:10:13 | FromDiscord | <Rika> Because it is a common idiom to use unsigned numbers for modulo math or something I forgot what itโs called |
08:10:37 | FromDiscord | <ElegantBeef> !eval echo 255u8 + 1u8 |
08:10:39 | NimBot | 0 |
08:10:42 | FromDiscord | <generic linux user> but still there is a max on any data type right? |
08:10:54 | FromDiscord | <Rika> Yes |
08:11:04 | FromDiscord | <generic linux user> so we should get a overflow |
08:11:18 | FromDiscord | <Rika> Yes, but not an error |
08:11:25 | FromDiscord | <Rika> It overflows silently |
08:11:28 | FromDiscord | <generic linux user> atleast will it exit?, or will it keep doing smg after it runs out of max |
08:11:40 | FromDiscord | <generic linux user> In reply to @Rika "It overflows silently": and then what will it do? |
08:11:44 | FromDiscord | <Rika> No it just rolls back to 0 |
08:11:48 | FromDiscord | <ElegantBeef> No unsigned integers will silently overflow and continue |
08:11:49 | FromDiscord | <Rika> And continues again up to max |
08:11:53 | FromDiscord | <Rika> Then back to 0 |
08:11:54 | FromDiscord | <ElegantBeef> Look what i showed with the eval |
08:12:01 | FromDiscord | <generic linux user> if it rolls back to zero , it will exit๐ |
08:12:11 | FromDiscord | <ElegantBeef> !eval echo 255u8 + 127u8 |
08:12:13 | NimBot | 126 |
08:12:22 | FromDiscord | <generic linux user> In reply to @ElegantBeef "Look what i showed": okkke |
08:12:43 | FromDiscord | <Rika> sent a code paste, see https://paste.rs/DrF |
08:12:55 | FromDiscord | <generic linux user> it n is 0 , then the law gets false |
08:13:02 | FromDiscord | <Rika> Why |
08:13:07 | FromDiscord | <generic linux user> 0 is even? |
08:13:14 | FromDiscord | <Rika> Yes |
08:13:16 | FromDiscord | <Rika> What |
08:13:25 | FromDiscord | <generic linux user> it will retrun 0 |
08:13:27 | FromDiscord | <generic linux user> :| |
08:13:29 | FromDiscord | <Rika> 0 is even |
08:13:35 | FromDiscord | <ElegantBeef> the remainder of 0 / 2 is 0 |
08:13:39 | FromDiscord | <generic linux user> yes |
08:13:46 | FromDiscord | <generic linux user> so it will loop infinite |
08:13:52 | FromDiscord | <Rika> Yes as we said indeed |
08:14:11 | FromDiscord | <generic linux user> thank you guys |
08:14:17 | FromDiscord | <generic linux user> i am mad:) |
08:14:34 | FromDiscord | <Rika> Lol blame C I guess |
08:14:47 | FromDiscord | <generic linux user> else it wouldnt have happend? |
08:14:58 | FromDiscord | <generic linux user> there is cpp tho |
08:15:54 | FromDiscord | <Rika> No itโs complicated to explain |
08:16:15 | FromDiscord | <generic linux user> okei |
08:18:32 | FromDiscord | <generic linux user> sent a code paste, see https://paste.rs/vO7 |
08:21:05 | FromDiscord | <generic linux user> then it will echo 0,0 after 2 hours |
08:21:09 | FromDiscord | <generic linux user> which is pointless |
08:21:11 | FromDiscord | <ElegantBeef> Could just check `if n != uint64.high` before `loop` |
08:21:49 | FromDiscord | <generic linux user> else it would put it to 0 and that doesnt make sense |
08:33:17 | * | max22- quit (Remote host closed the connection) |
08:36:12 | FromDiscord | <j-james> In reply to @Rika "Example?": Wrapping wlroots, which has functions split across multiple header files - is it standard to merge these all into one Nim file? |
08:37:48 | FromDiscord | <haxscramper> just do what seems suitable for you, there is no set standard |
08:38:11 | FromDiscord | <haxscramper> can merge everything into one huge file |
08:40:02 | * | max22- joined #nim |
08:41:26 | FromDiscord | <j-james> Good to know, thanks |
09:24:52 | fn | <Prestige99> Is there a way to do this properly? https://play.nim-lang.org/#ix=2S8a |
09:30:40 | FromDiscord | <ElegantBeef> I dont think there is any nice way around not having a closure here |
09:31:41 | FromDiscord | <ElegantBeef> I assume the cdecl is to interact with xlib? |
09:32:00 | fn | <Prestige99> actually staticglfw this time |
09:32:40 | fn | <Prestige99> So this could be done somehow with a closure you think? |
09:32:50 | FromDiscord | <ElegantBeef> Well that's what the error is talking about |
09:33:00 | FromDiscord | <ElegantBeef> Cdecl and closure are incompatible |
09:33:29 | FromDiscord | <ElegantBeef> It's explictly stating that it cannot capture `this` due to using the cdecl calling convention |
09:34:05 | fn | <Prestige99> Right - I don't know how I could ever use this callback to manipulate data in my program, then |
09:34:29 | FromDiscord | <ElegantBeef> Welcome to glfw fun! ๐ |
09:34:34 | fn | <Prestige99> unless it were just global, maybe |
09:34:44 | FromDiscord | <ElegantBeef> Yea if it was global you could |
09:35:15 | FromDiscord | <ElegantBeef> SDL2 doesnt do this callback based stuff if you care about that at all |
09:35:36 | FromDiscord | <ElegantBeef> also i hate your mouse state |
09:35:55 | FromDiscord | <ElegantBeef> How hard is it to use a button state man! clear, pressed, held, released ๐ |
09:36:58 | fn | <Prestige99> mocking godot's system atm |
09:37:30 | fn | <Prestige99> well it doesn't compile yet lol so I've yet to test out what I'd like |
09:37:41 | FromDiscord | <ElegantBeef> Working on a 2D or 3D project? |
09:37:53 | fn | <Prestige99> a 2d engine |
09:38:32 | FromDiscord | <ElegantBeef> Ah i recently started on a 3D "engine" that i'll probably soon throw in a dumpster |
09:38:56 | fn | <Prestige99> that sounds like fun tbh, but a lot of work |
09:39:16 | fn | <Prestige99> how in hell can these callbacks be used.. |
09:39:19 | FromDiscord | <ElegantBeef> Well i have the important shader/model loading so i can actually toy with it |
09:39:22 | FromDiscord | <ElegantBeef> Global variables |
09:39:36 | fn | <Prestige99> hmm maybe a singleton? |
09:39:36 | FromDiscord | <ElegantBeef> You basically get to do stuff like https://github.com/beef331/truss3d/blob/master/src/truss3D/inputs.nim#L46 |
09:39:52 | FromDiscord | <ElegantBeef> Well do you really need a singleton in Nim? |
09:40:07 | FromDiscord | <ElegantBeef> It's just a global variable here |
09:40:24 | fn | <Prestige99> for my inputhandler, would be nice |
09:41:02 | FromDiscord | <ElegantBeef> I guess if you must you could have an instantiated object for it, seems quite simple to just import inputs if you need them if you ask me ๐ |
09:42:08 | fn | <Prestige99> yeah a singleton works out quite well actually |
09:42:27 | fn | <Prestige99> I'm avoiding allowing the user to change the state of the inputhandler |
09:43:25 | FromDiscord | <ElegantBeef> Sure but if the input procedures exist in the inputs module you just expose the inputs with getters and you've got a singleton like system with the user not being able to modify them |
09:43:48 | fn | <Prestige99> yep that's what I'm doing currently |
09:44:11 | FromDiscord | <ElegantBeef> Does it need to capture the global variable? |
09:45:50 | fn | <Prestige99> well it seems to work, idk |
09:46:07 | fn | <Prestige99> dont know what goes on under the hood |
10:02:44 | * | Arrrrrrrrr joined #nim |
10:13:54 | Arrrrrrrrr | What is Araq working on nowadays? I've been out of the loop for a while |
10:16:08 | Arrrrrrrrr | THe overloadable enums looks promising, this was a (minor) pain for me |
10:17:16 | FromDiscord | <fajjida> Is there a way to use globbing in pure Nimsript or at least iterate over them? walkFiles and walkPattern from "os" do not work on Nimscript. I can probably find a workaround but this seems weird. |
10:20:09 | FromDiscord | <haxscramper> https://github.com/treeform/globby |
10:20:11 | fn | <R2D299> itHub: 7"Glob pattern matching for Nim." |
10:20:32 | FromDiscord | <haxscramper> Most likely it works with nimscript |
10:58:53 | * | vicfred quit (Quit: Leaving) |
10:59:11 | arkanoid | is nim compatible with the intel C compiler? I'm curious about trying the auto-parallelization tool and https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/advisor.html |
11:04:20 | * | luis_ joined #nim |
11:22:13 | arkanoid | where is a "const x = @[1,2,3,4,5]" allocated? is it still on the heap no matter of const? |
11:37:03 | * | xet7 quit (Remote host closed the connection) |
11:37:40 | * | xet7 joined #nim |
11:39:31 | * | luis_ quit (Quit: luis_) |
11:40:10 | * | luis_ joined #nim |
11:43:27 | FromDiscord | <haxscramper> Yes, IIRC `const` values are directly inlined when they are used |
11:44:23 | FromDiscord | <haxscramper> There might be an optimization for that, so I think the best way to figure that out would be to look at generated C code |
11:50:37 | * | Arrrrrrrrr quit (Quit: Arrrrrrrrr) |
11:55:50 | * | max22- quit (Ping timeout: 256 seconds) |
12:06:01 | * | supakeen quit (Quit: WeeChat 3.2) |
12:06:35 | * | supakeen joined #nim |
12:12:25 | FromDiscord | <generic linux user> https://media.discordapp.net/attachments/371759389889003532/868828030271901696/Screenshot_2021-07-25-17-42-06.jpeg |
12:39:48 | * | luis_ quit (Quit: luis_) |
12:40:09 | * | luis_ joined #nim |
12:46:10 | * | aeverr joined #nim |
13:00:01 | * | arkurious joined #nim |
13:01:50 | FromDiscord | <shampee (Hampus O)> !help |
13:06:30 | * | supakeen quit (Remote host closed the connection) |
13:06:53 | * | supakeen joined #nim |
13:25:28 | * | max22- joined #nim |
13:28:53 | FromDiscord | <generic linux user> eh? |
13:36:28 | FromDiscord | <generic linux user> sent a code paste, see https://paste.rs/JhV |
13:36:30 | FromDiscord | <generic linux user> it was 9 afaik |
13:37:04 | fn | <Prestige99> What do you mean? |
13:39:12 | * | ming joined #nim |
13:39:52 | * | luis_ quit (Quit: luis_) |
13:42:49 | FromDiscord | <generic linux user> sent a code paste, see https://play.nim-lang.org/#ix=3u2R |
13:43:03 | FromDiscord | <generic linux user> you roll until 7 then the error comes |
13:44:02 | FromDiscord | <generic linux user> i wrote that into a file and readed it, now i call it csv :| |
13:45:44 | FromDiscord | <Rika> ?? |
13:45:52 | FromDiscord | <Rika> Roll??? |
13:46:00 | FromDiscord | <generic linux user> go on until |
13:46:15 | FromDiscord | <Rika> Go on where |
13:46:22 | FromDiscord | <generic linux user> upto 7th index |
13:47:12 | FromDiscord | <Rika> The code only has two indices though what do you mean |
13:49:05 | FromDiscord | <generic linux user> sent a code paste, see https://play.nim-lang.org/#ix=3u2U |
13:49:15 | FromDiscord | <Rika> It should error by 3 |
13:49:24 | * | max22- quit (Ping timeout: 272 seconds) |
13:49:53 | FromDiscord | <generic linux user> it doesnt |
13:49:56 | FromDiscord | <generic linux user> it returns nil |
13:50:05 | FromDiscord | <generic linux user> ok |
13:50:18 | fn | <Prestige99> Can you paste a full example? |
13:50:36 | FromDiscord | <generic linux user> sent a code paste, see https://paste.rs/XZA |
13:50:49 | FromDiscord | <generic linux user> i was trying out this method , i dont have any example |
13:52:34 | FromDiscord | <Rika> That should error by index 10 |
13:54:52 | FromDiscord | <generic linux user> sorry , it somehow worked now |
14:04:11 | FromDiscord | <generic linux user> it was tje problem of the csv file that i wrote |
14:04:17 | FromDiscord | <generic linux user> i didnt put 11 commas |
14:04:24 | FromDiscord | <generic linux user> also why only 10? |
14:11:30 | FromDiscord | <Rika> index starts with 0? |
14:11:36 | FromDiscord | <generic linux user> yes |
14:11:44 | FromDiscord | <Rika> yeah so it errors on index 10 |
14:11:51 | FromDiscord | <Rika> 0 to 9 is 10 strings |
14:11:56 | FromDiscord | <generic linux user> but why only till 10 tho |
14:12:26 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=3u2X |
14:12:26 | FromDiscord | <Rika> therefore on index 10 it will error |
14:12:37 | FromDiscord | <generic linux user> no , like if i add more |
14:12:53 | FromDiscord | <Rika> then the index where it errors will change too |
14:14:12 | FromDiscord | <generic linux user> yep , it works |
14:23:20 | * | xet7 quit (Remote host closed the connection) |
14:24:12 | * | xet7 joined #nim |
14:30:20 | * | max22- joined #nim |
15:35:07 | FromDiscord | <carmysilna> Can I, at compile-time, read a file and do computation on its contents, and then have the result of the computation available at runtime? |
15:37:13 | FromDiscord | <no name fits> Yes |
15:39:59 | fn | <ForumUpdaterBot99> New thread by Arnetheduck: What makes the nim compiler slow, see https://forum.nim-lang.org/t/8267 |
15:43:16 | FromDiscord | <carmysilna> In reply to @no name fits "Yes": Can you elaborate? I've tried doing the computation in a `static` block, but then I can't access the results at runtime, outside of the `static` block |
15:43:54 | FromDiscord | <no name fits> Wait, then I misunderstand you |
15:44:17 | * | max22- quit (Remote host closed the connection) |
15:44:41 | FromDiscord | <no name fits> If you do any computations at compile time, what is it you then want to access at runtime? |
15:44:55 | FromDiscord | <carmysilna> sent a code paste, see https://play.nim-lang.org/#ix=3u3z |
15:45:08 | FromDiscord | <carmysilna> But I get an error that `prelude` isn't in scope, and I can't export from within the `static` block |
15:47:02 | FromDiscord | <carmysilna> In reply to @no name fits "If you do any": the result of the computation, which won't change during runtime, hence the desire to run just once at compile-time |
15:47:09 | FromDiscord | <no name fits> right |
15:48:09 | FromDiscord | <carmysilna> so is `static` not the right way to do this? |
15:48:26 | FromDiscord | <carmysilna> or can I declare a `const` that's the result of a static block? |
15:48:43 | FromDiscord | <no name fits> You need the variable to be outside of the static scope |
15:50:54 | FromDiscord | <no name fits> I'm not sure how you would lift a variable out of a scope otherwise |
15:51:03 | * | max22- joined #nim |
15:53:32 | FromDiscord | <carmysilna> sent a code paste, see https://play.nim-lang.org/#ix=3u3D |
15:54:05 | FromDiscord | <SolitudeSF> yes |
15:54:40 | FromDiscord | <SolitudeSF> you just need to change readFile to staticRead |
15:59:13 | FromDiscord | <carmysilna> thanks |
16:02:22 | FromDiscord | <zetashift> Did IC land yet? I saw the an issue closed a few weeks ago and presumed it's already in? |
16:23:58 | FromDiscord | <haxscramper> I tried to compile my project with latest devel&IC, and it immediately led to internal compiler crash |
16:23:58 | FromDiscord | <haxscramper> Like 1.6 |
16:23:59 | FromDiscord | <haxscramper> And IIRC it was planned for some release version |
16:24:31 | FromDiscord | <haxscramper> And there was no mention of it being ready & fully usable for everyday code |
16:48:42 | * | ming quit (Ping timeout: 240 seconds) |
16:49:11 | * | ming joined #nim |
17:00:24 | FromDiscord | <leorize> I think IC is lifted from 1.6 roadmap |
17:00:34 | FromDiscord | <leorize> gotta ask @Araq to be sure though |
17:23:59 | * | flynn quit (Read error: Connection reset by peer) |
17:25:05 | * | flynn joined #nim |
17:36:56 | * | ming quit (Remote host closed the connection) |
17:40:47 | FromDiscord | <zetashift> Ah I see, I was just curious, so I'm in no pressing hurry to know ๐ |
18:20:59 | FromDiscord | <haxscramper> So 1.6 roadmap is switching to ARC/ORC as default GC? |
18:21:00 | FromDiscord | <haxscramper> I've seen discussion about orc being 2.0 feature https://forum.nim-lang.org/t/7983 |
18:21:00 | FromDiscord | <haxscramper> > โต> Once Nim can bootstrap via --gc\:orc we should make this the default GC as it works best with destructor based custom memory management. Since this is all based on the "new runtime" which isn't ABI compatible this deserves the 2.0 version. This should also be our next LTS version.โต> |
18:29:54 | FromDiscord | <timotheecour> @carmysilna did you see the update for osenv? |
18:30:38 | FromDiscord | <carmysilna> yeah, my preference would be for option 1 but I want to hear what Araq thinks |
18:31:25 | FromDiscord | <timotheecour> ya, that'd be the simplest to do it in 1 shot |
18:33:45 | * | flynn quit (Read error: Connection reset by peer) |
18:34:53 | * | flynn joined #nim |
18:50:02 | * | flynn quit (Remote host closed the connection) |
18:51:08 | * | flynn joined #nim |
19:07:48 | * | supakeen quit (Remote host closed the connection) |
19:08:12 | * | supakeen joined #nim |
19:13:55 | * | max22- quit (Read error: Connection reset by peer) |
19:16:23 | FromDiscord | <lamersc.com ๐ง> Whatโs the difference between arc and orc? |
19:20:36 | * | max22- joined #nim |
19:29:20 | * | bkay quit (Quit: Leaving) |
19:29:35 | * | beshr joined #nim |
19:29:35 | * | beshr quit (Changing host) |
19:29:35 | * | beshr joined #nim |
19:45:15 | * | vicfred joined #nim |
20:20:58 | * | max22- quit (Ping timeout: 240 seconds) |
20:20:59 | FromDiscord | <SirOlaf> Are there Nim bindings for https://github.com/ocornut/imgui_club/blob/master/imgui_memory_editor/imgui_memory_editor.h and if not, how would I go about creating them? |
20:40:55 | * | max22- joined #nim |
20:43:30 | * | vicfred_ joined #nim |
20:45:56 | * | vicfred__ joined #nim |
20:46:46 | * | vicfred quit (Ping timeout: 272 seconds) |
20:48:27 | * | vicfred_ quit (Ping timeout: 245 seconds) |
20:52:02 | * | vicfred__ quit (Quit: Leaving) |
20:52:12 | * | vicfred joined #nim |
21:09:59 | FromDiscord | <lamersc.com ๐ง> In reply to @SirOlaf "Are there Nim bindings": Seems pretty niche of a usage, so I donโt think thereโd be binding yet |
21:12:34 | FromDiscord | <SirOlaf> Damn. Any good way of binding it or something? |
22:58:29 | * | vicfred_ joined #nim |
23:01:14 | * | vicfred quit (Ping timeout: 252 seconds) |
23:16:55 | FromDiscord | <demotomohiro> nimgl contains imgui binding |
23:16:56 | FromDiscord | <demotomohiro> https://github.com/nimgl/nimgl |
23:16:58 | fn | <R2D299> itHub: 7"NimGL is a Nim library that offers bindings for popular libraries used in computer graphics" |
23:17:11 | FromDiscord | <@bracketmaster-5a708063d73408ce4> any idiomatic and elegant ways to remove a certain character from a string? |
23:18:53 | FromDiscord | <exelotl> you mean remove all occurrences, or remove a certain index? |
23:19:05 | FromDiscord | <@bracketmaster-5a708063d73408ce4> all occurences |
23:22:48 | FromDiscord | <exelotl> good question lol |
23:23:21 | FromDiscord | <exelotl> I'd have thought `filterIt` would have worked but I think I'm doing something wrong |
23:29:04 | FromDiscord | <exelotl> I guess `s = s.replace("x", "")` is the easiest way, but if you're intending to modify `s` like that it's gonna be a pretty slow / wasteful solution |
23:31:15 | FromDiscord | <carmysilna> `s.keepItIf(it != 'x')` |
23:32:54 | * | vicfred_ quit (Ping timeout: 265 seconds) |
23:34:25 | FromDiscord | <exelotl> jank https://play.nim-lang.org/#ix=3u5i |
23:34:40 | * | max22- quit (Remote host closed the connection) |
23:36:03 | FromDiscord | <exelotl> oh it's just cause `s` isn't a seq |
23:37:42 | FromDiscord | <exelotl> `filterIt` failed for the same reason, well it would work but return a `seq[char]` rather than a `string` |
23:38:52 | FromDiscord | <exelotl> if you change the signature of `keepItIf` to accept `seq|string` it works fine |
23:41:22 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3u5j |
23:41:28 | FromDiscord | <Elegantbeef> Probably the simplest solution |
23:42:01 | FromDiscord | <carmysilna> sent a code paste, see https://play.nim-lang.org/#ix=3u5k |
23:42:34 | FromDiscord | <Elegantbeef> well forgot the characters to remove in the parameter list and `s: var string` ๐ |
23:43:55 | FromDiscord | <Elegantbeef> Also why are you using inject in a procedure? |