00:02:11 | FromDiscord | <patitotective> In reply to @patitotective "Hi, I'm getting the": Hey beef, I was trying to fix this issue and it seems that the key stored in `defaultTable` from the `{.defaults.}` pragma is different from the result `getImpl` returns in the `implDefaults` macro.↵So in this case `maxLength = 10u.some` is actually converted to `maxLength = some(10'u)` by `getImpl`, therefore it gives that key does not exist error.↵A temporary fix is to change |
00:03:46 | FromDiscord | <Elegantbeef> There might be a better way to do constructor to remove the `implDefaults` situation |
00:04:01 | FromDiscord | <Elegantbeef> Procs can be emitted inside type sections from macros, so that might be the trick to do |
00:05:48 | FromDiscord | <patitotective> so move `implDefaults` to `defaults`, right? I'll try to see if I can do it... |
00:06:46 | FromDiscord | <Elegantbeef> Not move it there but actually emit the constructors there |
00:06:46 | FromDiscord | <Elegantbeef> Then make `implDefaults` takes the flags |
00:07:33 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4JCC |
00:07:50 | FromDiscord | <Elegantbeef> Doing so will make the code cleaner of course |
00:08:10 | FromDiscord | <Elegantbeef> no longer needing `implDefaults` or storing a constructor table |
00:10:25 | FromDiscord | <patitotective> In reply to @Elegantbeef "You can do something": I don't quite understand why there is `type MyType = ` at the beginning... |
00:10:34 | FromDiscord | <Elegantbeef> Cause that's the user type |
00:10:59 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4JCE |
00:11:09 | FromDiscord | <Elegantbeef> You convert the latter to the above and it should work iirc |
00:12:37 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4JCF |
00:12:37 | FromDiscord | <Elegantbeef> For a template example |
00:12:58 | FromDiscord | <Elegantbeef> The code inside `test` would be generated by `defaults` |
00:13:12 | FromDiscord | <Elegantbeef> Hopefully this makes sense 😄 |
00:13:51 | FromDiscord | <patitotective> In reply to @Elegantbeef "Hopefully this makes sense": I'm starting to get it, thank you |
00:16:08 | FromDiscord | <Elegantbeef> Arkanoid it's not ideal, but hey it's got automatic memory management invoked with optional `reclaim` steps 😄 https://github.com/beef331/nimtrest/blob/master/rcu.nim |
00:16:08 | FromDiscord | <Elegantbeef> And it uses type states to protect it |
00:16:09 | FromDiscord | <Elegantbeef> Still using worlds dumbest sync method |
00:20:48 | FromDiscord | <patitotective> another question, wouldn't it be simpler to store the type instead of the whole type definition in `defaultTable`? store `Settings` instead of `Settings {...} = object ...` |
00:21:23 | FromDiscord | <Elegantbeef> The issue is that we're using an untyped AST so we do not have the luxury of knowing if `Settings` is different if implemented in two separate modules |
00:21:38 | FromDiscord | <Elegantbeef> If you move the generated procs inside of the typedef, you will not need to have the `defaultTable` anymore |
00:25:05 | FromDiscord | <patitotective> so in that case `implDefaults` wouldn't actually generate the `init` proc but just call the `init` proc from `MyType`? |
00:25:26 | FromDiscord | <Elegantbeef> If you work is done properly you do not need `implDefaults` any further |
00:25:29 | FromDiscord | <Elegantbeef> your\ |
00:26:16 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4JCI |
00:26:18 | FromDiscord | <Elegantbeef> That should just work |
00:26:40 | FromDiscord | <patitotective> Oh, ok, I'll try to code it↵Thanks |
00:27:01 | FromDiscord | <Elegantbeef> Instead of `implDefaults` taking flags `defaults` will |
00:27:12 | FromDiscord | <Elegantbeef> Instead of doing the logic later you just do it in the type defintion |
00:27:56 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4JCJ |
00:33:15 | * | rez joined #nim |
01:58:13 | FromDiscord | <patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4JD6 |
01:58:23 | FromDiscord | <Elegantbeef> `echo result.repr` |
01:58:38 | FromDiscord | <Elegantbeef> In the template it's a statement list that ends with a type |
01:59:50 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4JD7 |
02:00:12 | FromDiscord | <Elegantbeef> Wait it doesnt expand the `test()` call 😄 |
02:24:30 | FromDiscord | <patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4JDc |
02:25:07 | FromDiscord | <Elegantbeef> Is it a `nnkStmtList`? |
02:25:52 | FromDiscord | <patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4JDd |
02:27:07 | FromDiscord | <patitotective> I also tried to return a `nnkTypeDef` with a statement list directly and not a `nnkObjectTy` but it didn't work |
02:28:15 | FromDiscord | <Elegantbeef> Try returning `nnkTypeSection` with that `nnkTypeDef` you showed above |
02:29:18 | FromDiscord | <Elegantbeef> Might not be able to do what we want here |
02:29:35 | FromDiscord | <patitotective> In reply to @Elegantbeef "Try returning `nnkTypeSection` with": same error :/ |
02:29:58 | FromDiscord | <Elegantbeef> and `echo result.repr`? |
02:31:44 | FromDiscord | <patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4JDf |
02:31:49 | FromDiscord | <patitotective> (edit) |
02:32:18 | FromDiscord | <patitotective> sent a code paste, see https://paste.rs/dkRtL |
02:32:27 | FromDiscord | <Elegantbeef> Remove the `nnkPragma` from \`SideSettings |
02:33:58 | * | dza quit (Remote host closed the connection) |
02:33:58 | FromDiscord | <Elegantbeef> `InsideSettings`\ |
02:36:54 | * | dza joined #nim |
02:37:20 | FromDiscord | <patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4JDi |
02:37:26 | FromDiscord | <patitotective> (edit) |
02:40:50 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4JDj |
02:48:24 | * | rez quit (Ping timeout: 245 seconds) |
02:56:00 | FromDiscord | <patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4JDm |
02:57:47 | FromDiscord | <Elegantbeef> No problem, nice and buh bye |
03:25:50 | * | azimut joined #nim |
07:54:31 | arkanoid | Elegantbeef, I'm playing with type states |
07:54:38 | arkanoid | and I like them |
07:55:25 | arkanoid | is it possible to get a list of all the available functions for a type? |
07:55:29 | FromDiscord | <Elegantbeef> Nice |
07:55:30 | FromDiscord | <Elegantbeef> They're great |
07:55:39 | FromDiscord | <Elegantbeef> Nope |
07:55:53 | arkanoid | not even at compile time? |
07:56:19 | FromDiscord | <Elegantbeef> There is no way to query all procedures |
07:56:36 | arkanoid | mmmm ok |
07:58:14 | arkanoid | I was thinking what would be a nice playground for Type states. A finite state machines that shows possible transitions at runtime would be nice, but main loop would require to get the procs available for a type |
09:14:03 | FromDiscord | <demotomohiro> Maybe you can make a macro that creates a list of procs using macrocache.↵https://nim-lang.org/docs/macrocache.html↵And you set that macro as pragma to each procedures. |
09:21:05 | arkanoid | demotomohiro, thanks! |
09:31:21 | arkanoid | do you know why I can't create my object here, and =copy is summoned? https://play.nim-lang.org/#ix=4JEC |
10:01:04 | FromDiscord | <demotomohiro> It seems these error pargma cause compile error even if it is actually not called.↵Try replacing error pragma with `doAssert false`. |
10:04:20 | FromDiscord | <demotomohiro> You can forbid copy by adding error pragma to procs: https://nim-lang.org/docs/manual.html#pragmas-error-pragma |
10:05:07 | arkanoid | demotomohiro! right! the pragma goes before the `=` in proc declaration, not after it |
10:05:10 | arkanoid | thanks |
11:40:59 | * | GreatWhiteSnark joined #nim |
12:23:58 | * | junaid__ joined #nim |
12:35:13 | * | xet7 quit (Remote host closed the connection) |
12:58:45 | * | junaid__ quit (Quit: leaving) |
13:57:55 | * | alphacentauri quit (Quit: WeeChat 4.1.0) |
14:19:45 | FromDiscord | <patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4JFT |
14:49:51 | FromDiscord | <Chronos [She/Her]> How hard would it be to make a lib allowing for easy abstractions over async libraries |
14:56:06 | FromDiscord | <Phil> Depends really, I can't see a concept for how |
14:57:21 | FromDiscord | <Phil> I guess unless you make everything blocking |
14:57:33 | FromDiscord | <nnsee> what would these abstractions look like? |
15:16:14 | * | antranigv quit (Quit: ZNC 1.8.2 - https://znc.in) |
15:20:32 | * | antranigv joined #nim |
15:21:00 | FromDiscord | <patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4JGh |
15:46:48 | * | alphacentauri joined #nim |
15:47:38 | arkanoid | do you know how can I forbid =copy while preserving type states? https://play.nim-lang.org/#ix=4JGo |
15:51:49 | arkanoid | also, if I skip the assignments, and just chain the calls, I get wrong output https://play.nim-lang.org/#ix=4JGr |
16:20:22 | FromDiscord | <demotomohiro> Maybe it is Nim bug.↵Combining addr, cast, var parameter and var return type looks like unsafe.↵You might need to check Nim generated C code to see if it use pointers or unions correctly. |
16:25:47 | arkanoid | demotomohiro, it looks like a but, yeah. I'd like to skip those casts, but I don't know how to use type states without copy otherwise |
16:30:23 | arkanoid | posting on forum for confirmation |
16:30:35 | FromDiscord | <demotomohiro> So, that means you need to create a new pointer but different type. |
16:33:48 | NimEventer | New thread by giaco: Playing with type states and lifetime-tracking hooks, facing some unexpected behavior, see https://forum.nim-lang.org/t/10563 |
16:34:29 | FromDiscord | <demotomohiro> By the way, you can access generic type's parameter like `e.MaterialSate` or `e.T`. |
16:37:46 | FromDiscord | <Chronos [She/Her]> In reply to @nnsee "what would these abstractions": By abstractions I mean it'd just expose an API that utilises another async lib (whether it's chronos or asyncdispatch or neither) |
16:38:05 | FromDiscord | <Chronos [She/Her]> In a way that it's essentially a drop-in replacement for the most part |
16:38:13 | FromDiscord | <Chronos [She/Her]> Tho I'd imagine lower level stuff would be difficult |
16:38:24 | FromDiscord | <Chronos [She/Her]> And I'd probably ignore that as a whole tbh lol |
16:39:01 | FromDiscord | <demotomohiro> As far as I know, you cannot change a type of variable after it is declared.↵So if you want to change type state, create a copy or new pointer with different type.↵Or use object variants? |
16:39:16 | FromDiscord | <odexine> chronos and asyncdispatch are already relatively similar to be almost-dropins though? |
16:43:30 | FromDiscord | <Chronos [She/Her]> There's still minor differences though, no? |
16:43:48 | FromDiscord | <leorize> that become an issue if you want to share the base libraries (ie. subprocess, networking)↵(@Chronos [She/Her]) |
16:44:09 | FromDiscord | <pcarrier> sent a code paste, see https://play.nim-lang.org/#ix=4JGH |
16:44:43 | FromDiscord | <leorize> outputExpected is generated by testament |
16:44:54 | FromDiscord | <leorize> you have to turn megatest on to have it |
16:45:43 | FromDiscord | <leorize> it's done by concatenating all tests outputs together |
16:45:44 | FromDiscord | <leorize> and the tests themselves |
16:45:44 | FromDiscord | <leorize> to compile into one big binary |
16:46:29 | FromDiscord | <pcarrier> I dont want thiz. Should i disable something? |
16:47:00 | FromDiscord | <pcarrier> Just run all tests, thanks |
16:47:56 | FromDiscord | <leorize> you can opt out of megatest by putting `megatest: off` in the test spec I think |
16:49:52 | FromDiscord | <pcarrier> I'd rather do so system-wide? |
16:49:54 | * | alphacentauri quit (Quit: WeeChat 4.1.0) |
16:50:22 | FromDiscord | <leorize> megatest won't run if your test is not joinable, so I think the spec is `joinable: false` |
16:50:46 | FromDiscord | <leorize> you can't, unless you just add `--megatest:off` to all testament calls |
16:50:57 | FromDiscord | <pcarrier> also, can I specify a directory where the binaries should go? they pollute my tests/ directory and I don't want to write a gitignore entry for every test file... |
16:51:41 | FromDiscord | <leorize> despite being advertised as a general use tool, testament is mostly built to serve as a compiler tester with many assumptions about the testing environment |
16:51:53 | FromDiscord | <Chronos [She/Her]> In reply to @leorize "that become an issue": Fair |
16:52:07 | FromDiscord | <Chronos [She/Her]> I wonder if there's actually a point to doing this hm... |
16:52:07 | FromDiscord | <leorize> if you want a feature I afraid you'll have to make a PR for it |
16:52:27 | FromDiscord | <pcarrier> sent a code paste, see https://play.nim-lang.org/#ix=4JGL |
16:52:52 | FromDiscord | <pcarrier> what should I use to run my tests? I'm open to alternatives to `testament` |
16:53:09 | FromDiscord | <leorize> this is what I use\: https://github.com/disruptek/balls |
16:55:16 | FromDiscord | <leorize> it doesn't pollute your source directory, it reprints failure logs at the end of a run, it run tests in parallel |
16:55:17 | FromDiscord | <leorize> and it can work in macro-heavy environment very well, being originally conceived to test cps |
16:55:21 | FromDiscord | <pcarrier> ah my bad, `testament --megatest:off all` works (`testament all --megatest:off` doesn't) |
16:56:40 | arkanoid | wow, balls looks really nice |
16:57:19 | FromDiscord | <pcarrier> if I didn't _have_ to use it (ie it was an option to run tests but didn't require importing it in my unit tests), I'd jump on it |
16:58:14 | FromDiscord | <leorize> you don't have to import it, it runs all test files |
16:58:22 | FromDiscord | <leorize> you just don't get nice output without it |
17:00:16 | arkanoid | demotomohiro, thanks, e.MaterialState works and I've removed the typetraits dependency |
17:00:37 | FromDiscord | <pcarrier> hmmm balls doesn't seem to be in the nimble repository, how do I add it to my nimble file? |
17:00:51 | FromDiscord | <leorize> add the github url |
17:01:04 | FromDiscord | <leorize> https://github.com/alaviss/union/blob/main/union.nimble#L12 \<- example |
17:01:07 | FromDiscord | <pcarrier> noice |
17:02:04 | FromDiscord | <leorize> version 4 is out if you wanna try it, I forgot why I didn't update by now |
17:02:36 | FromDiscord | <leorize> oh right, because it doesn't work with old nim (\< 1.8.0) anymore |
17:03:43 | FromDiscord | <pcarrier> sent a code paste, see https://play.nim-lang.org/#ix=4JGQ |
17:03:44 | FromDiscord | <pcarrier> (running nim 2.0.0) |
17:05:42 | FromDiscord | <raynei486> pretty sure that doesn't install balls |
17:05:49 | FromDiscord | <raynei486> but downloads it as a usable dependency |
17:05:54 | FromDiscord | <raynei486> so it's not in the path |
17:06:21 | FromDiscord | <pcarrier> OK, how do I achieve what I'm after? |
17:08:24 | FromDiscord | <raynei486> well my dumb solution would just be `exec nimble install "https://github.com/disruptek/balls"` |
17:08:34 | FromDiscord | <raynei486> (edit) "nimble" => ""nimble" | ""https://github.com/disruptek/balls"`" => "https://github.com/disruptek/balls"`" |
17:08:34 | FromDiscord | <pcarrier> doesn't feel great |
17:08:46 | FromDiscord | <raynei486> yeah hence why dumb solution |
17:08:53 | FromDiscord | <raynei486> someone probably knows a better way |
17:09:50 | FromDiscord | <pcarrier> I'll stick to `testament` for now, seems to do the job 🙂 |
17:15:23 | FromDiscord | <patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4JGV |
17:15:37 | FromDiscord | <patitotective> (edit) "https://play.nim-lang.org/#ix=4JGV" => "https://play.nim-lang.org/#ix=4JGW" |
17:17:03 | FromDiscord | <Chronos [She/Her]> In reply to @patitotective "I don't understand why": Does making it a ref object fix it? |
17:17:23 | FromDiscord | <patitotective> In reply to @chronos.vitaqua "Does making it a": no |
17:19:21 | FromDiscord | <patitotective> I would say that it happens because you can't have a `seq` of void |
17:19:41 | FromDiscord | <patitotective> But `c` shouldn't exist if `x` is `false`, right? |
17:21:42 | FromDiscord | <patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4JGY |
17:23:19 | FromDiscord | <patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4JGZ |
17:24:49 | FromDiscord | <Chronos [She/Her]> Ah, not sure then |
17:26:00 | FromDiscord | <patitotective> I guess I'll open a thread in the forum if anyone figures it out |
17:31:19 | * | xet7 joined #nim |
17:33:25 | NimEventer | New thread by Patitotective: Invalid type void in a sequence in a generic object variant fails, see https://forum.nim-lang.org/t/10565 |
17:52:30 | FromDiscord | <pcarrier> any languages implemented in Nim besides min and mn? |
17:53:07 | FromDiscord | <pcarrier> wanna study the field before I get too far into implementing my own 🙂 |
17:53:18 | * | xet7_ joined #nim |
17:55:04 | * | antranigv quit (Quit: ZNC 1.8.2 - https://znc.in) |
17:55:24 | * | xet7_ quit (Client Quit) |
17:55:27 | FromDiscord | <leorize> nim, duh |
17:55:43 | * | xet7_ joined #nim |
17:55:57 | FromDiscord | <leorize> some people at langdev is building a language too, although derived from nim |
17:57:14 | * | xet7 quit (Ping timeout: 258 seconds) |
17:57:24 | FromDiscord | <Chronos [She/Her]> I've given up tbf, too out of my depth- |
17:57:43 | FromDiscord | <Chronos [She/Her]> In reply to @pcarrier "wanna study the field": NimLox exists too iirc |
17:58:05 | FromDiscord | <leorize> liquidev used to build one I think |
17:58:14 | FromDiscord | <leorize> but they switched to rust |
17:58:21 | * | antranigv joined #nim |
17:59:09 | FromDiscord | <leorize> https://github.com/liquidev/hayago |
17:59:18 | * | xet7__ joined #nim |
18:03:13 | * | xet7_ quit (Ping timeout: 260 seconds) |
18:03:50 | FromDiscord | <raynei486> In reply to @pcarrier "any languages implemented in": [make a lisp](https://github.com/kanaka/mal) has a nim implementation |
18:06:47 | * | xet7_ joined #nim |
18:10:32 | * | xet7__ quit (Ping timeout: 246 seconds) |
18:10:37 | * | xet7 joined #nim |
18:13:43 | * | xet7_ quit (Ping timeout: 260 seconds) |
18:16:08 | * | antranigv quit (Quit: ZNC 1.8.2 - https://znc.in) |
18:16:34 | * | xet7_ joined #nim |
18:18:36 | * | antranigv joined #nim |
18:20:20 | * | xet7 quit (Ping timeout: 246 seconds) |
18:24:07 | * | xet7__ joined #nim |
18:27:41 | * | xet7_ quit (Ping timeout: 246 seconds) |
18:27:53 | * | antranigv quit (Quit: ZNC 1.8.2 - https://znc.in) |
18:32:43 | * | antranigv joined #nim |
18:36:11 | * | xet7_ joined #nim |
18:39:07 | * | xet7 joined #nim |
18:39:36 | * | xet7__ quit (Ping timeout: 246 seconds) |
18:40:50 | * | xet7__ joined #nim |
18:42:01 | * | xet7_ quit (Ping timeout: 252 seconds) |
18:42:26 | * | xet7_ joined #nim |
18:45:13 | * | xet7__ quit (Ping timeout: 260 seconds) |
18:45:13 | * | xet7 quit (Ping timeout: 260 seconds) |
18:51:14 | * | xet7__ joined #nim |
18:52:37 | * | xet7 joined #nim |
18:54:35 | * | Batzy quit (Ping timeout: 240 seconds) |
18:55:02 | * | Batzy joined #nim |
18:55:13 | * | xet7_ quit (Ping timeout: 252 seconds) |
18:55:41 | * | xet7__ quit (Ping timeout: 246 seconds) |
18:59:12 | * | GreatWhiteSnark quit (Ping timeout: 246 seconds) |
18:59:25 | * | xet7_ joined #nim |
19:01:32 | * | xet7__ joined #nim |
19:03:23 | * | xet7 quit (Ping timeout: 246 seconds) |
19:05:28 | * | xet7_ quit (Ping timeout: 258 seconds) |
19:05:53 | * | xet7 joined #nim |
19:08:15 | * | xet7_ joined #nim |
19:09:18 | * | xet7__ quit (Ping timeout: 258 seconds) |
19:12:22 | * | xet7 quit (Ping timeout: 258 seconds) |
19:13:04 | * | lucasta joined #nim |
19:15:35 | * | xet7__ joined #nim |
19:18:17 | * | xet7 joined #nim |
19:19:14 | * | xet7_ quit (Ping timeout: 245 seconds) |
19:21:58 | * | xet7__ quit (Ping timeout: 260 seconds) |
20:14:36 | * | xet7_ joined #nim |
20:17:58 | * | xet7 quit (Ping timeout: 260 seconds) |
20:24:08 | * | xet7__ joined #nim |
20:27:53 | * | xet7_ quit (Ping timeout: 260 seconds) |
20:29:15 | * | xet7_ joined #nim |
20:33:07 | * | xet7__ quit (Ping timeout: 252 seconds) |
20:36:28 | * | xet7__ joined #nim |
20:40:16 | * | xet7_ quit (Ping timeout: 252 seconds) |
20:49:56 | * | azimut quit (Ping timeout: 256 seconds) |
20:57:40 | * | xet7_ joined #nim |
21:01:09 | FromDiscord | <sOkam! 🫐> In reply to @pcarrier "any languages implemented in": I'm working on https://github.com/heysokam/minc, but don't know if you would consider it a "lang implemented in nim" since its taking the nim raw ast an outputting readable C |
21:01:38 | FromDiscord | <sOkam! 🫐> If you want a good reference for lex+parse+ast ... nim itself is the best example of a lang implemented in nim, to be honest |
21:01:43 | * | xet7__ quit (Ping timeout: 252 seconds) |
21:02:22 | FromDiscord | <sOkam! 🫐> since it uses parsebase and all the tools you would use to create it from scratch |
21:02:44 | FromDiscord | <sOkam! 🫐> (edit) "it" => "a lang" | "a langfrom scratch ... " added "using nim" |
21:06:46 | * | Guest46 joined #nim |
21:09:41 | * | Guest46 quit (Client Quit) |
21:21:40 | FromDiscord | <taperfade> Hii |
21:21:56 | FromDiscord | <taperfade> how do i make the exe copy itself into a different folder ? |
21:23:50 | * | xet7__ joined #nim |
21:27:34 | * | xet7_ quit (Ping timeout: 252 seconds) |
21:35:26 | * | lucasta quit (Quit: Leaving) |
21:39:45 | * | xet7_ joined #nim |
21:40:22 | * | FromDiscord quit (Ping timeout: 255 seconds) |
21:40:59 | * | FromDiscord joined #nim |
21:43:24 | * | xet7__ quit (Ping timeout: 258 seconds) |
21:51:06 | * | xet7__ joined #nim |
21:54:39 | * | xet7_ quit (Ping timeout: 245 seconds) |
22:03:13 | * | xet7_ joined #nim |
22:06:47 | * | xet7__ quit (Ping timeout: 246 seconds) |
22:17:53 | * | xet7__ joined #nim |
22:21:21 | * | xet7_ quit (Ping timeout: 258 seconds) |
22:27:30 | * | xet7_ joined #nim |
22:31:22 | * | xet7__ quit (Ping timeout: 252 seconds) |
22:55:59 | FromDiscord | <user2m> In reply to @taperfade "how do i make": `nim c -r -o:"path/to/dir/app.nim" app.nim |
22:56:10 | FromDiscord | <user2m> (edit) "app.nim" => "app.nim`" |
22:59:10 | * | xet7__ joined #nim |
23:01:38 | * | xet7 joined #nim |
23:03:08 | * | xet7_ quit (Ping timeout: 258 seconds) |
23:04:40 | * | xet7__ quit (Ping timeout: 258 seconds) |
23:06:41 | * | xet7_ joined #nim |
23:08:19 | * | xet7__ joined #nim |
23:08:44 | FromDiscord | <BanannaMan> sent a long message, see http://ix.io/4JIf |
23:09:05 | FromDiscord | <BanannaMan> (edit) "http://ix.io/4JIf" => "http://ix.io/4JIg" |
23:09:17 | FromDiscord | <BanannaMan> (edit) "http://ix.io/4JIg" => "https://paste.rs/vipjA" |
23:10:48 | * | xet7 quit (Ping timeout: 258 seconds) |
23:10:55 | FromDiscord | <user2m> no id ead what your trying to do but I know s must be a var variable to be assigned to `proc stpush (s: var seq[int], x: int) =` |
23:12:20 | * | xet7_ quit (Ping timeout: 258 seconds) |
23:15:45 | FromDiscord | <Phil> sent a long message, see http://ix.io/4JIj |
23:17:37 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4JIk |
23:21:29 | FromDiscord | <BanannaMan> In reply to @isofruit "I am confused on": Ah I see. Thanks guys |
23:26:19 | * | xet7_ joined #nim |
23:29:58 | * | xet7__ quit (Ping timeout: 258 seconds) |
23:34:57 | FromDiscord | <BanannaMan> I forgot to ask about discardable procs. Why is it that my prices only work if I make them discardable? |
23:35:33 | FromDiscord | <Elegantbeef> Nim is an expressionful language if you have a proc that returns a value and do not want the result you do `discard myProc()` |
23:35:57 | FromDiscord | <BanannaMan> (edit) "prices" => "procs" |
23:36:20 | FromDiscord | <BanannaMan> In reply to @Elegantbeef "Nim is an expressionful": What if I don't want to use discard myProc()? |
23:36:59 | FromDiscord | <Elegantbeef> Make the proc discardable |
23:37:01 | FromDiscord | <BanannaMan> What if I want to call it like a regular function? |
23:37:28 | FromDiscord | <leorize> you just call it? |
23:37:43 | FromDiscord | <BanannaMan> Strange |
23:37:58 | FromDiscord | <leorize> making the proc discardable just means you tell the compiler to not yell at you for ignoring the return value |
23:37:58 | FromDiscord | <BanannaMan> My procs don't work unless I explicitly use discard |
23:38:08 | FromDiscord | <BanannaMan> Oh okay |
23:38:33 | FromDiscord | <BanannaMan> How do I not ignore the return value? This is a little bit confusing to me. |
23:38:45 | FromDiscord | <Elegantbeef> `var a = myPoc()` |
23:39:14 | FromDiscord | <leorize> just use the value \:P |
23:39:21 | FromDiscord | <Elegantbeef> Consume the value no error |
23:39:21 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4JIN |
23:39:38 | FromDiscord | <BanannaMan> Hmmmm |
23:39:40 | FromDiscord | <BanannaMan> Ok |
23:48:29 | * | xet7__ joined #nim |
23:49:53 | arkanoid | Elegantbeef, thanks a lot for the answer on the forum! |
23:51:29 | FromDiscord | <Elegantbeef> No problem, though for this example I will note `distinct T` is valid instead of `distinct ExperimentImpl[T]` |
23:52:35 | * | xet7_ quit (Ping timeout: 258 seconds) |
23:53:43 | arkanoid | Elegantbeef, sure, if data: T is the only field it would degrade into just distinct T |
23:55:36 | * | xet7_ joined #nim |
23:57:17 | arkanoid | I'm trying to use `distinct T`, just to grok this better |
23:58:00 | arkanoid | Error: signature for '=copy' must be proc[T: object](x: var T; y: T) |
23:58:35 | arkanoid | can't stop copies of base types? |
23:59:04 | FromDiscord | <Elegantbeef> In the case you use distinct T you need to disable the copy on `Experiment[T]` |
23:59:12 | FromDiscord | <Elegantbeef> Since the base types have their own hooks |
23:59:38 | * | xet7__ quit (Ping timeout: 260 seconds) |