<< 22-10-2023 >>

00:02:11FromDiscord<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:46FromDiscord<Elegantbeef> There might be a better way to do constructor to remove the `implDefaults` situation
00:04:01FromDiscord<Elegantbeef> Procs can be emitted inside type sections from macros, so that might be the trick to do
00:05:48FromDiscord<patitotective> so move `implDefaults` to `defaults`, right? I'll try to see if I can do it...
00:06:46FromDiscord<Elegantbeef> Not move it there but actually emit the constructors there
00:06:46FromDiscord<Elegantbeef> Then make `implDefaults` takes the flags
00:07:33FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4JCC
00:07:50FromDiscord<Elegantbeef> Doing so will make the code cleaner of course
00:08:10FromDiscord<Elegantbeef> no longer needing `implDefaults` or storing a constructor table
00:10:25FromDiscord<patitotective> In reply to @Elegantbeef "You can do something": I don't quite understand why there is `type MyType = ` at the beginning...
00:10:34FromDiscord<Elegantbeef> Cause that's the user type
00:10:59FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4JCE
00:11:09FromDiscord<Elegantbeef> You convert the latter to the above and it should work iirc
00:12:37FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4JCF
00:12:37FromDiscord<Elegantbeef> For a template example
00:12:58FromDiscord<Elegantbeef> The code inside `test` would be generated by `defaults`
00:13:12FromDiscord<Elegantbeef> Hopefully this makes sense 😄
00:13:51FromDiscord<patitotective> In reply to @Elegantbeef "Hopefully this makes sense": I'm starting to get it, thank you
00:16:08FromDiscord<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:08FromDiscord<Elegantbeef> And it uses type states to protect it
00:16:09FromDiscord<Elegantbeef> Still using worlds dumbest sync method
00:20:48FromDiscord<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:23FromDiscord<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:38FromDiscord<Elegantbeef> If you move the generated procs inside of the typedef, you will not need to have the `defaultTable` anymore
00:25:05FromDiscord<patitotective> so in that case `implDefaults` wouldn't actually generate the `init` proc but just call the `init` proc from `MyType`?
00:25:26FromDiscord<Elegantbeef> If you work is done properly you do not need `implDefaults` any further
00:25:29FromDiscord<Elegantbeef> your\
00:26:16FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4JCI
00:26:18FromDiscord<Elegantbeef> That should just work
00:26:40FromDiscord<patitotective> Oh, ok, I'll try to code it↵Thanks
00:27:01FromDiscord<Elegantbeef> Instead of `implDefaults` taking flags `defaults` will
00:27:12FromDiscord<Elegantbeef> Instead of doing the logic later you just do it in the type defintion
00:27:56FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4JCJ
00:33:15*rez joined #nim
01:58:13FromDiscord<patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4JD6
01:58:23FromDiscord<Elegantbeef> `echo result.repr`
01:58:38FromDiscord<Elegantbeef> In the template it's a statement list that ends with a type
01:59:50FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4JD7
02:00:12FromDiscord<Elegantbeef> Wait it doesnt expand the `test()` call 😄
02:24:30FromDiscord<patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4JDc
02:25:07FromDiscord<Elegantbeef> Is it a `nnkStmtList`?
02:25:52FromDiscord<patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4JDd
02:27:07FromDiscord<patitotective> I also tried to return a `nnkTypeDef` with a statement list directly and not a `nnkObjectTy` but it didn't work
02:28:15FromDiscord<Elegantbeef> Try returning `nnkTypeSection` with that `nnkTypeDef` you showed above
02:29:18FromDiscord<Elegantbeef> Might not be able to do what we want here
02:29:35FromDiscord<patitotective> In reply to @Elegantbeef "Try returning `nnkTypeSection` with": same error :/
02:29:58FromDiscord<Elegantbeef> and `echo result.repr`?
02:31:44FromDiscord<patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4JDf
02:31:49FromDiscord<patitotective> (edit)
02:32:18FromDiscord<patitotective> sent a code paste, see https://paste.rs/dkRtL
02:32:27FromDiscord<Elegantbeef> Remove the `nnkPragma` from \`SideSettings
02:33:58*dza quit (Remote host closed the connection)
02:33:58FromDiscord<Elegantbeef> `InsideSettings`\
02:36:54*dza joined #nim
02:37:20FromDiscord<patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4JDi
02:37:26FromDiscord<patitotective> (edit)
02:40:50FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4JDj
02:48:24*rez quit (Ping timeout: 245 seconds)
02:56:00FromDiscord<patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4JDm
02:57:47FromDiscord<Elegantbeef> No problem, nice and buh bye
03:25:50*azimut joined #nim
07:54:31arkanoidElegantbeef, I'm playing with type states
07:54:38arkanoidand I like them
07:55:25arkanoidis it possible to get a list of all the available functions for a type?
07:55:29FromDiscord<Elegantbeef> Nice
07:55:30FromDiscord<Elegantbeef> They're great
07:55:39FromDiscord<Elegantbeef> Nope
07:55:53arkanoidnot even at compile time?
07:56:19FromDiscord<Elegantbeef> There is no way to query all procedures
07:56:36arkanoidmmmm ok
07:58:14arkanoidI 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:03FromDiscord<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:05arkanoiddemotomohiro, thanks!
09:31:21arkanoiddo you know why I can't create my object here, and =copy is summoned? https://play.nim-lang.org/#ix=4JEC
10:01:04FromDiscord<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:20FromDiscord<demotomohiro> You can forbid copy by adding error pragma to procs: https://nim-lang.org/docs/manual.html#pragmas-error-pragma
10:05:07arkanoiddemotomohiro! right! the pragma goes before the `=` in proc declaration, not after it
10:05:10arkanoidthanks
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:45FromDiscord<patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4JFT
14:49:51FromDiscord<Chronos [She/Her]> How hard would it be to make a lib allowing for easy abstractions over async libraries
14:56:06FromDiscord<Phil> Depends really, I can't see a concept for how
14:57:21FromDiscord<Phil> I guess unless you make everything blocking
14:57:33FromDiscord<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:00FromDiscord<patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4JGh
15:46:48*alphacentauri joined #nim
15:47:38arkanoiddo you know how can I forbid =copy while preserving type states? https://play.nim-lang.org/#ix=4JGo
15:51:49arkanoidalso, if I skip the assignments, and just chain the calls, I get wrong output https://play.nim-lang.org/#ix=4JGr
16:20:22FromDiscord<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:47arkanoiddemotomohiro, 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:23arkanoidposting on forum for confirmation
16:30:35FromDiscord<demotomohiro> So, that means you need to create a new pointer but different type.
16:33:48NimEventerNew 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:29FromDiscord<demotomohiro> By the way, you can access generic type's parameter like `e.MaterialSate` or `e.T`.
16:37:46FromDiscord<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:05FromDiscord<Chronos [She/Her]> In a way that it's essentially a drop-in replacement for the most part
16:38:13FromDiscord<Chronos [She/Her]> Tho I'd imagine lower level stuff would be difficult
16:38:24FromDiscord<Chronos [She/Her]> And I'd probably ignore that as a whole tbh lol
16:39:01FromDiscord<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:16FromDiscord<odexine> chronos and asyncdispatch are already relatively similar to be almost-dropins though?
16:43:30FromDiscord<Chronos [She/Her]> There's still minor differences though, no?
16:43:48FromDiscord<leorize> that become an issue if you want to share the base libraries (ie. subprocess, networking)↵(@Chronos [She/Her])
16:44:09FromDiscord<pcarrier> sent a code paste, see https://play.nim-lang.org/#ix=4JGH
16:44:43FromDiscord<leorize> outputExpected is generated by testament
16:44:54FromDiscord<leorize> you have to turn megatest on to have it
16:45:43FromDiscord<leorize> it's done by concatenating all tests outputs together
16:45:44FromDiscord<leorize> and the tests themselves
16:45:44FromDiscord<leorize> to compile into one big binary
16:46:29FromDiscord<pcarrier> I dont want thiz. Should i disable something?
16:47:00FromDiscord<pcarrier> Just run all tests, thanks
16:47:56FromDiscord<leorize> you can opt out of megatest by putting `megatest: off` in the test spec I think
16:49:52FromDiscord<pcarrier> I'd rather do so system-wide?
16:49:54*alphacentauri quit (Quit: WeeChat 4.1.0)
16:50:22FromDiscord<leorize> megatest won't run if your test is not joinable, so I think the spec is `joinable: false`
16:50:46FromDiscord<leorize> you can't, unless you just add `--megatest:off` to all testament calls
16:50:57FromDiscord<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:41FromDiscord<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:53FromDiscord<Chronos [She/Her]> In reply to @leorize "that become an issue": Fair
16:52:07FromDiscord<Chronos [She/Her]> I wonder if there's actually a point to doing this hm...
16:52:07FromDiscord<leorize> if you want a feature I afraid you'll have to make a PR for it
16:52:27FromDiscord<pcarrier> sent a code paste, see https://play.nim-lang.org/#ix=4JGL
16:52:52FromDiscord<pcarrier> what should I use to run my tests? I'm open to alternatives to `testament`
16:53:09FromDiscord<leorize> this is what I use\: https://github.com/disruptek/balls
16:55:16FromDiscord<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:17FromDiscord<leorize> and it can work in macro-heavy environment very well, being originally conceived to test cps
16:55:21FromDiscord<pcarrier> ah my bad, `testament --megatest:off all` works (`testament all --megatest:off` doesn't)
16:56:40arkanoidwow, balls looks really nice
16:57:19FromDiscord<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:14FromDiscord<leorize> you don't have to import it, it runs all test files
16:58:22FromDiscord<leorize> you just don't get nice output without it
17:00:16arkanoiddemotomohiro, thanks, e.MaterialState works and I've removed the typetraits dependency
17:00:37FromDiscord<pcarrier> hmmm balls doesn't seem to be in the nimble repository, how do I add it to my nimble file?
17:00:51FromDiscord<leorize> add the github url
17:01:04FromDiscord<leorize> https://github.com/alaviss/union/blob/main/union.nimble#L12 \<- example
17:01:07FromDiscord<pcarrier> noice
17:02:04FromDiscord<leorize> version 4 is out if you wanna try it, I forgot why I didn't update by now
17:02:36FromDiscord<leorize> oh right, because it doesn't work with old nim (\< 1.8.0) anymore
17:03:43FromDiscord<pcarrier> sent a code paste, see https://play.nim-lang.org/#ix=4JGQ
17:03:44FromDiscord<pcarrier> (running nim 2.0.0)
17:05:42FromDiscord<raynei486> pretty sure that doesn't install balls
17:05:49FromDiscord<raynei486> but downloads it as a usable dependency
17:05:54FromDiscord<raynei486> so it's not in the path
17:06:21FromDiscord<pcarrier> OK, how do I achieve what I'm after?
17:08:24FromDiscord<raynei486> well my dumb solution would just be `exec nimble install "https://github.com/disruptek/balls"`
17:08:34FromDiscord<raynei486> (edit) "nimble" => ""nimble" | ""https://github.com/disruptek/balls"`" => "https://github.com/disruptek/balls"`"
17:08:34FromDiscord<pcarrier> doesn't feel great
17:08:46FromDiscord<raynei486> yeah hence why dumb solution
17:08:53FromDiscord<raynei486> someone probably knows a better way
17:09:50FromDiscord<pcarrier> I'll stick to `testament` for now, seems to do the job 🙂
17:15:23FromDiscord<patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4JGV
17:15:37FromDiscord<patitotective> (edit) "https://play.nim-lang.org/#ix=4JGV" => "https://play.nim-lang.org/#ix=4JGW"
17:17:03FromDiscord<Chronos [She/Her]> In reply to @patitotective "I don't understand why": Does making it a ref object fix it?
17:17:23FromDiscord<patitotective> In reply to @chronos.vitaqua "Does making it a": no
17:19:21FromDiscord<patitotective> I would say that it happens because you can't have a `seq` of void
17:19:41FromDiscord<patitotective> But `c` shouldn't exist if `x` is `false`, right?
17:21:42FromDiscord<patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4JGY
17:23:19FromDiscord<patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4JGZ
17:24:49FromDiscord<Chronos [She/Her]> Ah, not sure then
17:26:00FromDiscord<patitotective> I guess I'll open a thread in the forum if anyone figures it out
17:31:19*xet7 joined #nim
17:33:25NimEventerNew 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:30FromDiscord<pcarrier> any languages implemented in Nim besides min and mn?
17:53:07FromDiscord<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:27FromDiscord<leorize> nim, duh
17:55:43*xet7_ joined #nim
17:55:57FromDiscord<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:24FromDiscord<Chronos [She/Her]> I've given up tbf, too out of my depth-
17:57:43FromDiscord<Chronos [She/Her]> In reply to @pcarrier "wanna study the field": NimLox exists too iirc
17:58:05FromDiscord<leorize> liquidev used to build one I think
17:58:14FromDiscord<leorize> but they switched to rust
17:58:21*antranigv joined #nim
17:59:09FromDiscord<leorize> https://github.com/liquidev/hayago
17:59:18*xet7__ joined #nim
18:03:13*xet7_ quit (Ping timeout: 260 seconds)
18:03:50FromDiscord<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:09FromDiscord<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:38FromDiscord<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:22FromDiscord<sOkam! 🫐> since it uses parsebase and all the tools you would use to create it from scratch
21:02:44FromDiscord<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:40FromDiscord<taperfade> Hii
21:21:56FromDiscord<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:59FromDiscord<user2m> In reply to @taperfade "how do i make": `nim c -r -o:"path/to/dir/app.nim" app.nim
22:56:10FromDiscord<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:44FromDiscord<BanannaMan> sent a long message, see http://ix.io/4JIf
23:09:05FromDiscord<BanannaMan> (edit) "http://ix.io/4JIf" => "http://ix.io/4JIg"
23:09:17FromDiscord<BanannaMan> (edit) "http://ix.io/4JIg" => "https://paste.rs/vipjA"
23:10:48*xet7 quit (Ping timeout: 258 seconds)
23:10:55FromDiscord<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:45FromDiscord<Phil> sent a long message, see http://ix.io/4JIj
23:17:37FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4JIk
23:21:29FromDiscord<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:57FromDiscord<BanannaMan> I forgot to ask about discardable procs. Why is it that my prices only work if I make them discardable?
23:35:33FromDiscord<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:57FromDiscord<BanannaMan> (edit) "prices" => "procs"
23:36:20FromDiscord<BanannaMan> In reply to @Elegantbeef "Nim is an expressionful": What if I don't want to use discard myProc()?
23:36:59FromDiscord<Elegantbeef> Make the proc discardable
23:37:01FromDiscord<BanannaMan> What if I want to call it like a regular function?
23:37:28FromDiscord<leorize> you just call it?
23:37:43FromDiscord<BanannaMan> Strange
23:37:58FromDiscord<leorize> making the proc discardable just means you tell the compiler to not yell at you for ignoring the return value
23:37:58FromDiscord<BanannaMan> My procs don't work unless I explicitly use discard
23:38:08FromDiscord<BanannaMan> Oh okay
23:38:33FromDiscord<BanannaMan> How do I not ignore the return value? This is a little bit confusing to me.
23:38:45FromDiscord<Elegantbeef> `var a = myPoc()`
23:39:14FromDiscord<leorize> just use the value \:P
23:39:21FromDiscord<Elegantbeef> Consume the value no error
23:39:21FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4JIN
23:39:38FromDiscord<BanannaMan> Hmmmm
23:39:40FromDiscord<BanannaMan> Ok
23:48:29*xet7__ joined #nim
23:49:53arkanoidElegantbeef, thanks a lot for the answer on the forum!
23:51:29FromDiscord<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:43arkanoidElegantbeef, sure, if data: T is the only field it would degrade into just distinct T
23:55:36*xet7_ joined #nim
23:57:17arkanoidI'm trying to use `distinct T`, just to grok this better
23:58:00arkanoidError: signature for '=copy' must be proc[T: object](x: var T; y: T)
23:58:35arkanoidcan't stop copies of base types?
23:59:04FromDiscord<Elegantbeef> In the case you use distinct T you need to disable the copy on `Experiment[T]`
23:59:12FromDiscord<Elegantbeef> Since the base types have their own hooks
23:59:38*xet7__ quit (Ping timeout: 260 seconds)