00:47:47 | FromDiscord | <Ayy Lmao> Is there a way to get the generic type from a generic? |
00:48:52 | FromDiscord | <Ayy Lmao> As in get `float` from `Foo[float]` |
00:49:49 | nrds | <ComputerTech99> hai |
00:50:23 | FromDiscord | <konsumlamm> In reply to @Ayy Lmao "Is there a way": https://nim-lang.github.io/Nim/typetraits.html#genericParams.t%2Ctypedesc |
00:53:06 | FromDiscord | <Ayy Lmao> In reply to @konsumlamm "https://nim-lang.github.io/Nim/typetraits.html#gene": Awesome, thanks! |
00:54:18 | FromDiscord | <Ayy Lmao> Neat, there's elementType too. I was wondering about that as well. |
01:09:00 | madprops | how can I pass an int to a proc by reference? |
01:09:14 | madprops | i just want the proc to modify the int |
01:09:14 | FromDiscord | <Elegantbeef> `someInt: var int` |
01:09:21 | madprops | i tried that |
01:09:34 | madprops | https://play.nim-lang.org/#ix=3wp7 |
01:10:14 | FromDiscord | <Elegantbeef> It replaces all `` at the same time |
01:13:20 | FromDiscord | <konsumlamm> it doesn't call `insertnum_rep` multiple times, if you thought that |
01:15:17 | madprops | ah right |
01:21:05 | madprops | can't seem to find if re replace can replace one by one |
01:23:06 | FromDiscord | <Elegantbeef> Me disliking regex\: https://play.nim-lang.org/#ix=3wp9 |
01:25:04 | madprops | :o |
01:25:57 | madprops | that's p complex |
01:26:35 | * | stkrdknmibalz quit (Quit: WeeChat 3.0.1) |
01:26:43 | madprops | what if you liked re though ? |
01:26:50 | FromDiscord | <Elegantbeef> I wouldnt |
01:27:18 | madprops | \w+ |
01:27:24 | FromDiscord | <Elegantbeef> Probably use the modern api https://nim-lang.org/docs/nre.html#replace%2Cstring%2CRegex%2Cproc%28RegexMatch%29 |
01:27:25 | * | stkrdknmibalz joined #nim |
01:27:58 | madprops | thought nre was deprecated? https://github.com/nim-lang/RFCs/issues/31 |
01:28:48 | madprops | or idk what the decision was |
01:29:43 | FromDiscord | <Elegantbeef> Ah maybe i'm wrong which is modern, but it has more functionality 😀 |
01:30:31 | FromDiscord | <konsumlamm> there's no real consensus on re vs nre vs regex vs ... afaik |
01:30:35 | FromDiscord | <Elegantbeef> Could also use the `nim-regex` package |
01:33:07 | FromDiscord | <Elegantbeef> Yea idk use whatever module you prefer |
01:33:07 | FromDiscord | <Elegantbeef> Sure my logic has an issue somewhere |
01:51:34 | madprops | well here's another way https://play.nim-lang.org/#ix=3wpe |
01:52:56 | * | _KurtGodel_ is now known as KurtGodel |
02:08:46 | * | arkurious quit (Quit: Leaving) |
02:25:47 | madprops | smaller version https://dpaste.org/q6vL |
03:07:13 | FromDiscord | <rxx> whats the IRC channel |
03:09:02 | FromDiscord | <Elegantbeef> libera.chat#nim |
03:20:03 | * | rockcavera quit (Remote host closed the connection) |
03:40:00 | * | xet7 quit (Remote host closed the connection) |
03:40:42 | * | xet7 joined #nim |
04:00:05 | madprops | what happens when 2 libs have the same proc name? |
04:00:15 | madprops | since everything is auto-imported |
04:00:42 | FromDiscord | <Elegantbeef> If there is ambiguity you have to remove it somehow |
04:00:49 | madprops | you get warned? |
04:00:58 | FromDiscord | <Elegantbeef> You get a compiler warning |
04:01:04 | madprops | ah that's good |
04:01:18 | FromDiscord | <Elegantbeef> There isnt often ambiguity since it's rather rare for two procedures to match parameters and types |
04:02:27 | FromDiscord | <Elegantbeef> But then you can do multiple things to resolve ambiguity do `import someModule except ambigousSym` or do `someOtherModule.ambigousSym(arg1, arg2...)` |
04:02:42 | FromDiscord | <Elegantbeef> The former works if you dont need the symbol whatsoever, the latter works if you need both |
04:04:14 | madprops | yeah makes sense |
04:06:02 | * | supakeen quit (Quit: WeeChat 3.2) |
04:06:31 | * | supakeen joined #nim |
04:07:40 | * | dmu quit (Quit: leaving) |
04:13:28 | * | Mister_Magister quit (Ping timeout: 268 seconds) |
04:13:43 | FromDiscord | <Rika> If two things have the same name, no issue if they have different argument signatures |
04:14:25 | FromDiscord | <Rika> If they further do have the same argument signatures, you don’t just get a warning, the code doesn’t compile |
04:15:52 | FromDiscord | <Elegantbeef> Yea i corrected myself but matrix -\> discord doesnt propagate edits apparently |
04:19:20 | madprops | discord to irc edits do propagate :) |
04:24:33 | FromDiscord | <Rika> Beef is not on discord |
04:30:01 | FromDiscord | <InventorMatt> he is. he just usually uses matrix these days |
04:32:43 | FromDiscord | <Rika> That’s not what I mean |
04:33:10 | FromDiscord | <Rika> I know he used discord but he rarely does nowadays. I mean that he did not use discord when the compiler warning message was sent |
04:33:20 | FromDiscord | <Rika> And when he edited it, the edit did not show because of that |
04:34:49 | FromDiscord | <InventorMatt> I realized that more after i actually sent the message |
04:36:16 | FromDiscord | <Rika> Haha that’s fine |
04:36:34 | * | flynn quit (Read error: Connection reset by peer) |
04:37:42 | * | flynn joined #nim |
04:41:23 | FromDiscord | <Elegantbeef> Matt checks if i'm on discord daily! |
04:41:24 | FromDiscord | <Elegantbeef> "That beef fucker is still here?!" |
04:41:42 | FromDiscord | <Rika> Nah that’s me I just don’t say it |
04:44:57 | FromDiscord | <Elegantbeef> Dont blame you |
06:12:15 | NimEventer | New post on r/nim by 1985Ronald: Is it possible to create a standalone exe using nim?, see https://reddit.com/r/nim/comments/p796zq/is_it_possible_to_create_a_standalone_exe_using/ |
06:53:50 | * | jjido joined #nim |
07:16:42 | * | Mister_Magister joined #nim |
07:22:02 | * | tdc_ joined #nim |
07:51:20 | * | max22- joined #nim |
07:55:44 | FromDiscord | <j-james> Is there any way to specify file imports from a certain directory, instead of using a bunch of relative paths? |
07:59:54 | * | PMunch joined #nim |
08:01:04 | FromDiscord | <Elegantbeef> Macros can get all of them in a specific directory, but there is nothing built in |
08:01:57 | FromDiscord | <Elegantbeef> An example of this is this mess https://github.com/GaryM-exkage/GDGW-Maverick-Bot/blob/master/src/nimcordbot/utils.nim#L3-L21 |
08:04:59 | FromDiscord | <j-james> Oh, that wasn't quite what I meant, but I found what I was looking for with `nim.cfg` |
08:06:46 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
08:09:26 | FromDiscord | <Elegantbeef> Ah yea that makes more sense |
08:12:40 | * | jjido joined #nim |
08:21:06 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
08:22:23 | FromDiscord | <Yardanico> In reply to @Elegantbeef "An example of this": i mean it's not that messy :P |
08:23:13 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3wqu |
08:24:25 | FromDiscord | <Yardanico> it can be pretty useful if you have some kind of a module system in your bot |
08:24:59 | NimEventer | New thread by Bitstorm: Is it possible to mix c and c++ backend?, see https://forum.nim-lang.org/t/8343 |
08:25:17 | FromDiscord | <Elegantbeef> Yea havnet touched the bot in a while so it's mostly just my fancy command handler |
08:25:29 | FromDiscord | <Yardanico> how fancy? :P |
08:25:34 | FromDiscord | <Yardanico> oh I see |
08:25:41 | FromDiscord | <Yardanico> lol you did almost the same thing as I did in the past for my social network bot |
08:25:56 | FromDiscord | <Yardanico> great minds think alike |
08:26:00 | FromDiscord | <Elegantbeef> Parse test is best example of it |
08:26:40 | FromDiscord | <Yardanico> yeah mine was a bit worse in that regard since I didn't have argument listing, the modules were just getting an argument list of strings |
08:27:23 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3wqv |
08:27:34 | FromDiscord | <Elegantbeef> Ah mine also has fewer russian string lits 😛 |
08:27:38 | FromDiscord | <Yardanico> lol |
08:27:48 | FromDiscord | <Yardanico> well this one was written for a russian social network, so I used russian for commands :P |
08:32:34 | * | Helios quit (Quit: Bridge terminating on SIGTERM) |
08:32:35 | * | nixfreak_nim[m] quit (Quit: Bridge terminating on SIGTERM) |
08:32:37 | * | happycorsair[m] quit (Quit: Bridge terminating on SIGTERM) |
08:35:55 | * | nixfreak_nim[m] joined #nim |
08:48:58 | * | Helios joined #nim |
08:48:58 | * | happycorsair[m] joined #nim |
09:14:14 | * | Vladar joined #nim |
09:56:58 | * | jjido joined #nim |
10:10:59 | * | flynn quit (Read error: Connection reset by peer) |
10:11:22 | * | kayabaNerve quit (Ping timeout: 252 seconds) |
10:12:07 | * | flynn joined #nim |
10:12:48 | FromDiscord | <enthus1ast> what is a good way to make an iterator to a No Op? currently in my "no op when case" i iterate through the param and yield it, but is there a better way? |
10:22:57 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
10:23:11 | FromDiscord | <Rika> huh? im unsure of what you mean |
10:25:20 | FromDiscord | <enthus1ast> i have an iterator that transforms the input to something else, but this can be deactivated by a define, when the define is set i want to just use the input |
10:25:30 | FromDiscord | <enthus1ast> and not have a runtime impact |
10:26:56 | * | kayabaNerve joined #nim |
10:27:44 | FromDiscord | <Rika> is the input another iterators |
10:27:45 | FromDiscord | <Rika> (edit) "iterators" => "iterator\" |
10:28:46 | FromDiscord | <enthus1ast> ah i got the solution i guess |
10:29:27 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3wqV |
10:29:37 | FromDiscord | <enthus1ast> seems to work |
10:32:53 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3wqX |
10:35:41 | FromDiscord | <haxscramper> Otherwise, you have different symbol kinds based on define, and `iterator` sometimes behaves differently from `template` etc. |
10:35:45 | FromDiscord | <haxscramper> for example `mapIt` has issues with terators, but it would work with tempalte |
10:35:53 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3wr0 |
10:36:00 | FromDiscord | <haxscramper> and putting everything in one implementation allows you to make `noCondenseStrings` a parameter instead of a global whole-project configuration swtich |
10:36:28 | FromDiscord | <haxscramper> that is - if you will need this at some point |
10:40:11 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3wr1 |
10:40:50 | FromDiscord | <enthus1ast> in theory it should result in less overall string concatinations |
10:41:40 | FromDiscord | <enthus1ast> but more compile time \:) |
10:41:53 | FromDiscord | <enthus1ast> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/877864679286902825): in theory it should result in less overall string concatinations on runtime/production |
10:43:15 | FromDiscord | <haxscramper> Wwe have `std/ropes` for O(1) concatenation of strings |
10:44:02 | FromDiscord | <enthus1ast> i tried ropes in my tests (the user actually can decide) but it was much slower |
10:44:26 | FromDiscord | <enthus1ast> only faster for huge strings (but this is kinda expected) |
10:46:10 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3wr2 |
10:48:10 | FromDiscord | <haxscramper> Except for strings (which has it implemented via magic) `&=` is an alias for `add` |
10:48:18 | FromDiscord | <haxscramper> Just like `notin`, `in` etc |
10:48:22 | FromDiscord | <haxscramper> `!=` |
10:48:45 | FromDiscord | <haxscramper> In most cases you don't write these operators, but rather defined `==`, `contains` and `add` |
10:49:23 | FromDiscord | <haxscramper> So if you require `.add` instead, you would get both |
10:50:06 | FromDiscord | <enthus1ast> i was even thinking about also give the user the option to have the template compile macro generates an iterator body, yielding every string etc, then it would also work for a later "streaming template" |
10:50:31 | FromDiscord | <enthus1ast> an template that never finish rendering |
10:55:10 | FromDiscord | <enthus1ast> and it would also use less memory, if the underlying httpserver can send data in chunks |
11:12:04 | * | tdc joined #nim |
11:14:39 | * | tdc_ quit (Ping timeout: 268 seconds) |
11:16:15 | FromDiscord | <PsychoClay> is there a way to do this `TypeReg = TableRef[uint32, typedesc]` without making TypeReg generic? |
11:16:53 | FromDiscord | <Rika> No, that makes no sense |
11:16:58 | FromDiscord | <Rika> How would that work? |
11:17:08 | FromDiscord | <PsychoClay> i just want a table to map ints to types |
11:17:36 | FromDiscord | <Rika> For what? |
11:17:43 | FromDiscord | <Rika> You can’t use types in runtime anyway |
11:18:29 | FromDiscord | <PsychoClay> for ecs |
11:23:29 | FromDiscord | <haxscramper> types does not exist at runtime and cannot be used as a value |
11:23:47 | FromDiscord | <PsychoClay> hmm |
11:23:48 | FromDiscord | <haxscramper> The best you can do is `Table[uint32, NimNode]` where nim node has a symbol of a type |
11:37:10 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3wrd |
11:37:49 | FromDiscord | <PsychoClay> In reply to @enthus1ast "<@596976507033747466>\: in my (toy)": oh nice tnx |
11:37:55 | FromDiscord | <enthus1ast> but idk if the speed is comparable to real ecs \:) |
11:40:04 | FromDiscord | <enthus1ast> it was fast enough for my purpose, though |
11:44:01 | * | jjido joined #nim |
11:46:09 | FromDiscord | <planetis> do you need something comparable to rust anymap? |
11:52:04 | FromDiscord | <haxscramper> you can write a macro that uses https://nim-lang.org/docs/macros.html#symBodyHash%2CNimNode and accepts `typedesc` |
11:52:18 | FromDiscord | <haxscramper> And then do `const typeHash = getTypeHash(T)` |
11:53:57 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3wrm |
12:06:02 | * | supakeen quit (Quit: WeeChat 3.2) |
12:06:32 | * | supakeen joined #nim |
12:08:38 | * | max22- quit (Ping timeout: 256 seconds) |
12:12:53 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
12:22:39 | * | rockcavera joined #nim |
12:22:39 | * | rockcavera quit (Changing host) |
12:22:39 | * | rockcavera joined #nim |
12:31:41 | FromDiscord | <PsychoClay> sent a code paste, see https://play.nim-lang.org/#ix=3wrB |
12:36:08 | * | arkurious joined #nim |
12:40:01 | FromDiscord | <PsychoClay> sent a code paste, see https://play.nim-lang.org/#ix=3wrC |
12:47:18 | PMunch | å/query #federico |
12:47:24 | PMunch | Whoops |
12:47:33 | federico3 | :D |
12:47:52 | PMunch | Just a small question about SBCs |
12:54:55 | * | xet7 quit (Remote host closed the connection) |
12:56:06 | * | xet7 joined #nim |
12:56:57 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3wrF |
12:57:11 | FromDiscord | <haxscramper> As usual, working with types in macro would involve random numbero of `getype()` and typedesc unwraps that are placed around the code |
12:58:11 | FromDiscord | <PsychoClay> sent a code paste, see https://paste.rs/cLF |
12:58:29 | FromDiscord | <NumLock> Hello |
12:59:38 | * | xet7 quit (Read error: Connection reset by peer) |
13:00:48 | * | xet7 joined #nim |
13:01:38 | FromDiscord | <haxscramper> Well, it uses actual tool designed for that kind of task (mapping types to hashes), but if you are fine with `hash($T)` then ok↵(@PsychoClay) |
13:07:19 | FromDiscord | <haxscramper> also you can just do `const h = hash($typeof(T))` |
13:09:41 | FromDiscord | <PsychoClay> isnt `typeof T == T`? |
13:10:43 | * | Vladar quit (Quit: Leaving) |
13:43:31 | FromDiscord | <gerwy> how do i know if threads are on or off?↵i tried using `defined(threads)` but it works for -d symbol, not the threads option |
13:43:44 | FromDiscord | <Rika> compileoption |
13:43:46 | FromDiscord | <Rika> ? |
13:43:49 | FromDiscord | <gerwy> :o |
13:44:19 | FromDiscord | <Rika> https://nim-lang.org/docs/system.html#compileOption%2Cstring |
13:44:20 | FromDiscord | <gerwy> oooh in system module |
13:44:29 | FromDiscord | <gerwy> thaaank you<3 |
13:50:23 | * | Vladar joined #nim |
13:59:17 | * | PMunch quit (Quit: Leaving) |
14:01:52 | * | rockcavera quit (Remote host closed the connection) |
14:13:57 | * | max22- joined #nim |
14:16:19 | * | jjido joined #nim |
14:18:13 | * | jjido quit (Client Quit) |
14:25:20 | FromDiscord | <TechnoRazor> Is there such thing as an `else when` statement, similar to `else if`? |
14:25:57 | FromDiscord | <TechnoRazor> (edit) "`else if`?" => "`elif`?" |
14:31:19 | FromDiscord | <Rika> Exactly that |
14:31:25 | FromDiscord | <Rika> You can use those with when statements |
14:34:05 | FromDiscord | <TechnoRazor> Oh, I didn't realize, thanks |
14:36:08 | * | stkrdknmibalz quit (Quit: WeeChat 3.0.1) |
15:06:43 | FromDiscord | <enthus1ast> can i test if i'm in a compiletime or runtime context? |
15:07:29 | FromDiscord | <enthus1ast> like\:`when compileTime:` |
15:08:06 | FromDiscord | <xflywind> `when nimvm`? |
15:09:05 | FromDiscord | <enthus1ast> let me try |
15:11:14 | FromDiscord | <enthus1ast> yes seems to work, thanks @xflywind |
15:11:27 | FromDiscord | <xflywind> np |
15:59:33 | FromDiscord | <gerwy> Made Julia set today, that is optimized like mandelbrot version :D |
16:00:23 | * | xxov joined #nim |
16:26:06 | * | Pyautogui joined #nim |
16:27:43 | Pyautogui | I am trying to assign the maximum value of a uint64 as a constant to a uint64. However, I keep getting a value out of range error. I can do it by decrementing the uint at zero, but not by assigning it. Is this a bug? |
16:30:35 | FromDiscord | <moein> hi is it possible to get a key value from object?↵like in javascript i can do Object['key'] and the value of 'key' will return |
16:33:37 | FromDiscord | <linux user> In reply to @Pyautogui "I am trying to": no u cant |
16:33:59 | FromDiscord | <linux user> you have to stop beofre it resets |
16:34:34 | Pyautogui | Could you clarify? I am a beginner at using Nim. |
16:35:30 | FromDiscord | <exelotl> Sounds like a bug to me |
16:35:40 | FromDiscord | <linux user> ... |
16:36:03 | FromDiscord | <exelotl> Unless you're trying to assign 2^64 |
16:36:09 | FromDiscord | <undersquire> ^ |
16:36:11 | FromDiscord | <linux user> sent a code paste, see https://play.nim-lang.org/#ix=3wtg |
16:36:19 | FromDiscord | <undersquire> there is a stdlib thing for max values |
16:36:52 | Pyautogui | Got it |
16:37:06 | Pyautogui | 2^64 - 1 was the value I was trying to assign. |
16:37:12 | FromDiscord | <linux user> (edit) "https://play.nim-lang.org/#ix=3wtg" => "https://play.nim-lang.org/#ix=3wth" |
16:37:29 | Pyautogui | thanks |
16:37:41 | FromDiscord | <linux user> 😃> |
16:37:45 | FromDiscord | <linux user> (edit) "😃>" => "😃." |
16:37:47 | FromDiscord | <konsumlamm> well, that would require evaluating 2^64 first, which would overflow |
16:37:55 | FromDiscord | <linux user> ohyes lol |
16:38:26 | Pyautogui | No, I was writing it out as a explicit number |
16:38:32 | Pyautogui | No evaluation required |
16:38:52 | Pyautogui | 18446744073709551615 |
16:40:11 | FromDiscord | <exelotl> I guess it would work if you included the type postfix like 18446744073709551615'u64 |
16:40:40 | Pyautogui | Yes, thanks, that works. |
16:40:52 | Pyautogui | I was trying to do uint64(18446744073709551615) |
16:43:35 | FromDiscord | <moein> In reply to @moein "hi is it possible": hash table is my answer apparently |
16:59:11 | FromDiscord | <enthus1ast> is there a runtime replacement of parseStmt that returns PNode? |
17:06:09 | * | Pyautogui quit (Ping timeout: 248 seconds) |
17:10:44 | FromDiscord | <linux user> In reply to @Pyautogui "I was trying to": is this a proc |
17:15:13 | FromDiscord | <enthus1ast> maybe https://nim-lang.org/docs/compiler/parser.html#parseString%2Cstring%2CIdentCache%2CConfigRef%2Cstring%2Cint%2CErrorHandler |
17:31:35 | FromDiscord | <haxscramper> yes. or `parseAll` https://github.com/haxscramper/hnimast/blob/master/src/hnimast/pnode_parse.nim#L44 |
17:31:51 | * | rockcavera joined #nim |
17:31:51 | * | rockcavera quit (Changing host) |
17:31:51 | * | rockcavera joined #nim |
17:51:45 | FromDiscord | <gerwy> does c2nim works on C code that uses SDL? |
17:54:06 | FromDiscord | <haxscramper> SDL is a c simple C library, so there should be no issues |
17:59:25 | * | jjido joined #nim |
18:06:40 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
18:28:37 | FromDiscord | <moein> when i'm returning a hash table using table module what should i set my return in proc? |
18:29:11 | FromDiscord | <enthus1ast> Table[Hash, YourStuff] |
18:29:15 | FromDiscord | <moein> sent a code paste, see https://play.nim-lang.org/#ix=3wtR |
18:29:39 | FromDiscord | <enthus1ast> ok then Table[string, int] |
18:31:13 | FromDiscord | <enthus1ast> nope newTable is TableRef[string, int] |
18:31:44 | FromDiscord | <moein> nice thanks |
18:32:00 | FromDiscord | <enthus1ast> but, there is also toTable |
18:32:15 | FromDiscord | <enthus1ast> do you want a Table\_Ref\_ ? |
18:33:43 | FromDiscord | <moein> I'm not sure i need a map that i can iterate on it. maybe there is better options i'm not aware of |
18:33:59 | FromDiscord | <enthus1ast> yeah then better use toTable |
18:35:15 | FromDiscord | <moein> thanks |
18:37:37 | * | Vladar quit (Quit: Leaving) |
18:40:23 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3wtT |
18:40:49 | FromDiscord | <enthus1ast> he wants to iterate |
18:42:38 | FromDiscord | <moein> In reply to @Yardanico "also, just so you": yes keys won't change but i need to iterate over them |
19:00:26 | * | idf quit (*.net *.split) |
19:00:27 | * | mjsir911 quit (*.net *.split) |
19:00:27 | * | Amun-Ra quit (*.net *.split) |
19:00:38 | * | idf joined #nim |
19:01:09 | * | Amun-Ra joined #nim |
19:03:15 | * | mjsir911 joined #nim |
19:08:21 | FromDiscord | <moein> does nim support || operator? |
19:08:39 | FromDiscord | <moein> in a if statement i need to check variable against two values |
19:08:49 | FromDiscord | <moein> like this: if goal == "weightLoss" || goal == "weightGain": |
19:09:17 | FromDiscord | <enthus1ast> `or`? |
19:10:04 | FromDiscord | <moein> yeah exactly |
19:10:24 | FromDiscord | <moein> nice |
19:20:43 | FromDiscord | <haxscramper> In reply to @moein "like this: if goal": IIRC You can also do `goal in ["weightGain", "weightLoss"]` |
19:23:09 | FromDiscord | <enthus1ast> yes |
19:23:34 | FromDiscord | <enthus1ast> `for goal in ["weightGain", "weightLoss"]: ` you mean? |
19:25:09 | FromDiscord | <enthus1ast> but yes |
19:36:07 | * | Amun-Ra quit (Quit: Gdyby mi się chciało tak jak mi się nie chce...) |
19:36:27 | * | Amun-Ra joined #nim |
19:44:27 | FromDiscord | <haxscramper> No, as condition, instead of repeating goal == |
19:44:43 | FromDiscord | <enthus1ast> yes |
19:44:47 | * | cyraxjoe joined #nim |
19:56:49 | * | xxov quit (Ping timeout: 246 seconds) |
20:12:46 | * | xet7 quit (Remote host closed the connection) |
20:13:52 | * | xet7 joined #nim |
20:32:08 | * | jjido joined #nim |
20:34:54 | * | tdc quit (Quit: Leaving) |
20:36:23 | madprops | s &= if (m and vf) or (not m and not vf): |
20:36:26 | madprops | is that allowed? |
20:36:30 | madprops | (it also has an else) |
20:36:46 | madprops | I mean can I append &= from an if like that? |
20:37:19 | FromDiscord | <Elegantbeef> You can |
20:38:19 | FromDiscord | <Elegantbeef> You could also do https://play.nim-lang.org/#ix=3wue but this is getting into bikeshed territory |
20:39:15 | madprops | interesting |
20:39:56 | madprops | it's just that im getting |
20:39:57 | madprops | Error: expression expected, but found 'keyword if' |
20:40:09 | FromDiscord | <Elegantbeef> full code example? |
20:40:11 | madprops | https://dpaste.org/vx1L |
20:40:23 | madprops | or i can post fuller |
20:40:38 | madprops | ns_vowels and ns_constants are arrays of chars |
20:41:31 | madprops | if i use an intermediary variable to store the result |
20:41:34 | madprops | i then can append it to s |
20:41:54 | FromDiscord | <Elegantbeef> Fuller code would be nicer, something i can run |
20:42:09 | madprops | ok |
20:43:34 | madprops | https://play.nim-lang.org/#ix=2sSr |
20:43:54 | madprops | ok forgot to add n |
20:44:02 | madprops | n can be 4 for example |
20:44:39 | madprops | also that returns shouldn't be there |
20:44:59 | FromDiscord | <Elegantbeef> ix.io didnt like that url, only getting a C file |
20:45:47 | madprops | https://dpaste.org/LWQ4 |
20:48:09 | madprops | https://play.nim-lang.org/#ix=3wuf |
20:48:20 | FromDiscord | <Elegantbeef> Ah ok so the issue seems to be with the `&=` operator you need to enclose the expression in `()` otherwise it doesnt work |
20:49:11 | madprops | the whole if else or just the if ? |
20:50:15 | madprops | ok it's the full if else |
20:50:16 | madprops | why is that though |
20:51:58 | FromDiscord | <Elegantbeef> Seems assignment operators do not like unwrapped expressions |
20:53:44 | FromDiscord | <j-james> How is this project able to reference files from a containing directory? |
20:53:44 | FromDiscord | <j-james> https://github.com/pragmagic/godot-nim/blob/master/godot/core/aabb.nim#L6 |
20:55:45 | FromDiscord | <⃟⃟> can you make a `++` operator like `a ++ b` |
20:56:07 | FromDiscord | <Elegantbeef> You can make binary and infix operators |
20:56:14 | FromDiscord | <Elegantbeef> no postfix |
20:56:53 | FromDiscord | <j-james> In reply to @j-james "How is this project": Ah, never mind, I missed the sneaky `nim.cfg` file |
20:57:45 | FromDiscord | <Elegantbeef> i mean infix and prefix, no postfix operators |
21:01:29 | FromDiscord | <⃟⃟> wait |
21:01:36 | FromDiscord | <⃟⃟> what type are strings |
21:02:01 | FromDiscord | <Elegantbeef> Strings |
21:02:02 | FromDiscord | <Elegantbeef> `string` exactly |
21:02:18 | FromDiscord | <⃟⃟> so they arent some char[] type or something? |
21:02:28 | FromDiscord | <Elegantbeef> No they're pascal style strings |
21:02:34 | FromDiscord | <Elegantbeef> if you want a C string use `cstring` |
21:03:05 | FromDiscord | <⃟⃟> i dont |
21:03:47 | FromDiscord | <⃟⃟> i was just expecting them to be some sort of arraylist of characters |
21:03:50 | FromDiscord | <⃟⃟> not a special type |
21:04:21 | FromDiscord | <Elegantbeef> Well they're internally the same as `seq[char]` with some caveats |
21:04:38 | FromDiscord | <⃟⃟> like what |
21:04:39 | FromDiscord | <Elegantbeef> the character after the last one is always a `\0` so you can do `.cstring` for free |
21:14:27 | * | supakeen quit (Remote host closed the connection) |
21:14:51 | * | supakeen joined #nim |
21:23:11 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
21:44:42 | madprops | how should I doc-comment this? https://dpaste.org/OAkv |
21:45:29 | FromDiscord | <Elegantbeef> well you shouldnt use a table for a start |
21:47:29 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3wuv is just better 😀 |
21:47:58 | madprops | ah nice |
21:48:43 | FromDiscord | <Elegantbeef> also could've used `array['a'..'c', int]` but not overly needed since this is a simple conversion |
21:49:20 | madprops | so by implementing toAlphabetPos you get a toIndex method ? |
21:49:39 | FromDiscord | <Elegantbeef> Nah i just changed the name |
21:49:43 | FromDiscord | <Elegantbeef> I'm a dumb dumb |
21:50:21 | FromDiscord | <Elegantbeef> it was `toIndex` but that wasnt a good name so changed it to `toAlphabetPos` and forgot to change the calling code |
21:50:24 | madprops | so that's faster than a table? |
21:50:35 | FromDiscord | <Elegantbeef> Vastly |
21:50:59 | FromDiscord | <Elegantbeef> Well it doesnt need to hash a byte, so it's not "vastly" but is faster |
21:51:33 | madprops | i see |
21:51:38 | FromDiscord | <Elegantbeef> You can always benchmark it, i imagine it'll be faster in larger numbers, but it's more of a case of not using a useless table and using more memory |
21:52:51 | madprops | ok using that also got rid of 2 imports |
21:52:56 | madprops | tables and enumerate |
22:01:04 | * | max22- quit (Quit: Leaving) |
22:10:39 | madprops | hmm having some issue not sure why https://dpaste.org/KPT1 |
22:15:22 | madprops | ok seems it was a strformat issue again |
22:15:28 | madprops | had to precalculate a var |
22:17:25 | * | Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in) |
22:18:52 | FromDiscord | <enthus1ast> yeah first runtime evaluated nimja templates \:D |
22:21:27 | madprops | how can I specify output for nim docs? |
22:21:46 | madprops | instead of putting it in src/ |
22:22:29 | madprops | or should I move the output manually |
22:22:42 | FromDiscord | <enthus1ast> ` -o:docs/` |
22:23:13 | FromDiscord | <enthus1ast> nim doc --project -o\:docs/ src/nimja.nim |
22:23:19 | madprops | why --project ? |
22:23:51 | FromDiscord | <enthus1ast> this also generates docs for all imported modules |
22:24:16 | madprops | oh |
22:24:25 | madprops | including std modules? |
22:24:48 | FromDiscord | <enthus1ast> ähm |
22:25:01 | FromDiscord | <enthus1ast> i don't think so |
22:25:20 | madprops | local modules yeah |
22:25:24 | madprops | it's just that i have a single file |
22:26:18 | FromDiscord | <enthus1ast> then you dont need --project i suppose |
22:27:20 | madprops | weird thing is that it creates theindex.html |
22:27:28 | madprops | and thelibname.html |
22:27:48 | FromDiscord | <enthus1ast> this you can disable |
22:28:21 | madprops | ok I see |
22:28:25 | madprops | using --indexs |
22:28:29 | madprops | --index |
22:28:38 | FromDiscord | <Elegantbeef> Mad you may want to use `strformat.%` |
22:29:13 | FromDiscord | <Elegantbeef> Actually why are you even using formatting there |
22:30:26 | madprops | to avoid & " " & ? |
22:33:05 | FromDiscord | <Elegantbeef> Sure but https://play.nim-lang.org/#ix=3wuE |
22:33:58 | FromDiscord | <Elegantbeef> sorry forgot the `import std/strformat` |
22:34:25 | madprops | you're right |
22:34:53 | FromDiscord | <Elegantbeef> Jesus today is not my day, cannot right any usable code today 😀 |
22:36:56 | madprops | https://dpaste.org/xnom |
22:37:10 | * | xet7 quit (Remote host closed the connection) |
22:37:27 | FromDiscord | <Elegantbeef> Why are you writing to a temp variable then returning?! |
22:39:09 | madprops | because i might add to the s variable |
22:39:24 | FromDiscord | <Elegantbeef> But result exists |
22:41:03 | madprops | you mean the if result? |
22:41:08 | FromDiscord | <Elegantbeef> The uppityness about result is mostly joking, but https://play.nim-lang.org/#ix=3wuF |
22:41:19 | FromDiscord | <Elegantbeef> Nim has the explict result variable, no reason to make your own |
22:41:25 | FromDiscord | <Elegantbeef> implicit\ |
22:41:30 | FromDiscord | <Elegantbeef> I really cannot do anything right today |
22:42:26 | madprops | oh i forgot nim had the result thing |
22:47:46 | madprops | cleaned up some lines using result, nice |
22:57:16 | FromDiscord | <QueenFuckingAdrielle> hulloh |
22:58:54 | FromDiscord | <QueenFuckingAdrielle> Its been a while since I've been here, still my favorite programming discord |
22:59:00 | FromDiscord | <Elegantbeef> Hello |
22:59:07 | FromDiscord | <QueenFuckingAdrielle> Hey elegant |
22:59:36 | FromDiscord | <QueenFuckingAdrielle> changed my name, used to be gyllou, im the robot chick |
23:00:24 | FromDiscord | <Elegantbeef> Ah |
23:00:49 | FromDiscord | <QueenFuckingAdrielle> you gave me a bunch of advice a while back lol |
23:00:50 | * | flynn quit (Read error: Connection reset by peer) |
23:01:12 | FromDiscord | <QueenFuckingAdrielle> i have a new consulting job i might be able to use nim for so im excited |
23:01:43 | FromDiscord | <Elegantbeef> Nice, becoming a more common phrase to hear |
23:01:56 | * | flynn joined #nim |
23:02:00 | FromDiscord | <QueenFuckingAdrielle> yea im in a good spot to push for it now thankfully |
23:02:31 | FromDiscord | <QueenFuckingAdrielle> still working on our robotics platform as well. not sure what sort of bd we are headed for though |
23:03:04 | FromDiscord | <QueenFuckingAdrielle> im hopefully going to be using in this biotech contract i have though |
23:03:37 | FromDiscord | <QueenFuckingAdrielle> are you in the us elegant? |
23:04:37 | * | xet7 joined #nim |
23:08:59 | nrds | <Prestige99> Hope you get to use Nim, that would be awesome |
23:10:08 | FromDiscord | <Elegantbeef> Nope |
23:10:19 | FromDiscord | <Elegantbeef> Slightly north of that land |
23:11:00 | FromDiscord | <ynfle (ynfle)> Canada! No way! |
23:11:24 | FromDiscord | <Elegantbeef> Very much so |
23:12:31 | * | stkrdknmibalz joined #nim |
23:12:50 | FromDiscord | <Elegantbeef> ynfle what's so impressive with RNGing myself here? 😛 |
23:13:32 | FromDiscord | <QueenFuckingAdrielle> O_o |
23:16:22 | FromDiscord | <ynfle (ynfle)> I'm from Canada too |
23:16:45 | FromDiscord | <QueenFuckingAdrielle> not far off here, upstate ny |
23:17:09 | FromDiscord | <Elegantbeef> I mean i'm far from NY so yes i am |
23:17:44 | FromDiscord | <QueenFuckingAdrielle> lol well yes, i imagine not everyone lives that close to nys |
23:18:26 | FromDiscord | <QueenFuckingAdrielle> i just wanted to live somewhere decent thats as far away without needing a visa |
23:18:40 | FromDiscord | <ynfle (ynfle)> Alaska? |
23:18:58 | FromDiscord | <ynfle (ynfle)> Hawaii? |
23:18:59 | FromDiscord | <QueenFuckingAdrielle> i thought about it, but they arent very nice to gay people there for the most part |
23:19:12 | FromDiscord | <QueenFuckingAdrielle> no thanks on hawaii, too hot |
23:19:54 | FromDiscord | <QueenFuckingAdrielle> It was between main and nys, decided on nys because of the economy |
23:20:09 | FromDiscord | <QueenFuckingAdrielle> (edit) "main" => "maine" |
23:24:29 | FromDiscord | <Elegantbeef> Where you located ynfle, i'm in bumfuck nowhere alberta? \:D |
23:27:33 | FromDiscord | <ynfle (ynfle)> Lol, sounds like it |
23:27:36 | FromDiscord | <ynfle (ynfle)> Ontario |
23:27:53 | FromDiscord | <ynfle (ynfle)> Well not now. I'm a student elsewhere |