| 00:24:21 | * | Guest47 joined #nim |
| 00:30:31 | * | Guest47 quit (Quit: Client closed) |
| 00:31:40 | * | insanescholar joined #nim |
| 02:56:24 | * | rockcavera quit (Remote host closed the connection) |
| 04:04:39 | * | SchweinDeBurg joined #nim |
| 04:43:59 | * | insanescholar quit (Remote host closed the connection) |
| 08:41:18 | * | hygo joined #nim |
| 09:22:41 | * | insanescholar joined #nim |
| 09:28:13 | * | insanescholar quit (Ping timeout: 274 seconds) |
| 11:12:25 | * | insanescholar joined #nim |
| 11:44:06 | * | SchweinDeBurg quit (Remote host closed the connection) |
| 11:44:21 | * | SchweinDeBurg joined #nim |
| 11:56:38 | * | insanescholar quit (Remote host closed the connection) |
| 12:09:32 | * | SchweinD1 joined #nim |
| 12:09:33 | * | SchweinDeBurg quit (Remote host closed the connection) |
| 12:37:16 | FromDiscord | <pmunch> sent a code paste, see https://paste.rs/eDclH |
| 12:37:29 | FromDiscord | <pmunch> But I'm struggling with how to generate the check |
| 12:38:05 | FromDiscord | <pmunch> The macro must return a `TypeDef` node to fit within the `TypeSection`, so I can't really generate anything else.. |
| 12:41:04 | FromDiscord | <pmunch> And I can't seem to accept a `typed` argument into the `checkSize` macro, so I can't get the size of Test2 on compile time |
| 13:12:16 | FromDiscord | <b0rsuk> How can Nim be inspired by Pascal when it doesn't even have the walrus operator? `:=` |
| 13:12:59 | FromDiscord | <b0rsuk> But Python does! |
| 13:15:13 | FromDiscord | <gesee37> sent a long message, see https://paste.rs/eGYOR |
| 13:16:20 | FromDiscord | <gesee37> In reply to @b0rsuk "How can Nim be": What's the use of it ? |
| 13:17:08 | FromDiscord | <b0rsuk> Correct me if I'm wrong, but the size of `bool` is pre-determined, and the size of `int` depends on architecture. But you can tell Nim to use, for example, int16 rather than int? |
| 13:17:28 | FromDiscord | <pmunch> In reply to @b0rsuk "How can Nim be": How can French be inspired by Latin when it doesn't even have seven cases! |
| 13:18:19 | FromDiscord | <pmunch> In reply to @gesee37 "Well you are kind": Well I was trying to improve a long type section with a section of assertions after it.. |
| 13:18:29 | FromDiscord | <pmunch> So the syntax was really the main improvement |
| 13:18:50 | FromDiscord | <b0rsuk> In reply to @gesee37 "What's the use of": It's a bit like the a++ or ++a operators in C I guess? But they allow you to make an assignment and comparison at the same time (in Python). |
| 13:20:21 | FromDiscord | <gesee37> In reply to @pmunch "Well I was trying": Well can make a macro that take an untyped type section where each type has a `{.checkSize: xx.}` pragma |
| 13:20:45 | FromDiscord | <b0rsuk> sent a code paste, see https://paste.rs/AL2it |
| 13:21:11 | FromDiscord | <gesee37> In reply to @gesee37 "Well can make a": And generate static assert after or block them in the macro |
| 13:21:27 | FromDiscord | <b0rsuk> I think you're forced to add parentheses if you use the walrus. |
| 13:22:28 | FromDiscord | <gesee37> In reply to @b0rsuk "I'm not familiar with": Oh the definition operator (in math)↵↵Well can make some syntax easier↵I think you can do that with template... even though you will run in some scoping issues |
| 13:25:03 | FromDiscord | <pmunch> sent a code paste, see https://paste.rs/mrK4B |
| 13:25:06 | FromDiscord | <pmunch> Does that work? |
| 13:25:46 | FromDiscord | <pmunch> Yup |
| 13:28:27 | FromDiscord | <b0rsuk> I was just teasing. I know very little about Pascal and the most distinctive thing I know is the `:=`. |
| 13:29:49 | FromDiscord | <b0rsuk> But that is why the similarity to Pascal intrigues me. |
| 13:37:35 | FromDiscord | <pmunch> Araq used to program is Delphi and the first Nim compiler was written in it IIRC |
| 13:37:42 | FromDiscord | <pmunch> That's why it has some similarities |
| 13:51:53 | FromDiscord | <pmunch> Hmm, did something change with implicit return from blocks in 2.2.0? |
| 13:56:24 | FromDiscord | <Laylie> pmunch, if you're still looking\: https://paste.tchncs.de/upload/falcon-snail-deer |
| 14:03:35 | FromDiscord | <pmunch> Huh, how the fuck does _that_ work? |
| 14:03:47 | FromDiscord | <pmunch> Can you just add random `static` blocks to a type section? |
| 14:05:21 | FromDiscord | <Laylie> the only documentation i can find on it is this https://nim-lang.org/docs/manual_experimental.html#extended-macro-pragmas |
| 14:05:28 | FromDiscord | <Laylie> i always end up referring to metagn's skinsuit |
| 14:05:29 | FromDiscord | <pmunch> Wait, you're creating a nested type block?! |
| 14:05:55 | FromDiscord | <pmunch> Yeah I know you can create macros like that |
| 14:06:06 | FromDiscord | <pmunch> I just couldn't figure out how to run static code from within the code-block |
| 14:06:52 | FromDiscord | <Laylie> as far as i can understand it, nim allows you to return a dummy typesection (our `_`) that contains stuff other than types |
| 14:07:26 | FromDiscord | <Laylie> yeppers, nested type block |
| 14:07:58 | FromDiscord | <pmunch> Wild, never seen that before |
| 14:08:05 | FromDiscord | <pmunch> But thanks! |
| 14:09:48 | FromDiscord | <Laylie> specifically the part where it says↵> The ability to return nodes other than type definitions may also be supported, however currently this is not convenient when dealing with mutual type recursion. For now, macros can return an unused type definition where the right-hand node is of kind nnkStmtListType. Declarations in this node will be attached to the same scope as the parent scope of the type section. |
| 14:15:25 | FromDiscord | <pmunch> In reply to @pmunch "Hmm, did something change": Figured this out, it was that a `template` needs `: untyped` as the return if implicit returns should bubble through it. |
| 14:16:18 | FromDiscord | <gesee37> sent a code paste, see https://paste.rs/qIVk2 |
| 14:16:37 | FromDiscord | <gesee37> Suprised that `n` is alove outside the parenthesis |
| 14:16:45 | FromDiscord | <gesee37> (edit) "alove" => "alive" |
| 14:17:38 | FromDiscord | <pmunch> If only I could read.. I looked at that documentation page before asking my question @Laylie, but I stopped when I thought it was only repeating stuff I knew.. |
| 14:18:38 | FromDiscord | <pmunch> @gesee37, I think it's because () doesn't create a new scope like `block` does. And the `if` is technically part of it's own scope |
| 14:18:41 | FromDiscord | <pmunch> Or something like thta |
| 15:02:16 | FromDiscord | <_timurski> In reply to @pmunch "Figured this out, it": yeah I had this issue with a macro and was very confused. it just gets interpreted as a statement without that return type |
| 16:36:32 | * | insanescholar joined #nim |
| 17:06:58 | * | Mister_Magister quit (Excess Flood) |
| 17:10:15 | * | Mister_Magister joined #nim |