00:00:49 | FromDiscord | <zumi.dxy> sent a code paste, see https://play.nim-lang.org/#pasty=RTwbkebhaFNp |
00:01:07 | FromDiscord | <zumi.dxy> or `year mod 4`, idk |
00:01:23 | FromDiscord | <zumi.dxy> does the compiler optimize the latter to the former |
00:01:33 | FromDiscord | <zumi.dxy> (C or Nim, doesn't matter) |
00:21:46 | FromDiscord | <polylokh_39446> it's cryptic either way, it's calendar math. |
00:22:39 | FromDiscord | <polylokh_39446> the practical advantage of mod is only that you're less likely to have someone tell you to be less cryptic because the "pointless optimization" is very well known |
00:23:33 | FromDiscord | <polylokh_39446> but they're telling you that because it's so well known and not because anybody who doesn't understand the code is going to understand it better with the change |
00:51:11 | * | def- quit (Quit: -) |
00:51:59 | * | def- joined #nim |
01:06:00 | * | def- quit (Quit: -) |
01:07:50 | * | def- joined #nim |
01:16:30 | * | gst quit (Ping timeout: 250 seconds) |
01:45:03 | * | xutaxkamay quit (Quit: ZNC 1.8.2+deb3.1 - https://znc.in) |
01:45:17 | * | xutaxkamay joined #nim |
01:51:57 | * | nazgulsenpai quit (Ping timeout: 252 seconds) |
01:54:54 | * | nazgulsenpai joined #nim |
02:13:16 | * | def- quit (Quit: -) |
02:13:28 | * | def- joined #nim |
02:37:05 | FromDiscord | <user2m> sent a code paste, see https://play.nim-lang.org/#pasty=keZPCtNqeQwo |
02:37:36 | FromDiscord | <user2m> (edit) "https://play.nim-lang.org/#pasty=YBwgCVfBiXtK" => "https://play.nim-lang.org/#pasty=NLtPEzvnNyaA" |
04:09:47 | * | krux02_ quit (Remote host closed the connection) |
04:21:08 | FromDiscord | <polylokh_39446> I get the same thing. What's interesting is that I don't see any syscalls to explain it.↵it connects, successfully sets a socket option, and then immediately prints a traceback and exits. |
04:21:25 | FromDiscord | <polylokh_39446> the error's in checkReply but there's no I/O on the socket |
04:22:50 | FromDiscord | <polylokh_39446> sent a code paste, see https://play.nim-lang.org/#pasty=AWBkytBnIfYg |
04:24:18 | FromDiscord | <polylokh_39446> and there, the issue is probably that it it's not strictly following the protocol, and sending HELO before the server greets it (cPanel does this precisely to kick scripts. BTW it's easy to get blacklisted by big sites if you have minor SMTP errors, you should test with your own server) |
04:28:17 | FromDiscord | <polylokh_39446> I suspect smtp's broken with ssl. It's a bunch of async code and therefore forbidden to me. |
04:56:23 | * | rockcavera quit (Remote host closed the connection) |
05:33:35 | * | ntat joined #nim |
06:06:35 | * | PMunch joined #nim |
06:19:19 | FromDiscord | <xkonti> I just read the small print that async procs (asyncdispatch) can utilize the `raises` pragma 😢 I wonder if somebody is in the know if which async/await library (asyncdispatch vs chronos) is more prolific throughout the Nim ecosystem and where things are going. |
06:19:35 | FromDiscord | <xkonti> (edit) "can" => "can't" |
06:25:12 | * | def- quit (Quit: -) |
06:25:52 | * | def- joined #nim |
06:28:22 | FromDiscord | <Elegantbeef> Asyncdispatch gets its hands on everything but chronos is likely slightly better |
06:35:35 | PMunch | Asyncdispatch is definitely the most widely used one |
06:35:38 | FromDiscord | <Phil> I tend to write first against asyncdispatch because being in std and without some kind of big signage shouting "Go chronos, default to chronos, for all that is holy go chronos" means it is the default people are going to use |
06:36:29 | FromDiscord | <Phil> I'll look into making rex eventually chronos compatible via compiletime switch or sth, should be simple enough given that both have async-await and waitFor |
06:36:35 | FromDiscord | <Phil> At least I think chronos has waitFor |
06:36:38 | PMunch | I wonder how hard it would be to write a compatibility layer so that Chronos and asyncdispatch can be mixed |
06:37:14 | FromDiscord | <Phil> In reply to @PMunch "I wonder how hard": Depending on the circumstances: Very, asyncdispatch has some things in it that make it tempting to use that chronos just does not have and will not have because they promote bad design |
06:37:22 | FromDiscord | <Phil> Like being able to check if there is async work before you poll |
06:38:27 | FromDiscord | <Phil> Okay, phew, yes chronos does have waitFor |
06:38:46 | PMunch | What do you mean "check if there is async work before you poll"? |
06:39:15 | FromDiscord | <Phil> So you know how if you call poll when there is nothing in the asyncdispatcher you'll get an exception? |
06:39:34 | FromDiscord | <Phil> asyncdispatch has a proc that lets you check if the asyncdispatcher is empty or not |
06:40:10 | PMunch | Right |
06:40:16 | PMunch | Makes sense |
06:40:17 | FromDiscord | <Phil> Which is sth you likely shouldn't do in the first place because if that's needed and you're likely in a while-loop then you should be putting the thread into a low powers state until you wake it up with a signal |
06:40:36 | FromDiscord | <Phil> But wrapping your brain around the second solution is (for me at least) harder |
06:40:50 | FromDiscord | <Phil> And implies multithreading. I still don't get all the implications that come with it |
06:40:58 | FromDiscord | <Phil> It is certainly not the simpler approach, though likely the overall cleaner one |
06:43:35 | FromDiscord | <Phil> sent a long message, see https://pasty.ee/CNEPeWCAmQZV |
06:43:53 | FromDiscord | <Phil> Definitely better design, Definitely harder to understand and deal with |
06:49:27 | * | def- quit (Quit: -) |
06:50:31 | * | def- joined #nim |
07:40:26 | * | def- quit (Quit: -) |
07:40:45 | * | def- joined #nim |
07:44:29 | * | def- quit (Client Quit) |
07:48:44 | * | redj_ quit (Remote host closed the connection) |
07:50:06 | * | redj joined #nim |
08:01:51 | * | gst joined #nim |
08:02:40 | * | def- joined #nim |
08:18:05 | * | def- quit (Quit: -) |
08:19:03 | * | def- joined #nim |
08:28:10 | * | beholders_eye joined #nim |
08:40:29 | * | beholders_eye quit (Ping timeout: 240 seconds) |
08:54:14 | * | beholders_eye joined #nim |
09:30:50 | FromDiscord | <ieltan> In reply to @PMunch "I wonder how hard": That's basically yasync` if it had chronos support |
09:30:58 | FromDiscord | <ieltan> (edit) "yasync`" => "`yasync`" |
09:34:16 | FromDiscord | <ieltan> https://github.com/yglukhov/yasync |
09:34:33 | PMunch | Hmm, yeah that seems similar to what I had in mind |
09:34:46 | PMunch | But I was more thinking of a way to mix Chronos and asyncdispatch |
09:35:04 | PMunch | This seems like a repo to abstract async away so it could be used in either system |
09:35:43 | FromDiscord | <ieltan> In reply to @PMunch "But I was more": How would that work though? Would you end up with two event loops or you combine into a single one? |
09:36:06 | PMunch | Well they'd have to be combined somehow, to tick both of them |
09:36:47 | PMunch | I'm more curious about how a Chronos library could be made to call an asyncdispatch procedure and vice-versa |
09:39:34 | FromDiscord | <ieltan> sent a code paste, see https://play.nim-lang.org/#pasty=xPHMcCBzThyu |
09:42:58 | FromDiscord | <ieltan> I think one issue is that you need to make sure you use the right waitFor |
09:43:25 | FromDiscord | <ieltan> And how this black magic actually interacts with the library |
10:25:33 | * | gst quit (Quit: Client closed) |
10:28:53 | * | gooba quit (Ping timeout: 240 seconds) |
10:44:12 | FromDiscord | <xkonti> Thank you @ElegantBeef @pmunch @Phil I'll use asyncdispatch for CommonFs. The only bad part is that I'll loose functionality where the compiler forces the method implementation to throw only a specified set of errors 😦 |
10:46:25 | PMunch | Only a specified set of errors? That doesn't sound right |
10:49:12 | FromDiscord | <xkonti> I used "raises" pragma on the base method and it prevents the overloading method from throwing any errors other than the specified. This feature was awesome |
11:05:55 | * | gst joined #nim |
11:18:24 | FromDiscord | <xtrayambak> How can I get the number of states an enum has at compile time? |
11:22:17 | FromDiscord | <Robyn [She/Her]> In reply to @xtrayambak "How can I get": `high(MyEnum)` maybe? Wouldn't work for enums with holes though |
11:23:37 | * | beholders_eye quit (Read error: Connection reset by peer) |
11:23:38 | FromDiscord | <Robyn [She/Her]> In reply to @xtrayambak "How can I get": You can also do `Enum.items.toSeq.len` if you import `std/sequtils` |
11:23:45 | FromDiscord | <Robyn [She/Her]> (edit) "`Enum.items.toSeq.len`" => "`MyEnum.items.toSeq.len`" |
11:27:31 | FromDiscord | <odexine> Preferably do that on compile time |
11:29:31 | * | beholders_eye joined #nim |
11:32:08 | * | krux02 joined #nim |
12:10:22 | * | krux02_ joined #nim |
12:12:54 | * | krux02 quit (Ping timeout: 256 seconds) |
12:34:28 | Amun-Ra | Robyn: high won't work even on enums without holes |
12:39:12 | * | PMunch quit (Read error: Connection reset by peer) |
12:55:18 | * | def- quit (Quit: -) |
12:56:33 | * | def- joined #nim |
13:10:41 | * | PMunch joined #nim |
13:12:33 | FromDiscord | <Robyn [She/Her]> In reply to @Amun-Ra "Robyn: high won't work": Ah, oh well |
13:13:06 | FromDiscord | <Robyn [She/Her]> How does `once` work btw, for anyone who does know |
13:14:50 | FromDiscord | <solitudesf> In reply to @chronos.vitaqua "How does `once` work": you can just look at source. its just an implicit global.↵https://github.com/nim-lang/Nim/blob/version-2-0/lib/system.nim#L2630 |
13:22:25 | * | def- quit (Quit: -) |
13:23:00 | FromDiscord | <Robyn [She/Her]> Oh nice |
13:24:55 | * | def- joined #nim |
13:31:28 | FromDiscord | <Zoom> sent a code paste, see https://play.nim-lang.org/#pasty=bCJDspdMRaar |
13:36:23 | * | rockcavera joined #nim |
13:38:19 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#pasty=gXRjVhqEoAQU |
13:41:12 | FromDiscord | <odexine> missing `_: ` before `typedesc` |
13:46:23 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @odexine "missing `_: ` before": alright, thanks↵And can I do↵Engine.layers[anIndex] function? Knowing the fact there is no layer field |
13:46:26 | FromDiscord | <System64 ~ Flandre Scarlet> (edit) "layer" => "layers" |
13:46:38 | FromDiscord | <odexine> i dont think you can do the fake field index function |
13:47:00 | FromDiscord | <System64 ~ Flandre Scarlet> oh, a bit sad |
13:53:25 | * | gst quit (Quit: Client closed) |
13:57:51 | * | PMunch_ joined #nim |
13:59:03 | * | PMunch quit (Ping timeout: 252 seconds) |
14:01:36 | * | PMunch_ quit (Remote host closed the connection) |
14:01:49 | * | PMunch_ joined #nim |
14:09:02 | * | PMunch_ quit (Quit: Leaving) |
14:26:49 | * | rockcavera quit (Remote host closed the connection) |
14:29:44 | * | gst joined #nim |
15:24:48 | FromDiscord | <Robyn [She/Her]> sent a long message, see https://pasty.ee/PcRBeclPakCC |
15:25:42 | FromDiscord | <Robyn [She/Her]> Huh... Oh wait IRC does have multiline, does it? |
15:26:23 | FromDiscord | <Robyn [She/Her]> In reply to @chronos.vitaqua "!eval type MyType =": Tested it locally, does not work rip |
15:34:02 | FromDiscord | <xtrayambak> sent a code paste, see https://play.nim-lang.org/#pasty=JWRRPIWSKwVV |
15:37:25 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=HFRAXCAgMFpB |
15:40:57 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=RUVIcCYCnqDu |
16:05:27 | FromDiscord | <solitudesf> sent a code paste, see https://play.nim-lang.org/#pasty=wCDwgdCIPtKY |
16:12:23 | FromDiscord | <Robyn [She/Her]> Why are people using macros 😭 |
16:16:03 | FromDiscord | <Phil> Because I can't put options of different types in a seq |
16:16:12 | FromDiscord | <Robyn [She/Her]> -.- |
16:16:23 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=wadiEpkKSrIi |
16:18:22 | * | def- quit (Quit: -) |
16:22:09 | * | def- joined #nim |
16:25:07 | * | def- quit (Client Quit) |
16:27:11 | * | def- joined #nim |
16:28:34 | * | fallback quit (Read error: Connection reset by peer) |
16:44:44 | * | fallback joined #nim |
16:49:08 | FromDiscord | <firasuke> I am impressed by Nim's enums, but what are some advantages of using enums over constants? I have a bunch of constants with string values that I would like to group, but I am unsure if enums (with string values) is the right way to group them: https://github.com/glaucuslinux/rad/blob/main/src/constants.nim |
16:52:43 | FromDiscord | <dawidek.2137> the most obvious way to count enum length was always {T.low .. T.high}.len |
16:53:08 | FromDiscord | <dawidek.2137> (len[T: enum] is the same as count[T: enum] from syste.nim) |
16:53:11 | FromDiscord | <odexine> except holey enums |
16:53:16 | FromDiscord | <dawidek.2137> oh, right |
16:58:08 | FromDiscord | <xkonti> sent a code paste, see https://play.nim-lang.org/#pasty=XSKTCFqHVWPG |
16:59:20 | FromDiscord | <xkonti> sent a code paste, see https://play.nim-lang.org/#pasty=OOKKarxXjztW |
17:00:20 | FromDiscord | <xkonti> You can use enums with sets to get flags that store multiple values in a single integer for memory efficiency. Nim's implementation makes it so that you don't need to hassle with bitwise operators! |
17:00:26 | FromDiscord | <odexine> personally id probably define direction as separate enums for x&y |
17:00:43 | FromDiscord | <firasuke> In reply to @xkonti "You can store a": Thing is I am using enums to store strings as values, not numbers |
17:05:13 | FromDiscord | <xkonti> sent a code paste, see https://play.nim-lang.org/#pasty=THXJmnGFLrPX |
17:06:59 | FromDiscord | <Phil> ... Thinking more about reactiveX and how it integrates well with actors has me thinking if maybe |
17:07:01 | FromDiscord | <Phil> Just maybe |
17:07:04 | Amun-Ra | you don't have to put commas when you split values into separate lines |
17:07:17 | FromDiscord | <Phil> My threadbutler doesn't need the "shared memory" bits of concurrency. |
17:07:28 | FromDiscord | <Phil> There's so many frontend languages that get away with just always deep-copying |
17:07:36 | Amun-Ra | threadbutler, nice name |
17:10:40 | FromDiscord | <Phil> Thanks, came to me because I wanted sth that treated threads like web-servers - an instance with pre-defined end-points |
17:10:46 | FromDiscord | <Phil> (edit) "Thanks, came to me because I wanted sth that treated threads like web-servers - an instance with pre-defined end-points ... " added "that may also ping back" |
17:10:55 | FromDiscord | <threefour> In reply to @xkonti "You define an enum": You can get the names as a string with `ord`, then you don't need to specify the strings explicitly. |
17:11:13 | FromDiscord | <threefour> (edit) "`ord`," => "`chr`," |
17:11:20 | FromDiscord | <solitudesf> In reply to @chronos.vitaqua "Why are people using": i hecking love macros |
17:11:23 | Amun-Ra | choosing the right name is one of the most "difficultest" things in programming |
17:13:41 | Amun-Ra | hmm, can I somehow force newSeq to be freed ad point A? |
17:13:47 | Amun-Ra | s/ad/at/ |
17:13:59 | * | beholders_eye quit (Read error: Connection reset by peer) |
17:16:55 | Amun-Ra | although that wouldn't mean the unrefed memory is going to be released to the OS |
17:16:57 | Amun-Ra | nevermind |
17:22:31 | FromDiscord | <dawidek.2137> In reply to @firasuke "I am impressed by": making the compiler prevent you from forgetting about handling one of the values in a case statement |
17:26:44 | Amun-Ra | that, and enum allows your variable to have its distinct type |
17:27:30 | Amun-Ra | and that eliminates adding apples to oranges |
17:30:50 | NimEventer | New thread by akavel: Rust interop/FFI experiments?, see https://forum.nim-lang.org/t/11563 |
17:31:45 | FromDiscord | <xkonti> sent a code paste, see https://play.nim-lang.org/#pasty=NqunUmmYfvez |
17:32:02 | FromDiscord | <firasuke> Before enums: https://github.com/glaucuslinux/rad/blob/fbb831bbc575bf82a4ee2cea309ce156dfba5116/src/constants.nim↵↵After enums: https://github.com/glaucuslinux/rad/blob/main/src/constants.nim |
17:32:23 | FromDiscord | <firasuke> In reply to @firasuke "Before enums: https://github.com/glaucuslinux/rad/b": Is the usage of enums justified here? Or should I go back to constants.. |
17:32:37 | FromDiscord | <firasuke> In reply to @dawidek.2137 "making the compiler prevent": This is both cool and annoying at times xD |
17:33:26 | FromDiscord | <firasuke> I had a huge constants.nim file that had all these as constants instead of enums, but after I saw I can basically cut the duplication of strings in half using $ I switched to enums |
17:33:33 | Amun-Ra | firasuke: depending on the usage I either make enums or distinct strings |
17:38:34 | FromDiscord | <xkonti> I'd say: If it makes your like easier, it's worth it. Passing those enums arround you're only passing an `int`, so that's performance improvement. Not sure if `$Enum.Value` is replaced with a constant by the compiler or not. |
17:40:33 | FromDiscord | <firasuke> In reply to @xkonti "I'd say: If it": definitely, it made it so much easier to read and write code (felt like I am doing bash tbh), but I felt I was over relying on this Nim feature, more than it being a good design thing |
17:41:39 | * | rockcavera joined #nim |
17:45:25 | FromDiscord | <xkonti> sent a long message, see https://pasty.ee/krMJtafouWnA |
17:45:27 | FromDiscord | <Robyn [She/Her]> In reply to @xkonti "I'd say: If it": I'd imagine it would be |
17:46:10 | FromDiscord | <Robyn [She/Her]> I've been using Nim for at least a year or two and I'd still say I'm considered a noob xD |
17:46:17 | FromDiscord | <firasuke> In reply to @xkonti "I'd say that having": I appreciate your input on this, even if you're a newbie |
17:46:18 | Amun-Ra | if it does not make you life harder, always separate your types |
17:46:24 | FromDiscord | <threefour> > lack of decent enums in other programming languages↵cough cough Go cough cough |
17:46:33 | FromDiscord | <firasuke> In reply to @Amun-Ra "if it does not": oh you mean into different files? |
17:46:50 | FromDiscord | <xkonti> In reply to @threefour "> lack of decent": C# 🪦 |
17:47:00 | FromDiscord | <firasuke> In reply to @threefour "> lack of decent": yeah Nim's enums are great, it's like flexing on other languages |
17:47:22 | FromDiscord | <threefour> Nim does a lot of things right |
17:47:41 | Amun-Ra | firasuke: I mean try to keep different kind of types separate from each other |
17:48:02 | FromDiscord | <threefour> I just wish parallelism was a little more robust, then I'd be totally happy. Well bug fixes too, but that's a given. |
17:48:15 | FromDiscord | <xkonti> In reply to @firasuke "oh you mean into": These don't have to be in different files. As long as you defined separate enum types (like in the code you linked) you're good. You can't mix both together anymore like you could with strings. |
17:48:50 | FromDiscord | <xkonti> (edit) "both together" => "unrelated values" |
17:50:18 | FromDiscord | <firasuke> ah ok |
17:51:29 | FromDiscord | <dawidek.2137> The thing I wish the most for for nim is to have more backends and ability to generate human readabale code |
17:51:40 | FromDiscord | <dawidek.2137> because then I could get away with using nim where i'm not supposed to |
17:51:57 | FromDiscord | <dawidek.2137> well, semi-human readable |
17:52:33 | FromDiscord | <firasuke> In reply to @dawidek.2137 "The thing I wish": I think with NIR being worked on, this should become a bit easier |
17:56:01 | * | fallback quit (Read error: Connection reset by peer) |
17:56:34 | FromDiscord | <Elegantbeef> If it's not holey you can just do `MyEnum.high.ord + 1` |
17:57:18 | Amun-Ra | are enums starting from 3 holey? |
17:57:29 | FromDiscord | <odexine> technically no |
17:57:33 | Amun-Ra | right |
17:59:00 | FromDiscord | <threefour> In reply to @threefour "I just wish parallelism": And circular dependency resolution that's bitten me several times |
18:01:40 | * | fallback joined #nim |
18:01:46 | FromDiscord | <demotomohiro> I just found there is already a macro in stdlib returns the number of items in an enum: https://nim-lang.org/docs/typetraits.html#enumLen.m%2Ctypedesc%5B%5D |
18:02:26 | FromDiscord | <firasuke> In reply to @threefour "And circular dependency resolution*": https://github.com/ryukoposting/toposort |
18:03:24 | FromDiscord | <Robyn [She/Her]> In reply to @demotomohiro "I just found there": I don't get why it's done as a macro honestly |
18:03:31 | FromDiscord | <Robyn [She/Her]> A template makes more sense to me ;-; |
18:07:48 | FromDiscord | <demotomohiro> In reply to @chronos.vitaqua "I don't get why": I think it requires to call `getType` proc in macros module to get the AST of enum type definition. |
18:08:24 | FromDiscord | <demotomohiro> And you cannot directly call `getType` in template. |
18:09:21 | Amun-Ra | circular dependency is skill issue |
18:10:19 | FromDiscord | <threefour> I mean yeah it can be refactored, but it'd be nice to just throw imports where you want em lol |
18:10:43 | Amun-Ra | either refactor or reforget it ;> |
18:11:15 | Amun-Ra | btw. you can have circular deps in the same type block |
18:22:36 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=JPnLsaWVDqNZ |
18:41:22 | FromDiscord | <aintea> sent a code paste, see https://play.nim-lang.org/#pasty=mABwMqrSvrSm |
18:44:17 | FromDiscord | <odexine> yes if you give the types for x and y |
18:44:41 | Amun-Ra | let f = (x, y: int) => (x + y) |
18:44:55 | Amun-Ra | ah, odexine was faster |
18:46:18 | NimEventer | New thread by xtr00: Feature Request: enum: relax or remove order requirements., see https://forum.nim-lang.org/t/11564 |
18:50:13 | FromDiscord | <Robyn [She/Her]> Isn't the point of an enum to be able to enumerate over it? |
18:50:20 | FromDiscord | <Robyn [She/Her]> Higher values included? |
18:52:36 | FromDiscord | <xkonti> Not necessarily. Most of the time when you use enums you don't iterate over them. Here's the origin of the term:↵> The term "enum" in programming, short for "enumeration," refers to a data type that consists of a set of named values. The concept itself dates back to the early days of computer science and programming, evolving from the mathematical notion of enumeration, which is essentially a complete, ordered listing of all items in a c |
18:52:58 | * | fallback quit (Read error: Connection reset by peer) |
18:53:31 | FromDiscord | <xkonti> In other words, enums are types that hold all possible values of something. Values that are closely related. |
18:55:03 | FromDiscord | <Phil> Yeh, enums are a "There's a limited amount of values this thing can have" sort of thing.↵For example a command a user may input into a CLI.↵There's only a limited number of commands the user can input. Therefore, enum. |
18:55:36 | FromDiscord | <Phil> "A group fully expressing the possible values of a given concept" could be another way to phrase it imo |
18:59:24 | FromDiscord | <demotomohiro> In reply to @chronos.vitaqua "<@288750616510201856> you don't need": Your solution uses `items` iterator in `enumutils`. So if `enumLen` template uses that iterator, `typetraits` module need to import `enumutils` module.↵`enumutils` module already imports `typetraits` module.↵`items` iterator in `enumutils` calls `enumFullRange` macro that calls `getType`.↵https://github.com/nim-lang/Nim/blob/version-2-0/lib/std/enumutils.nim |
19:01:45 | FromDiscord | <Robyn [She/Her]> Couldn't a mixin be used, though? Not sure how mixins work exactly still, but I have a rough idea |
19:02:10 | FromDiscord | <Robyn [She/Her]> And if it's a system module, why would it be an issue? |
19:02:57 | FromDiscord | <Robyn [She/Her]> I probably don't know what I'm talking about so ignore me |
19:04:46 | * | fallback joined #nim |
19:10:50 | FromDiscord | <Phil> I wish mixins worked more consistently |
19:11:20 | FromDiscord | <Phil> So often its "Bind that symbol in the scope of the current module".↵Well, I defined that other symbol in the current module and it's not getting bound 😐 |
19:27:55 | FromDiscord | <aintea> sent a code paste, see https://play.nim-lang.org/#pasty=GhhjIPnAhQqK |
19:28:15 | FromDiscord | <aintea> (edit) "https://play.nim-lang.org/#pasty=yloTkDmGCkHz" => "https://play.nim-lang.org/#pasty=IwMphYfLGuiU" |
19:28:44 | FromDiscord | <aintea> sent a code paste, see https://play.nim-lang.org/#pasty=qyVEeBYLyGZa |
19:30:37 | FromDiscord | <polylokh_39446> sent a code paste, see https://play.nim-lang.org/#pasty=egfQJiJWJegK |
19:30:39 | FromDiscord | <Phil> You want to destructure the tuple in the params |
19:30:50 | FromDiscord | <Phil> I don't think that's possible. Best you can do is named tuple type |
19:31:10 | FromDiscord | <aintea> thanks |
19:31:19 | FromDiscord | <aintea> I love nim |
19:31:32 | FromDiscord | <aintea> Looks like generics in Nim don't love me |
19:39:55 | * | ntat quit (Quit: Leaving) |
19:49:37 | * | qui joined #nim |
19:51:46 | * | qui is now known as qui1 |
19:54:59 | * | fallback quit (Read error: Connection reset by peer) |
19:55:11 | * | qui1 is now known as qui |
20:13:34 | FromDiscord | <juancarlospaco> If you have spam on Github issues, I made a Github action to auto-moderate spam (because cant find one), PR welcome, watch the video:↵https://github.com/juancarlospaco/antispam-action?tab=readme-ov-file#docs /cc @ringabout |
20:20:42 | * | def- quit (Quit: -) |
20:20:57 | * | def- joined #nim |
20:22:57 | NimEventer | New thread by thegraynode: Nim covered by Stephen Blum, CTO of PubNub, see https://forum.nim-lang.org/t/11565 |
20:34:19 | * | fallback joined #nim |
20:40:48 | FromDiscord | <System64 ~ Flandre Scarlet> Is it possible to import a specific function/proc from a Nim file and export this function, |
20:40:52 | FromDiscord | <System64 ~ Flandre Scarlet> (edit) "function," => "function?" |
21:23:10 | FromDiscord | <Robyn [She/Her]> Anyone know how I'd implement passes that go through an AST and ensure that it's valid? Not too sure how to go about it, tbh |
21:28:08 | FromDiscord | <dawidek.2137> In reply to @sys64 "Is it possible to": export keyword, probably (didn't use it) |
21:28:31 | FromDiscord | <polylokh_39446> sent a code paste, see https://play.nim-lang.org/#pasty=XbJtldMArXsa |
21:30:08 | FromDiscord | <dawidek.2137> In reply to @chronos.vitaqua "Anyone know how I'd": use macros.dumpTree to check what the expected tree looks like, in your macro call macros.error to show an error message if something is wrong with the node tree it received |
21:30:36 | FromDiscord | <Robyn [She/Her]> Ah I should've specified, it's unrelated to Nim's AST, this is for my own parser |
22:58:13 | * | def- quit (Quit: -) |
23:01:57 | * | def- joined #nim |
23:09:09 | * | gst quit (Quit: Client closed) |
23:12:20 | * | gst joined #nim |
23:44:53 | FromDiscord | <dawidek.2137> what is this pragma (seen in system.nim)? {.callsite.} |
23:54:55 | FromDiscord | <polylokh_39446> sent a code paste, see https://play.nim-lang.org/#pasty=YPjhAApUBxVh |